.
functions.php .
$product_category_id .
function _new_updated_query( $query ) {
if ( is_product_category() && $query->is_main_query() ) {
$query->set( 'tax_query', array (
array(
'taxonomy' => 'product_cat',
'field' => 'term_id',
'terms' => absint($product_category_id),
)
));
}
}
add_action( 'pre_get_posts', '_new_updated_query' );