wordpress - How to set custom filler for product attributes like SIZE,COLOUR,PRICE,etc -


how set custom fillter product attributes size,colour,price,etc , knw there many plugin want custom code fillter.

product attributes rows in table wp_postmeta. can select corresponding posts building query on tables wp_posts , wp_postmeta. here example using $wpdb->prepare() , $wpdb->get_results():

$posts = $wpdb->get_results( $wpdb->prepare(     "select p.* {$wpdb->posts} p, {$wpdb->postmeta} m ".     "where p.id = m.post_id , m.meta_key = %s , m.meta_value = %s ".     "and p.post_status = 'publish' ".      "and p.post_type = '<your_post_type>',     array($attribute_name, $attribute_value) ) ); 

Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -