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 pleaseIf 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.
Quote from neoDIRECT on July 24, 2020, 11:30Hello,
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
- If there is no options in filter - it should hide also Title of the filter (in above example: Cena - price filter )
- If there is only one option of filter to choose - it also should be hidden (in above example: Rozmiary - sizes; Podkategorie produktu - prod. categories)
- 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,
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
- If there is no options in filter - it should hide also Title of the filter (in above example: Cena - price filter )
- If there is only one option of filter to choose - it also should be hidden (in above example: Rozmiary - sizes; Podkategorie produktu - prod. categories)
- 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
Quote from Pablo Borysenco on July 24, 2020, 13:09Hello 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!
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!
Quote from neoDIRECT on July 24, 2020, 14:25OK. 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.
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.
Quote from neoDIRECT on July 24, 2020, 14:36About 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
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
Quote from neoDIRECT on July 24, 2020, 15:16And 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();
}});
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();
}
});
Quote from Pablo Borysenco on July 27, 2020, 10:33Hello
Thank you for cooperation!
We will not implement these solutions.
Hello
Thank you for cooperation!
We will not implement these solutions.