Jump to content

Open first subcategory by clicking on parent category


Recommended Posts

Hello,

 

I'm searching for an option to automatically open the first subcategory in front office, when clicking on the parent category. But I didn't find any option in the module "blockcategories".

 

I need this option, because my parent categories are empty, and so the customer should automatically forwarded to the first subcategory.

 

I think this behavior could useful for many webshops.

 

 

I use Prestashop 1.5.6.2

 

Can someone help?

 

Greetings

Link to comment
Share on other sites

  • 2 weeks later...

Hi, in your module blockcatwgories, you can modify category-tree-branch.tpl :

 

replace

<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>

by

<a href="{if $node.id == 1}link_to_your_category{else}{$node.link|escape:'htmlall':'UTF-8'}{/if}" {if isset($currentCategoryId) && $node.id == $currentCategoryId}class="selected"{/if} title="{$node.desc|escape:'htmlall':'UTF-8'}">{$node.name|escape:'htmlall':'UTF-8'}</a>
Link to comment
Share on other sites

×
×
  • Create New...