Hi,
This problem has been fixed permanently on the VM3 version. But here is the work around for the VM2 version that i just found out.
Open this PHP file:
/templates/YOUR_TEMPLATE/html/com_virtuemart/productdetails/default.php
(or flexv2.php depends on the layout you are using for product details page)
- Find this line:
<a id="flexible_enlarge" href="javascript:void(0);">"><?php echo JText::_ ( 'PLG_FLEXIBLE_ENLARGE'); ?></a>
- Replace this line with these:
<?php if (count($this->product->images) > 1 ) { ?>
<a id="flexible_enlarge" href="javascript:void(0);">"><?php echo JText::_ ( 'PLG_FLEXIBLE_ENLARGE'); ?></a>
<?php } else { ?>
<a id="flexible_enlargeSingle" class="fancybox2" href="<?php echo JURI::root().$this->product->images[0]->file_url;?>"><?php echo JText::_ ( 'PLG_FLEXIBLE_ENLARGE'); ?></a>
<?php
$doc->addScriptDeclaration("
jQuery(document).ready(function(){
jQuery('.flexibleZoomContainer').live('click', function (e) {
jQuery('#flexible_enlargeSingle').trigger('click');
});
});");
?>
<?php } ?>
then you will be good to go. The popup will work regardless of the image count.
THIS PATCH HAS BEEN TESTED AND CONFIRMED!
Regards.