PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

Tag filtering not working with woof widget

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

With the original shortcode of woocommerce exist the tag and tag operation options like;

[products tag="hoodie" tag_operator="NOT IN"] to filter products with"hoodie" tag to be showed. We tried to keep that option woorking with the shortcode in [woof_products] but is not working. How we can do that?

 

Hello

unfortunately the plugin does not have this feature

But the filter should work with this shortcode [products]

Hello,

Unfortunately currently I'm using the plugin with another plugin to sort the products that nowadays is not working with [products] shortcode but yes with your shortcode [woof_products] I don't no why...

Could I filter with javascript the products with your filter woof_products_query?

I've tried something like this:

apply_filters('woof_products_query', 'filtro_refrigerados');
function filtro_refrigerados() {
$query = new WP_Query( array( 'tag__not_in' => array( 122323 ) ) );
return $query;
}

But it's not working and also tried with custom_pre_get_posts_query like:

function custom_pre_get_posts_query( $q ) {

    $tax_query = (array) $q->get( 'tax_query' );

    $tax_query[] = array(
           'taxonomy' => 'product_tag',
           'field' => 'slug',
           'terms' => array( 'banana' ), // Don't display products with the tag"banana"
           'operator' => 'NOT IN'
    );

    $q->set( 'tax_query', $tax_query );
}
add_action( 'woocommerce_product_query', 'custom_pre_get_posts_query' );

But doesn't works either, could you help me?

Hello

You are using the wrong code!

When you use the filter you don't need to create a new new search query. You should just change the current

You should hire a developer

An  eXAMPLE

apply_filters('woof_products_query', 'filtro_refrigerados');
function filtro_refrigerados($query) {

    $query['tax_query'][] = array(
           'taxonomy' => 'product_tag',
           'field' => 'slug',
           'terms' => array( 'banana' ), // Don't display products with the tag"banana"
           'operator' => 'NOT IN'
    );

return $query;
}