Submitted by esogut on Thu, 2010-01-21 22:16 in Price Tapestry
Hoi David
is it possible to add multiple images to a products like if there are 10 pictures in the feed that its being imported or something like that...
thnx
Sure - you could add additional image fields to your site - this is very easy to do with the latest version, please see the following thread for full details:
http://www.pricetapestry.com/node/3094
In line with the existing image field name (image_url), I would recommend using names like image_url2, image_url3 etc. Then, in the code where a product is displayed you can access the additional images by checking for and then displaying them. For example, to display additional images below the main image on the product page; in html/product.php look for the following block of code beginning at line 6:
Hi,
Sure - you could add additional image fields to your site - this is very easy to do with the latest version, please see the following thread for full details:
http://www.pricetapestry.com/node/3094
In line with the existing image field name (image_url), I would recommend using names like image_url2, image_url3 etc. Then, in the code where a product is displayed you can access the additional images by checking for and then displaying them. For example, to display additional images below the main image on the product page; in html/product.php look for the following block of code beginning at line 6:
<?php if ($mainProduct["image_url"]): ?>
<img width='180' src='<?php print $mainProduct["image_url"]; ?>' alt='<?php print $mainProduct["name"]; ?>' />
<?php endif; ?>
...and simply insert equivalent sections for the additional image fields AFTER that point:
<?php if ($mainProduct["image_url2"]): ?>
<img width='180' src='<?php print $mainProduct["image_url2"]; ?>' alt='<?php print $mainProduct["name"]; ?>' />
<?php endif; ?>
Hope this helps!
Cheers,
David.