If this tutorial is not what you were looking for, you still have any questions, suggestions or concerns - feel free to let us know. Please help us to serve you better!

Your Name

Your Email

Your Message (required)

captcha

Featured templates

PrestaShop 1.4.x. Category sub-levels number

This tutorial shows how to manage number of displayed category levels in PrestaShop categories menu. Categories menu in PrestaShop is created using tmcategries module. So we need to edit this module to set the number of sub-levels.

Open modules\tmcategories\tmcategories.tpl file

Replace the existing code:

 
{foreach from=$blockCategTree.children item=child name=blockCategTree}
	{if $smarty.foreach.blockCategTree.last}
	  {include file="$branche_tpl_path" node=$child last='true'}
	{else}
		{include file="$branche_tpl_path" node=$child}
	{/if}
{/foreach}

with the following

{foreach from=$blockCategTree.children item=child name=blockCategTree}
	{if $smarty.foreach.blockCategTree.index < 5}
		{if $smarty.foreach.blockCategTree.last}
			{include file="$branche_tpl_path" node=$child last='true'}
		{else}
			{include file="$branche_tpl_path" node=$child}
		{/if}
	{/if}
{/foreach}

Where value 5 in the condition {if $smarty.foreach.blockCategTree.index < 5} is the number of submenu levels allowed

 
Live Chat
We help you to choose the right product.
Start chat