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

Hide empty terms and one option filters with titles

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.

Hello,

I've noticed that when there is one product in a category/attribute etc. there are unnecessary filters:

https://moda.neodirect.pl/marka/apollo.html

  1. If there is no options in filter - it should hide also Title of the filter (in above example: Cena - price filter )
  2. If there is only one option of filter to choose - it also should be hidden (in above example: Rozmiary - sizes; Podkategorie produktu - prod. categories)
  3. If all the filters are empty (after pt. 1 and 2 is working) - also the whole filter block should be hidden - like in this example above: there is only one product - what the filter is for? Filter is to narrow the offer.

Regards, Dominik

Hello Dominik

1 - Drop  me    wp-admin access. Or  add  this  JS :

if(!jQuery('.price_slider_wrapper')){
jQuery('.widget_price_filter h4').hide();
}

2/3 - It won't work like that!

 

OK. If this is the only way - I use the jQuery method, but to inspect if the element exist need to add length parameter like this:

if(jQuery('.price_slider_wrapper').length == 0){
jQuery('.widget_price_filter').hide();}

This code works.
Consider to upgrade your code to achieve that in the box ;)

Thanks for help.

About the 2. point: If there is only one option of filter to choose - it also should be hidden (in above example: Rozmiary - sizes; Podkategorie produktu - prod. categories)

What do you think about such a solution:

if(jQuery('.woof_list_checkbox li:nth-child(2) ').length == 0){
jQuery('.woof_container_inner_rozmiary').hide();}

When there is no the second li element in the list > hide the filter box.

Here I have only one option of the size (rozmiary): https://moda.neodirect.pl/marka/apollo.html

And about the 3 questoin: Hiding the filter at all. I used somethink like this:

jQuery( document ).ready(function() {

//count products on the list
var numItems = jQuery('.product').length;
// check is no filter used in the top panel
var numItems2 = jQuery('.woof_products_top_panel ul li').length;
// if less than 10 products on the list and no filter used - hide filter the whole box
if(numItems<10 && numItems2==0){
jQuery('.woof_sid_widget').hide();
}

});

 

Hello

Thank  you  for  cooperation!

We will not implement these solutions.