Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Enlarge product image popup

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #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
  #2  
Old 07-21-2006, 07:28 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

Moving to Custom Mods.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 04:16 AM.

   

 
X-Cart forums © 2001-2020