Woo Commerce using WP_Query to get products that match price range, with an additional required product attribute
Your mixing up your meta query and tax query. try this: $params = array( ‘posts_per_page’ => 20, ‘post_type’ => array(‘product’, ‘product_variation’), ‘meta_query’ => array( array( ‘key’ => ‘_price’, ‘value’ => $_POST[‘product_price_min’], ‘compare’ => ‘>=’, ‘type’ => ‘NUMERIC’ ), array( ‘key’ => ‘_price’, ‘value’ => $_POST[‘product_price_max’], ‘compare’ => ‘<=’, ‘type’ => ‘NUMERIC’ ), ), ‘tax_query’ => … Read more