Ever wanted to replace the thumbnail on the product page with the first image from your detailed images and then have your detailed images section start with the second detailed image?
Well here is how to do it
This code is for the 4.0 branch (the version for 3.4 and 3.5 is very similar)
You need to modify two files:
customer/product.tpl
modules/detailed_product_images/product_images.tpl
You will also need to make a new file:
modules/detailed_product_images/product_images_one.tpl
In product.tpl
find this:
Code:
<TD valign="top" align="left" rowspan="2" width="100">
{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"}
</TD>
replace with this:
Code:
{***----ORIGINAL THUMBNAIL----
<TD valign="top" align="left" rowspan="2" width="100">
{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"}
</TD>
----ORIGINAL THUMBNAIL----***}
{***--FIRST DETAILED IMAGE--***}
<td valign="top" align="left" rowspan="2" width="100">
{if $active_modules.Detailed_Product_Images ne ""}
{include file="modules/Detailed_Product_Images/product_images_one.tpl" }
{/if}
</td>
{***--FIRST DETAILED IMAGE--***}
Then in product_images.tpl
find this:
Code:
<img src="{$images[image].tmbn_url}">
Replace with this:
Code:
{***----ORIGINAL CODE-------
<img src="{$images[image].tmbn_url}" alt="{$images[image].alt|escape}">
--------ORIGINAL CODE***}
{***--Startwithsecondimage---***}
{if $images[image].tmbn_url ne $images[0].tmbn_url }
<img src="{$images[image].tmbn_url}" alt="{$images[image].alt|escape}">
{/if}
{***--Startwithsecondimage---***}
Make a new file in modules/detailed_product_images called product_images_one.tpl
Put this code in it:
Code:
{* $Id: product_images_one.tpl,v 1.7.2.2 2005/07/29 10:43:25 CCS Exp $ *}
{if $images ne ""}
<div align=left>
{section name=image}
{if $images[image].avail eq "Y"}
{if $images[image].tmbn_url}
<img src="{$images[image].tmbn_url}" alt="{$images[image].alt|escape}">
{else}
<img src="{$xcart_web_dir}/product_image.php?imageid={$images[image].imageid}" alt="{$images[image].alt|escape}">
{/if}
{/if}
{/section}
</div>
{/if}
That's it
