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

Category based images in product.tpl

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 05-30-2008, 04:44 AM
 
John Livesey John Livesey is offline
 

Advanced Member
  
Join Date: May 2008
Posts: 33
 

Default Category based images in product.tpl

Hi all,

I was wondering if its possible to place static images on a page depending on which category the product falls under?

For example on the following page the images (two man install, free shipping, 14 day install) are correct.

http://www.cortneyco.com/shop/product.php?productid=11&cat=1&page=1

But on the page below the images are incorrect because it's using the generic product.tpl template.

http://www.cortneyco.com/shop/product.php?productid=17&cat=4&page=1

Is there anyway (programatically) that I could use a CSS class, product ID or custom field to pull in images relevant to each category?

I know I could possibly use separate product.tpls but this is a bit cumbersome.

Obviously, if there are any mods out there that do this (commercial or free) then I'm happy to be pointed in the right direction.

Thanks in advance

John
__________________
Version: 4.1.9
Reply With Quote
  #2  
Old 05-30-2008, 04:48 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Category based images in product.tpl

The best way to display product-specific graphics/text/etc is to either use Extra Fields or build them in to the product description. For graphics, I usually just use extra fields and put the image calls into each product.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 05-30-2008, 04:54 AM
 
John Livesey John Livesey is offline
 

Advanced Member
  
Join Date: May 2008
Posts: 33
 

Default Re: Category based images in product.tpl

Hi Padraic

Can you be a little bit more specific please? I'm still quite new to X-Cart, so if you could give me a quick example I'd be very greatful!

Do I just set up an extra field called "14 Day Install"? How do I then associate that in the product and reference it to call an image?

Thanks in advance
John
__________________
Version: 4.1.9
Reply With Quote
  #4  
Old 05-30-2008, 06:24 AM
 
John Livesey John Livesey is offline
 

Advanced Member
  
Join Date: May 2008
Posts: 33
 

Default Re: Category based images in product.tpl

I've actually worked out how to do this myself now, but thanks very much for the pointer.

The more I use this product, the more wonderful I realise it is!

Thanks
John
__________________
Version: 4.1.9
Reply With Quote
  #5  
Old 11-19-2009, 01:04 PM
  mmcelroy's Avatar 
mmcelroy mmcelroy is offline
 

Advanced Member
  
Join Date: Feb 2008
Location: Seattle, WA
Posts: 58
 

Default Re: Category based images in product.tpl

Hi John,

I am trying to work this out myself. I am just trying to add a free shipping message based on if the product's category is a "free shipping" category...

Would you mind sharing what you've learned?

Thanks!
__________________
X-Cart Gold v4.4.2
CDSEO Pro, Checkout One
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 08:39 AM.

   

 
X-Cart forums © 2001-2020