View Single Post
  #1  
Old 07-21-2006, 06:22 AM
 
mikalou mikalou is offline
 

Advanced Member
  
Join Date: Jun 2005
Posts: 71
 

Default Enlarge product image popup

This is for those who prefer to have a popup window to display an enlarged product image instead of the image thats displayed at the bottom of the product page.

All code is placed in: /skin1/customer/main/product.tpl

Step 1: Add this code above the code in step 2:
Code:
{php} global $sql_tbl; // Get the product id from the smarty var $productid=$this->get_template_vars('productId'); // Get the rows from the extra_field_values table for this product id if($productid) { $image_paths = func_query( "SELECT imageid, productid, image_path as path_value FROM $sql_tbl[images] WHERE productid = $productid"); } $this->assign("image_paths",$image_paths); {/php}

Step 2: Add the following code immediately after this code: {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"}:

Code:
{if $image_paths[0].path_value ne ""} [img]{$ImagesDir}/enlarge_img.gif[/img] Enlarge Image {/if}

ALERT: You'll probably need to adjust the number values for: substr:28:30, in above code to match the length of your particular url.

Step 3 (optional): Create an image and name it "enlarge_img.gif" and place in /skin1/images sub directory. If you dont need or want an image then remove: [img]{$ImagesDir}/enlarge_img.gif[/img] from the code in step 2.
__________________
X-Cart Gold 4.2.2 - 3.1.19
Reply With Quote