X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Category based images in product.tpl (https://forum.x-cart.com/showthread.php?t=40149)

John Livesey 05-30-2008 04:44 AM

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

balinor 05-30-2008 04:48 AM

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.

John Livesey 05-30-2008 04:54 AM

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

John Livesey 05-30-2008 06:24 AM

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

mmcelroy 11-19-2009 01:04 PM

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!


All times are GMT -8. The time now is 10:27 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.