Hiding Woocommerce “Uncategorized” Product Category in Jet Smart Filter in Wordpress

Robson Martin
Free
Hiding Woocommerce “Uncategorized” Product Category in Jet Smart Filter in Wordpress
Advanced Customizations
Descripción :

To customize your filter so it can remove the "Uncategorized" category in the filter you need to have custom codes that will do the job, Please see this image with the "Uncategorized" category  before it gets removed   https://prnt.sc/ImaNyhNKDIYU

And this next image is after the "Uncategorized: category gets removed https://prnt.sc/mm6J0sUEI3Am

Below are the jQuery codes that do the job but there is a thing to note when adding this code to your site, Make sure you change the label to your corresponding label.

All the best.

 

Solution :

document.addEventListener('DOMContentLoaded', function() {

var campoSelect = document.querySelector('.jet-select__control.depth-0[aria-label="Car Make"]');

if (campoSelect) {

for (var i = 0; i < campoSelect.options.length; i++) {
if (campoSelect.options[i].value === '18') {
campoSelect.options[i].style.display = 'none';
}
}
}
});

Did you want to see this content ?
Scroll to Top