php - Woocommerce: Show products filtered by attribute -


i want filter products attribute in woocommerce using checkbox or alternatively link. if mark checkbox or click link want products have attribute.

how can this? files should edit?

edit: need query products have custom attribute 'demo' in case.

i'm doing this:

$args = array ( 'meta_query' => array(  array( 'key' => 'meta_value',         'value' => 'demo',         'compare' => 'like', ),         ),  ); 

whats wrong??

thanks!

ok got result!

i have this:

$args = array (       'post_type'  => 'product',      'posts_per_page'  => 12,      'meta_query' => array(           array(            'value' => 'demo',            'compare' => 'like'          ),         ),  

);

thanks anyway help!


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -