Categories

Featured templates

PrestaShop 1.4.x. Category sub-levels number

Rating: 1.0/5. From 1 vote.
Please wait...

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

Prestashop Premium Themes
This entry was posted in PrestaShop Tutorials and tagged archived_tutorial, category, drop-down, menu, Prestashop. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket