View Single Post
  #1  
Old 09-24-2004, 11:30 PM
 
deonya deonya is offline
 

Member
  
Join Date: Oct 2003
Posts: 18
 

Default Seperate Thumbnail Image Uploads

I have see a few people on the forum looking for a way to have a different image view from the thumbnail upload. Well I have something that might help them accomplish this.

In your <xcart_dir>/skin1/custom/main/product.tpl file, find the following part of code:

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>
and replace it with this:
Code:
<TD valign="top" align="left" rowspan="2"> {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} {else} {include file="product_thumbnail.tpl" productid=$product.productid image_x=$config.Appearance.thumbnail_width product=$product.product tmbn_url=$product.tmbn_url id="product_thumbnail"} {/if} </TD>

This mod will make it so that on the product preview page instead of displaying the thumbnail again it will display the detailed image you upload. This will also create a small problem, your detailed image will be displayed on the page twice. To stop that from happening do this.

In your <xcart_dir>/skin1/modules/Detailed_Product_Images/product_images.tpl file replace the following:
Code:
{section name=image loop=$images}
with this
Code:
{section name=image loop=$images start=1}

Witch will make it skip over the first added detailed image and only display images added after the first.

If you decide not to upload a second detailed image the detailed image box will still appear with no content and you fix that by doing this.
In your <xcart_dir>/skin1/modules/Detailed_Product_Images/product_images.tpl file replace the following:
Code:
{if $images ne ""}
with this
Code:
{if $images ne "" and count($images) ne 1}

If done correctly when uploading a new product you can upload the thumbnail, then upload a detailed image to be displayed is the products main view, and you still have the ability to add more detailed images that will appear in the correct place.

I use this mod on my site now check it out the site is not compleat so theres only one product under logo templates.
http://www.pixellab.biz

Hope you all enjoy this as much as I did!

**MODERATOR EDIT - I have updated the code per the fix listed later in this post. Enjoy! - Padraic**
__________________
Deonya Fields
--------------------------
X-Cart Gold 4.0.4
--------------------------
http://www.pixellab.biz
Reply With Quote