Category Navigation Menu - Smarty blockcategories.tpl and category-tree-branch.tpl


Prestashop Category Navigation show / hide the menu items

Solution: Open in Prestashop in /themes/modules/blockcategories the Smarty Template blockcategories.tpl and insert in blockcategories.tpl following Javascript (JQuery) Code:

<script>
$(document).ready(function() {

var tg_cats = window.location.pathname.substring(1);

if(tg_cats == "1005-kategoriename-profistart"){
		$( ".grower" ).removeClass( "CLOSE" );
		$( ".grower" ).addClass( "OPEN" );
		$( ".tg_geoeffnet" ).show();
}else{
		$( ".grower" ).removeClass( "OPEN" );
		$( ".grower" ).addClass( "CLOSE" );
		$( ".tg_geoeffnet" ).hide();
}
});
</script>

Step: Open in Prestashop in /themes/modules/blockcategories the Smarty Template category-tree-branch.tpl and complement in Line 33 the ul-Tag with following Class.

<ul class="tg_geoeffnet">

Description: The javascript code reads the current URL of your web page and the category name is matched using JQuery. If the category name is true, JQuery automatically opens the hidden menu items in the navigation.

MORE SUPPORT