Only display products with meta value
-
Hello,
I would like to only display products that have a certain meta value. I’m not super familiar with filters and how exactly they work. I have tried this but unfortunately without the desired results.add_filter('dgwt/wcas/search_query/args', function($args){ $query = array( 'meta_key' => 'wwpp_product_wholesale_visibility_filter', 'meta_value' => 'wholesale_customer', 'meta_compare' => 'NOT LIKE' ); if(!empty($args['meta_query'])){ $args['meta_query'][] = $query; }else{ $args['meta_query'] = array( 'relation' => 'AND', $query ); } return $args; });
How would I achieve my goal?
Thanks,
Jeff
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Only display products with meta value’ is closed to new replies.