Jump to content

Category tree branch TPL (block category module) only 2nd and 3th level


Recommended Posts

Hello. I'm trying to get only subcategories of selected category. I have this code in category-tree-branch.tpl


{foreach $node.id as $value}

{if $value == $currentCategoryId}

<li>
    <a id="cat-{$node.id}" href="{$node.link}" {if isset($currentCategoryId) && ($node.id == $currentCategoryId)}class="selected"{/if} title="{$node.desc|escape:html:'UTF-8'}">{$node.name|escape:html:'UTF-8'} <span class="numbers-prod-count">({$node.products})</span></a>

        {if $node.children|@count > 0}
            <ul>
            {foreach from=$node.children item=child name=categoryTreeBranch}
            {include file=$branche_tpl_path_sub node=$child last='false'}
            {/foreach}
            </ul>
        {/if}
    
</li>
{break}
<li>
    <a id="cat-{$node.id}" href="{$node.link}" {if isset($currentCategoryId) && ($node.id == $currentCategoryId)}class="selected"{/if} title="{$node.desc|escape:html:'UTF-8'}">{$node.name|escape:html:'UTF-8'} <span class="numbers-prod-count">({$node.products})</span></a>
</li>

{/if}

{/foreach}

I can see right the 3th level subcategory if I click on 2nd level category, but i'm unable to see other categories. See screenshots attached. Thank you.

 

 

post-183518-0-31966900-1447431052_thumb.jpgpost-183518-0-02324200-1447431053_thumb.jpg

 

 

Edited by rob84 (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...