SupaMonkey Posted September 27, 2012 Share Posted September 27, 2012 Hey Guys, I have tmcategories.tpl which controls my headerlinks (horizontal menu that breaks down into the various categories). It worked fine in 1.4.9 but now I have upgraded to 1.5.0.17 and it shows the first tier and second tier, but not further! eg: Diving Wear ->Wetsuits ==>Mens ==>Ladies Diving Wear and Wetsuits shows, but Mens/Ladies dont show. If I click on 'Wetsuits' though, they show as blocks; theyre just not getting rendered by the 'superfish' menu for some reason! My logic tells me its not the code because it was working fine before the upgrade - so what cracks? This is the tmheaderlinks category-tree-branch.tpl file content: <li class="{if $node.children|@count > 0}sub{/if}{if isset($last) && $last == 'true'} last{/if}"> <a href="{$node.link}" {if isset($currentCategoryId) && ($node.id == $currentCategoryId)}class="selected"{/if}>{$node.name|escape:html:'UTF-8'}</a> {if $node.children|@count > 0} <ul class="subcat1"> {foreach from=$node.children item=child name='child'} <li {if $smarty.foreach.child.iteration <= 4} class="noborder"{/if}> <a href="{$child.link|escape:html:'UTF-8'}">{$child.name|escape:html:'UTF-8'}</a> {if $child.children|@count > 0} <ul class="subcat2"> {foreach from=$child.children item=child2} <li><a href="{$child2.link|escape:html:'UTF-8'}">{$child2.name|escape:html:'UTF-8'}</a></li> {/foreach} </ul> {/if} </li> {/foreach} </ul> {/if} </li> I also tried taking the 'default' category-branch-tree.tpl file but it did the same thing! (see below, its slightly moded for CSS purposes): <li class="{if $node.children|@count > 0}sub{/if}{if isset($last) && $last == 'true'} last{/if}{if $smarty.foreach.categoryTreeBranch.iteration <= 4 && $depth>1} noborder{/if}"> <a href="{$node.link|escape:'htmlall':'UTF-8'}" {if isset($currentCategoryId) && $node.id == $currentCategoryId}class="selected"{/if} title="{$node.desc|escape:'htmlall':'UTF-8'}">{$node.name|escape:'htmlall':'UTF-8'}</a> {if $node.children|@count > 0} <ul class="subcat{$depth}"> {foreach from=$node.children item=child name=categoryTreeBranch} {if $smarty.foreach.categoryTreeBranch.last} {include file="$branche_tpl_path" node=$child depth=$depth+1 last='true'} {else} {include file="$branche_tpl_path" node=$child depth=$depth+1 last='false'} {/if} {/foreach} </ul> {/if} </li> With the first set of code, I printed out the $node.children|@count value by subcat2 and it reckons its '0' (which is obviously why then its not printing Men/Ladies); but why is it 0 if these child categories are in the database and are displayed as such when clicking Wetsuits, its just not shown in the menu now in Prestashop 1.5 all of a sudden?!? Thanks in advance! Link to comment Share on other sites More sharing options...
TheSnake Posted October 7, 2012 Share Posted October 7, 2012 Hi, I have the same problem, but are not showing all the subcategories. Only the parent category is displayed, and the value of $node.children|@count in category-tree-branch.tpl is always zero. I have upgraded from 1.4.5 to 1.5.0.17 and then to 1.5.1 The problem is on Prestashop 1.5. How I can solve the problem? Link to comment Share on other sites More sharing options...
TheSnake Posted October 7, 2012 Share Posted October 7, 2012 I think the problem is in the management of max depth parameter. This is a strange behavior. If I put max Depth = 2 in the blockcategories module configuration, I don't see anything in FO (categories block is empty). If I put max Depth = 3, I see only parent categories. If I put max Depth = 4, I see parent categories and first level subcategories. and so on. With max Depth = 2, I expect to see the parent category and the first level subcategories. With max Depth = 3, I expect to see the parent category and the first and second level subcategories. and so on. I hope that this can help someones. Link to comment Share on other sites More sharing options...
Recommended Posts