View Single Post
  #34  
Old 09-09-2006, 04:12 PM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: Lightbox JS v2.0 implementation

I have been living with this mod now for 2 days and it is a home run. Fantastic.

Thank you, Goran for bringing this to us.

I have been trying to figure out how to improve this -- I want to make it so that clicking on the thumbnail image opens up the thickbox, image #1. I am REAL CLOSE to figuring this out, but I am obviously missing one (essential) concept.

So far, I have done the following:

1. enabled Detailed Product Images options (4.1 admin settings) - and then changed this code in product.tpl:
Code:
{if $active_modules.Detailed_Product_Images ne "" && $config.Detailed_Product_Images.det_image_popup eq 'Y' && $images ne '' && $js_enabled eq 'Y'} {* comment out the include for the stock popup_image.tpl *} {* {include file="modules/Detailed_Product_Images/popup_image.tpl"} *} {* then add the include for thickbox *} {include file="thickbox/thickbox_productpage.tpl" } {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" type="P"} {/if}

2. OK, so far so good... then I copied this code from the no longer in use, modules/Detailed_Product_Images/popup_image.tpl:
Code:
<a href="javascript: void(0);" onclick="javascript: popup_image('D', '{$product.productid}', '{$max_x}', '{$max_y}', '{$product.product|escape:"url"}');">{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" type="P"}</a>

This is the code that displays the thumbnail, and there is js to call the OLD detailed popup image.

3. I pasted this code at the top of thickbox_productpage.tpl (in its own table) -- and then removed:

Code:
<a href="javascript: void(0);" onclick="javascript: popup_image('D', '{$product.productid}', '{$max_x}', '{$max_y}', '{$product.product|escape:"url"}');"> and </a>

SO, now the thumbnail appears, but we need a way to call on thickbox.

I tried simply copying the code from later down in thickbox:

Code:
<a href="{$xcart_web_dir}/image.php?id={$images[image].imageid}&amp;type=D" title="{$images[image].alt|escape}" class="thickbox" rel="[detailed]"> and </a>

and insert it around:
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" type="P"}

But that only called the thickbox, but did not load the desired image.

I AM SO FREAKING CLOSE TO FIGURING THIS OUT... Anyone who actually knows what they are doing want to chime in and set me straight?

Thanks!!!!!!!!!

Jeremy
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote