Answer the question
In order to leave comments, you need to log in
Why does the filter break when deleting a category in the store?
Worth yith-woocommerce-ajax-product-filter Everything works fine
Code I remove the category
add_action( 'pre_get_posts', 'custom_pre_get_posts_query' );
function custom_pre_get_posts_query( $q )
{
if (!$q->is_main_query() || !is_shop()) return;
if ( ! is_admin() )
{
$q->set( 'tax_query', array(array(
'taxonomy' => 'product_cat',
'field' => 'id',
'terms' => array( 192 ),
'operator' => 'NOT IN'
)));
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question