D
D
Denis Petrovsky2016-11-17 17:11:57
WordPress
Denis Petrovsky, 2016-11-17 17:11:57

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'
)));
}
}

The filter stops filtering, you click on the property, it thinks it thinks and throws out the entire directory.
I put another filter plugin dvanced AJAX Product Filters for WooCommerce Everything filters fine ..
Just wondering, why is this?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question