Jump to content
qfabio83

Hide category without disable it

Recommended Posts

Hello guys,

I need to remove a category (with id=17) from blockcategories.

I cannot disable it because I need to open the category with the link.

 

I use the default theme.

 

Thanks in advance for your help.

 

Best regards,

Fabio

post-662222-0-80407200-1376042248_thumb.png

Share this post


Link to post
Share on other sites

you can create simple if condition

 

{if category id != 17}

CODE

{/if}

Share this post


Link to post
Share on other sites

Thanks Veika,

I'have already tried a similar solution but it doesn't work.

 

Please, could you explain me where I must insert the condition?

In which file I mean.

 

Many thanks for your precious support

Share this post


Link to post
Share on other sites

category-tree-branch.tpl

 

Find:

 

<li {if isset($last) && $last == 'true'}class="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>
 {foreach from=$node.children item=child name=categoryTreeBranch}
  {if isset($smarty.foreach.categoryTreeBranch) && $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>

 

Replace on:

 

{if category id != 17}
<li {if isset($last) && $last == 'true'}class="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>
 {foreach from=$node.children item=child name=categoryTreeBranch}
  {if isset($smarty.foreach.categoryTreeBranch) && $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>
{/if}

 

P.S.: Here {if category id != 17} its just for example, this code dont work, u must use some thing like $category->id or $category.id, no time for check...

Edited by Kerm (see edit history)

Share this post


Link to post
Share on other sites

Hello Kerm,

thanks for your answer!

 

I have two category-tree-branch.tpl:

 

prestashop\themes\default

prestashop\themes\default\modules\blockcategories

 

Do I have to modify both files?

 

:)

 

Thanks

Share this post


Link to post
Share on other sites

hello

 

in this case you have to edit only one file: prestashop\themes\default\modules\blockcategories

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More