Jump to content

Recommended Posts

I would like to add a lightbox function to the default featured products module. I want to be the first thumb to be clickable and give te option to few more pictures from the same product.

 

The default thumb can be called by using:

 



<a class="fancybox-{$product@iteration} product_img_link" rel="group" href="{$link->getImageLink($product.link_rewrite, $product.id_image, 'large_default')}">

  <img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')}" height="{$homeSize.height}" width="{$homeSize.width}" alt="{$product.name|escape:html:'UTF-8'}" />

</a>



 

But a foreach would be neaded to load all the thumbs.

So here is where I'm stuck:

 



{foreach from=$link item=image name=thumbnails}

{assign var=imageIds value="`$product->id`-`$product.id_image`"}

  <a class="fancybox-{$product@iteration}" rel="group" href="{$link->getImageLink($product.link_rewrite, $imageIds, 'large_default')}">
   <img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')}" height="{$homeSize.height}" width="{$homeSize.width}" alt="{$product.name|escape:html:'UTF-8'}" />
  </a>

{/foreach}


 

It does for loop three times in most cases (since most products have 3 pictures). But it always displays the same default image. Im probably overseeing something.

Any help would be appreciated.

Link to comment
Share on other sites

×
×
  • Create New...