Jump to content

Hide Closed Category Tree in blockcategories Prestashop 1.5


Recommended Posts

Hi guys,

 

Need help! How can I removed the closed category tree and its subcategories as well? For example:-

 

Parent Category A

- Sub category A1

- Sub category A2

- Sub category A3

- Sub category A4

 

Parent Category B

- Sub category B1

- Sub category B2 <---eg. if this category is selected, it will automatically hide Parent Category A, Parent Category B along with their subcategories as well

- Sub category B3

 

Parent Category C

- Sub category C1

- Sub category C2

- Sub category C3

- Sub category C4

- Sub category C5

 

 

How can i do that?

Right now my category-tree-branch.tpl looks like this

 

<li class="menu-{$node.id} {if $last == 'true'}last{/if}">

<a href="{$node.link|escape:html:'UTF-8'}" {if $node.id == $currentCategoryId}class="selected"{/if} title="{$node.desc|escape:html:'UTF-8'}">{$node.name|escape:html:'UTF-8'}</a>

{if $node.children|@count > 0}

<ul>

{foreach from=$node.children item=child name=categoryTreeBranch}

{if $smarty.foreach.categoryTreeBranch.last}

{include file=$branche_tpl_path node=$child last='true'}

{else}

{include file=$branche_tpl_path node=$child last='false'}

{/if}

{/foreach}

</ul>

{/if}

</li>

Link to comment
Share on other sites

Can you provide a little more information about your issue. Firstly, why do you want certain categories/subcategories to disappear (presumably from the categories block), can you put this in context? In your example above, it seems you want B2 to disappear with the rest of B once selected - and what's supposed to happen with Category C?

Link to comment
Share on other sites

The page is http://www.ecopeas.com.au/3-baby. I'm thinking of hiding it because as all the categories are expanded it will push the footer down and show white space below the banner. So for example in the baby category page, it will only show the category and subcategories of baby. Boy, girls and gifts and their subcategories will be hidden. Thanks in advance!

Link to comment
Share on other sites

I wouldn't recommend removing the other categories altogether, otherwise you lose the ability to navigate to the other categories without constantly jumping between the categories block and the top menu.

 

Actually, when you select a category from the top menu, the categories block behaves how I believe it should work - selected category expanded with subcategories, non-selected categories just displaying the top level. That doesn't appear to generate any white space. So ideally you want to replicate that top menu logic when selecting the categories from the categories block.

 

I don't have the technical knowledge to advise on that I'm afraid, hope someone else can help.

 

Incidentally, your strapline says 'Organic children (children's?) clothing, as nature intended' - I don't think nature intended us to have any clothing at all! :)

 

Good luck!

Link to comment
Share on other sites

  • 4 months later...
×
×
  • Create New...