Jump to content

Adding External Link to subcategory


Recommended Posts

There is no option to do that in PrestaShop. How many categories need to be redirected to external links? If there aren't many, you could edit modules/blockcategories/category-tree-branch.tpl and change line 2 from:

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



to:

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



Change 2 to the ID of the Motorola category. You can add {elseif $node.id == 3} after motorola.com to add another external link for category 3 if necessary.

Link to comment
Share on other sites

  • 11 months later...

I would like to put the below mentioned link in the subcategory for earning affiliate commissions. This link when put, will generate an image in the subcategory, which when clicked will lead to the affiliate site.

 

<a href="http://www.greensmoke.com/261.html" target="_blank"><img border="0" src="http://www.greensmoke.com/earn/banners/pink125x125.jpg" width="125" height="125" alt=""></a>

 

Can someone explain how this can be done?

Link to comment
Share on other sites

  • 1 year later...

Hello,

i hope this thread is not dead. I am trying to do this:

<a href="{if $node.id == 6}http://www.facebook....rabbitees}{if $node.id == 7}http://neonrabbitees.tumblr.com}{if $node.id == 8}http://neonrabbit.eu/blog/all-post.html}{else}{$node.link|escape:'htmlall':'UTF-8'}" {/if}

 

but nothing happens. Site: http://neonrabbit.eu/en/ read IDs from prestashop backoffice.

 

Thanks for help;)

 

Edit: Prestashop 1.5.4.

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

  • 1 year later...

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