Reply 65777 to: WooCommerce – Hide third level categories

Avatar: digitalhoopoe
digitalhoopoe
Participant
May 25, 2015 at 10:18

Thank you for your answer,

But it won’t work for me, here’s what the accordion categories code currently look like when the line is comment out :


// **********************************************************************//
// ! Categories Accordion
// **********************************************************************//

jQuery.fn.etAccordionMenu = function ( options ) {
//var settings = $.extend({
// type: "default"
//}, options );

var $this = jQuery(this);

var plusIcon = '+';
var minusIcon = '–';

var etCats = $('.product-categories');
$this.addClass('with-accordion')
var openerHTML = '<div class="open-this">'+plusIcon+'</div>';

$this.find('li').has('.children, .nav-sublist-dropdown').has('li').addClass('parent-level0').prepend(openerHTML);

if($this.find('.current-cat.parent-level0, .current-cat, .current-cat-parent').length > 0) {
$this.find('.current-cat.parent-level0, .current-cat-parent').find('.open-this').html(minusIcon).parent().addClass('opened').find('ul.children').show();
} else {
//$this.find('>li').first().find('.open-this').html(minusIcon).parent().addClass('opened').find('ul.children').show();
}

$this.find('.open-this').click(function() {
if($(this).parent().hasClass('opened')) {
$(this).html(plusIcon).parent().removeClass('opened').find('> ul, > div.nav-sublist-dropdown').slideUp(200);
}else {
$(this).html(minusIcon).parent().addClass('opened').find('> ul, > div.nav-sublist-dropdown').slideDown(200);
}
});

return this;
}

if(catsAccordion) {
$('.product-categories').etAccordionMenu();
}

Hope you can help me,

Thank you

Please, contact administrator
for this information.
Go To The Whole Conversation In Topic
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.