• Resolved ardalino

    (@ardalino)


    Hi!
    I have been using Husky Products Filter for some time now and I’m loving it. I recently discovered a use case I’m not sure how implement. I want two filters in my store page. I have a horizontal filter at the top for filtering ‘Size’, ‘Color’, ‘Brand’ and ‘Price’. I also have a vertical filter for filtering ‘Product Categories’, this is placed in my woocommerce sidebar using shortcode.

    The filtering itself works fine, but the issue arises when no products were found matching my filter selections. In this scenario, I am no longer able to see neither the currently active filters above the product archive nor the ‘Reset filters’ button next to the active filters.

    Is there any way I can make this setup work?

    Thanks! ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support mediawebster

    (@mediawebster)

    Hello

    You can override the “nothing found” template – https://share.pluginus.net/image/i20231122135841.png

    Thread Starter ardalino

    (@ardalino)

    Thanks for the fast response! Is this only available in the pro version? ??

    • This reply was modified 1 year ago by ardalino.
    Plugin Support mediawebster

    (@mediawebster)

    Hello

    oh! sorry, this is only available in the paid version

    Let’s try a solution with custom code.

    Try to add in functions.php:

    add_filter('woocommerce_locate_template', function($template, $template_name, $template_path) {
                if ($template_name == 'loop/no-products-found.php') {
    
                        WOOF_REQUEST::set('override_no_products', 1);
                        $template =  do_shortcode('[woof_search_options]<p class="woocommerce-info">No products were found matching your selection.</p>');
                    
                }
                return $template;
    }, 99, 3);	

    This is a code example, so you should test it before implementing it on a live site.

    Thread Starter ardalino

    (@ardalino)

    Thank you! That worked great for removing the ‘Nothing found’ template ?? However, I’m still having the issue of not seeing the ‘Clear filters’ button when there are no results.

    This is what I see when there are products matching the filters:
    https://i.imgur.com/AtiOt40.png

    When there are no results matching the filters, I don’t see the active filters nor the button to clear filters (Called ‘Rensa alla’ in this case)

    With the custom solution to remove the template:
    https://imgur.com/OD51yEx

    Without the custom solution:
    https://imgur.com/MMoYtLK

    Is there a way to make sure I can still see the active filters and the clear button even when there are no matches? ??

    Thank you so much for the help. I really appreciate it

    Plugin Support mediawebster

    (@mediawebster)

    Hello

    Ok! Try this code:

    add_filter('woocommerce_locate_template', function($template, $template_name, $template_path) {
                if ($template_name == 'loop/no-products-found.php') {
    
                        WOOF_REQUEST::set('override_no_products', 1);
                        $template =  do_shortcode('[woof][woof_search_options]<p class="woocommerce-info">No products were found matching your selection.</p>');
                    
                }
                return $template;
    }, 99, 3);
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Two filters on the same page’ is closed to new replies.