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
Post a Comment