Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Add links on product page depending on category

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 07-14-2011, 09:15 AM
 
mme mme is offline
 

Newbie
  
Join Date: Jun 2011
Posts: 2
 

Default Add links on product page depending on category

Hi all,
depending on what category a product is in I would like to add a link to a static page in the product description.

For example on a product page of a tent, which is in the category 'tents', I would like to add a link to a static page called 'learn more about how to choose the right tent'.
For a backpack in the category 'backpacks' I would like a link to 'sizing backpacks' to appear.

I can add these manually, as you can see on this page (the part with the questionmark): http://store.mountainmagic.com/Black-Diamond-Vista-SKU1511.html

But I don't want to add this for every product in the store manually.

I guess I would have to create various language files with the different versions for different categories and insert an if statement on the product.tpl? Something like this: {if $cat eq "8"} show language file x{/if} {if $cat eq "9"} show language file y{/if}

Any help would be appreciated.
__________________
x-cart 4.3.1
Reply With Quote
  #2  
Old 07-15-2011, 02:59 AM
  chamberinternet's Avatar 
chamberinternet chamberinternet is offline
 

X-Wizard
  
Join Date: Sep 2005
Location: Lancashire, UK
Posts: 1,470
 

Default Re: Add links on product page depending on category

I guess this is possible.

You can add come smarty code within the product detail page template with something like this (not tested):

{if $product.categoryid eq xxx}
<a href="http://store.mountainmagic.com/tent-information.html">How to choose a tent</a>
{/if}

xxx is the id of the category which you can find from within the admin area of the store.

Hope this helps...

Regards

Shafiq :sK
__________________
Developing in 4.7.x now (Dipping into v5 - Slowly!)
Have used 4.1.x, 4.2.x, 4.4.x, 4.5.x, 4.6.x & 4.7.x
Multiple Instances of X-Cart
MySQL 5.6.37
CentOS 7.4


Chamber Internet
- Lancashire, United Kingdom
http://www.chamberelancs.co.uk
Reply With Quote
  #3  
Old 07-15-2011, 03:49 PM
 
mme mme is offline
 

Newbie
  
Join Date: Jun 2011
Posts: 2
 

Default Re: Add links on product page depending on category

Thanks Shafiq, I will try that after the weekend.
__________________
x-cart 4.3.1
Reply With Quote
  #4  
Old 02-13-2012, 01:38 AM
 
chris.ath chris.ath is offline
 

Member
  
Join Date: Aug 2007
Posts: 27
 

Default Re: Add links on product page depending on category

Quote:
Originally Posted by chamberinternet
{if $product.categoryid eq xxx}
<a href="http://store.mountainmagic.com/tent-information.html">How to choose a tent</a>
{/if}

Thanks a lot Shafiq
__________________
Chris
X-Cart 4.4.2
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 11:43 PM.

   

 
X-Cart forums © 2001-2020