Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / add an image to a specific product page

add an image to a specific product page

Locked

Views: 792

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
14 Sep 2009, 7:22 PM
#1
gsdcypher avatar

gsdcypher

Totally Zenned

Join Date:
Feb 2007
Posts:
816
Plugin Contributions:
0

add an image to a specific product page

how do you add an image to a specific product page not all of the product pages and not by using the add image function?

for example for a specific product under the add to cart button?

thanks.

14 Sep 2009, 9:14 PM
#2
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: add an image to a specific product page

The easiest way is to put a bit of code that looks something like this into tpl_product_info_display.php:

<?php if ($_GET['products_id']=='7'){echo '<div id="newimage"><img src="Path to Image"></div>';}?>

You need to change where it says 'Path to Image' to be the path to the image. And change the number '7' to the product id of the product you want the image to display on.

You can put it wherever you want the image to appear. If you want it under the add to cart button you will put this line just below:

<!--eof Add to Cart Box-->

You may have to put a rule in the stylesheet to control its display too but I don't know because you haven't given us a URL which is always kind of useful to stop us having to guess!

It might be something like:

#newimage{
float:right;
clear:both;
}
15 Sep 2009, 1:06 AM
#3
gsdcypher avatar

gsdcypher

Totally Zenned

Join Date:
Feb 2007
Posts:
816
Plugin Contributions:
0

Re: add an image to a specific product page

thank you. the code worked like a charm. :bigups: