May 29, 2014

Woocommerce products query with specific category and meta key val

Woocommerce products query with specific category and meta key val

$args = array(
'post_type' => 'product',
'ignore_sticky_posts' => 1,
'no_found_rows' => 1,
'posts_per_page' => 3,
'tax_query' => array(
array(
'taxonomy' => 'product_cat',
'field' => 'slug',
'terms' => 'bundles'
)
),
'meta_query' => array(
array(
'key' => '_featured_checkbox',
'value' => array('yes'),
'compare' => 'IN',
)
)
);

Last updated: May 29, 2014