{"id":16109,"date":"2012-04-05T03:20:21","date_gmt":"2012-04-05T07:20:21","guid":{"rendered":"http:\/\/www.templatemonster.com\/help\/?p=16109"},"modified":"2017-02-22T03:33:15","modified_gmt":"2017-02-22T08:33:15","slug":"prestashop-category-sub-levels-number","status":"publish","type":"post","link":"https:\/\/www.templatemonster.com\/help\/prestashop-category-sub-levels-number.html","title":{"rendered":"PrestaShop 1.4.x. Category sub-levels number"},"content":{"rendered":"<p>\r\n<p>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. <\/p>\r\n<p>Open <strong>modules\\tmcategories\\tmcategories.tpl<\/strong> file <\/p>\r\n<p>Replace the existing code:<\/p>\r\n<pre class=\"brush:php\"> \r\n{foreach from=$blockCategTree.children item=child name=blockCategTree}\r\n\t{if $smarty.foreach.blockCategTree.last}\r\n\t  {include file=&quot;$branche_tpl_path&quot; node=$child last='true'}\r\n\t{else}\r\n\t\t{include file=&quot;$branche_tpl_path&quot; node=$child}\r\n\t{\/if}\r\n{\/foreach}\r\n<\/pre>\r\n<p>with the following<\/p>\r\n<pre class=\"brush:php\">\r\n{foreach from=$blockCategTree.children item=child name=blockCategTree}\r\n\t{if $smarty.foreach.blockCategTree.index &lt; 5}\r\n\t\t{if $smarty.foreach.blockCategTree.last}\r\n\t\t\t{include file=&quot;$branche_tpl_path&quot; node=$child last='true'}\r\n\t\t{else}\r\n\t\t\t{include file=&quot;$branche_tpl_path&quot; node=$child}\r\n\t\t{\/if}\r\n\t{\/if}\r\n{\/foreach}\r\n<\/pre>\r\n<p>Where value <strong>5<\/strong> in the condition <strong>{if $smarty.foreach.blockCategTree.index &lt; 5}<\/strong> is the number of submenu levels allowed<\/p>\r\n<p><\/p>\r\n<p><\/p>\r\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to manage number of displayed category levels in PrestaShop categories menu<\/p>\n","protected":false},"author":2,"featured_media":16775,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[732],"tags":[2564,687,920,571,552],"_links":{"self":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/16109"}],"collection":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/comments?post=16109"}],"version-history":[{"count":0,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/16109\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media\/16775"}],"wp:attachment":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media?parent=16109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/categories?post=16109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/tags?post=16109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}