Hello.
Because the full images can increase the site size i changed a little bit your code. Instead of loading full image and make them scaled, i replaced them with their thumbnails.
3 things should be done:
1. replace in "shop.product_details.php", everything after: <</* MORE IMAGES ??? */>> and before: <</* Files? */>>
$more_images = "";
$tproduct_name = $product_name;
$zoom_image = $imageurl;
// Zoom image
$zoom_image1 = $zoom_image;
$ttitle = @$title;
if( !empty($images->images) ) {
$href = $full_image;
$js = " onClick="javascript: document.product_image.src=this.src;
;document.product_image.onclick = function() { Lightbox.show('$href','$product_name','lightbox[]') };"
";
$dbi = new ps_DB();
$tproduct_name = $product_name;
$ttitle = @$title;
$more_images .= "<img class="vm_more_image" src="components/com_virtuemart/shop_image/product/$product_thumb_image" alt="$ttitle" title="$ttitle" rel="lightbox[]"";
$more_images .= $js;
$more_images .= ">";
// Let's have a look whether the product has more images.
$dbi->query( "SELECT * FROM #__{vm}_product_files WHERE file_product_id='$product_id' AND file_is_image='1'" );
$images = $dbi->record;
$i = 2;
foreach( $images as $image ) {
$info = pathinfo( $image->file_name );
$href = $image->file_url;
$fullimg = $db->f("file_name");
$info = pathinfo( $image->file_name );
$thumb = "components/com_virtuemart/shop_image/product/resized/". basename($href,".".$info["extension"])."_".PSHOP_IMG_WIDTH."x".PSHOP_IMG_HEIGHT.".".$info["extension"];
$thumburl = str_replace( $mosConfig_absolute_path, $mosConfig_live_site, $thumb );
$title = $image->file_title." ".$i++;
$more_images .= "<img class="vm_more_image" src="$thumb" alt="$title" title="$title" rel="lightbox[]"";
$more_images .= " onClick="javascript: document.product_image.src=this.src;
;document.product_image.onclick = function() { Lightbox.show('$href','$title','lightbox[]') };"
";
//$more_images .= ";"";
$more_images .= "><a href="$href" id="product_image_link" alt="$title" title="$title" rel="lightbox[]"></a>";
}
}
$mainframe->addCustomHeadTag('<script language="JavaScript" type="text/javascript" src="'.$mosConfig_live_site .'/components/com_virtuemart/js/mootools/mootools.v1.00.js"></script>');
$mainframe->addCustomHeadTag('<script language="JavaScript" type="text/javascript" src="'.$mosConfig_live_site .'/components/com_virtuemart/js/mootools/mooPrompt.js"></script>');
$mainframe->addCustomHeadTag('<script language="JavaScript" type="text/javascript" src="'.$mosConfig_live_site .'/components/com_virtuemart/js/slimbox/js/slimbox.js"></script>');
$mainframe->addCustomHeadTag('<link type="text/css" rel="stylesheet" media="screen, projection" href="'.$mosConfig_live_site .'/components/com_virtuemart/js/mootools/mooPrompt.css" />');
$mainframe->addCustomHeadTag('<link type="text/css" rel="stylesheet" media="screen, projection" href="'.$mosConfig_live_site .'/components/com_virtuemart/js/slimbox/css/slimbox.css" />');
2. in "flypage.php" instead of using {product_image} in your flypage use this code (is different from the code found in this page because is calling the thumbnail image, not the full image size):
<a href="{zoom_image}" name="{product_name}" id="product_image_link" title='{product_name}' alt='{product_name}' rel="lightbox[]"></a><img style="cursor
ointer;" name="product_image" alt='{product_name}' src="components/com_virtuemart/shop_image/product/{product_thumb_image}" width="130" border="0" rel="lightbox[]"/>
3. the flypage doesn't know what is {product_thumb_image} and for that we have to add one more line to "shop.product_details.php". After the line:
$template = str_replace( "{full_image}", $full_image, $template ); // to display the full image on flypage
add this code:
$template = str_replace( "{product_thumb_image}", $product_thumb_image, $template ); // to display the thumb image on flypage
this thing is also present in VM 1.1, where lightbox is in the core of virtuemart. in my opinion the source of the thumbnails should be the real image thumbs, not the full images scaled.
best regards,
razvan