View Single Post
  #5  
Old 05-09-2005, 08:00 AM
 
ianwebster ianwebster is offline
 

Member
  
Join Date: Mar 2005
Posts: 14
 

Default

This is quite easy to do actually.

Take a look at www.lastangelsonearth.co.uk/heavenly/product.php?productid=1019

In my case I am replacing the main image when you select a colour from the dropdown. Basically the skin1/modules/Product_Options/check_options.tpl file has everything you need (only there is a minor flaw in the code -- probably cos they want to charge you to fix it!!)

I changed this:

Code:
var image_dir = "{if $full_url}{$http_location}{else}{$xcart_web_dir}{/if}/image.php?productid={$productid}&variantid=";



to this:

Code:
var image_dir = "{if $full_url}{$http_location}{else}{$xcart_web_dir}{/if}/image.php?productid={$product.productid}&variantid=";


Then in product.tpl you need your "typeface" image to have an id of "product_thumbnail" - in my case (because I am changing the main image) I used this

Code:
{if $images ne ""} {if $images[0].avail eq "Y"} {if $images[0].tmbn_url}[img]{$images[0].tmbn_url}[/img]{else} [img]{$xcart_web_dir}/product_image.php?imageid={$images[0].imageid}[/img]{/if} {/if} {else} {include file="product_thumbnail.tpl" productid=$product.productid image_x=$product.image_x image_y=$product.image_y product=$product.product tmbn_url=$product.tmbn_url id="product_thumbnail"} {/if}



but you could have a separate image which has an id of "product_thumbnail" with its own size properties etc

Then all you need to do is to add some additional entries to your "xcart_thumbnails" table for each productid/variantid variation - each typeface would have the "image_path" and "variantid" field set accordingly (I have used phpMyAdmin to do this so far as i have not got around to making proper changes to my administration yet)

et voila !!

only downside from your viewpoint is that you need to add image entries to the database for each product/variant combination (not just a single image for each variant typeface) but works nonetheless
__________________
4.0.12
Linux
Reply With Quote