how to hide the filter when it is only one variant?
Please add:
1.
#file:
js/addons/my_changes/func.js
(function($, _) {
$(document).ready(function() { fn_my_changes_check_filters(); });
$.ceEvent(‘on’, ‘ce.ajaxdone’, function(elms, scripts, params, response_data, response_text) { fn_my_changes_check_filters(); });
}(Tygh.$, Tygh));function fn_my_changes_check_filters(){
if($(‘.ty-product-filters__block’).length==0) return false;
$(‘.ty-product-filters__block’).each(function(){
if($(this).find(‘ul.ty-product-filters li.ty-product-filters__item-more’)){
if($(this).find(‘ul.ty-product-filters li.ty-product-filters__item-more li’).length==1){
$(this).hide();
}else{
var i=0;
$(this).find(‘ul.ty-product-filters li.ty-product-filters__item-more li’).each(function(){
if(!$(this).find(‘label’).hasClass(‘disabled’)){
i++;
}
});
if(i==1) $(this).hide();
}
}else{
$(this).show();
}
});
}
design/themes/[THEME_NAME]/templates/addons/my_changes/hooks/index/scripts.post.tpl
{script src=“js/addons/my_changes/func.js”}
…/admin.php?cc&ctpl