wordpress - Query for filter product by multi attribute and price in Wooecommerce? -
i create query that:
<?php $args = array( 'numberposts' => -1, 'post_type' => 'product', 'meta_query' => array( 'relation' => 'or', array( 'key' => 'pa_color', 'value' => array('red'), 'compare' => 'in', ), array( 'key' => 'pa_for', 'value' => 'men', 'compare' => '=', ), ), ); $post = get_posts($args); echo '<pre>'; print_r($post); echo '</pre>';
when try run code nothing. please me check query , how products attribute , price?. take meta_key in term_taxonomy table. many thanks!