function only_grouped_products( $tax_query ){
$tax_query[] = array(
'taxonomy' => 'product_type',
'field' => 'name',
'terms' => array('grouped'),
);
return $tax_query;
}
here's my code but I want to select grouped products for Imperial Adapters and Metric Adapters categories only
My Answer:
function only_grouped_products( $tax_query ){
$tax_query[] = array(
'taxonomy' => 'product_type',
'field' => 'name',
'terms' => array('grouped'),
);
$tax_query[] = array(
'taxonomy' => 'product_cat',
'field' => 'slug',
'terms' => array('imperial-adapters', 'metric-adapters'),
);
return $tax_query;
}
Rate this post
3 of 5 based on 3231 votesComments