Jump to content

Hide Category in Category Block


Recommended Posts

Hello all.

 

I am having some trouble with my prestashop site, I don't know how to hide selected categories in the category block module, I need the category to remain active but not show on the category block, they are named the same as other categories there but they serve a different purpose. I am using Prestashop 1.6.0.9.

 

Banners%20-%20Displayz%20-%20Mozilla%20F

Link to comment
Share on other sites

You can try skipping them in the foreach loop. 
Theme folder, blockcategories.tpl

{foreach from=$blockCategTree.children item=child name=blockCategTree}

inside this, try with 

{if $child.id_category|in_array:[1,2,3]}{continue}{/if}

I am not sure whether it's id_category or just id. Try both :) Of course, use those categories' IDs instead of 1,2,3

Link to comment
Share on other sites

Hi Nemo1

 

Thank you for your response, I tried both ways and neither worked, I am set to force compilation and I also cleared my cache.

 

Here is what the code in my blockcategories.tpl looks like. I'm not sure if I've missed anything.

 

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}
                {if $child.id_category|in_array:[23,24,25]}{continue}{/if}    
            {/foreach}

Link to comment
Share on other sites

×
×
  • Create New...