This topic has 5 replies, 2 voices, and was last updated 8 years, 10 months ago ago by Eva Kemp
Hello,
I currently work on website with many sub-categories (third level) in woocommerce.
For example, when I load the “bois” category page, all the categories and sub-categories of “bois” are display.
How could I hide the third level sub-categories ? (for example fagott and fagottino in bois > bassons)
Thank you !
Hello,
You can close the first category by editing wp-content/themes/royal/js/etheme.js file. Find and comment out line 1652
$this.find('>li').first().find('.open-this').html(minusIcon).parent().addClass('opened').find('ul.children').show();
Thank you,
Regards,
Eva Kemp.
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
I comment ou all those lines :
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();
}
It only show first level category, is there a way to show the second level category and not the third ?
Thank you !
Hello,
Unfortunately there is no such possibility. Sorry.
Regards,
Eva Kemp.
You must be logged in to reply to this topic.Log in/Sign up