
Originally Posted by
DivaVocals
HISTORICALLY IH4 has never worked with the Product Image Zoom module.. Anyone who DOES have it working together has not shared the code required that makes this integration possible, and I have NEVER had the skillset to tackle this change..
Maybe some nice volunteer (hint hint

) will at last share this most often asked about integration... I am GUESSING that this would require some kind of admin option to turn off if one isn't using the Product Image Zoom module..
Untested, but seems like may work? (Might have some offset parantheses, ie missing one or have an extra):
file changed is: includes/templates/YOUR_TEMPLATE/templates/tpl_modules_main_product_image.php and is/was based off of the file available in ZC 1.5.3, may be different. If dimensions have been altered because of the below, then the left side of this statement:
list($src, $alt, $width, $height, $parameters) = $newimg;
Could be modified as necessary to omit the undesired property, for example to prevent the $width from being reassigned:
list($src, $alt, , $height, $parameters) = $newimg;
Code:
<?php
/**
* Module Template
*
* @package templateSystem
* @copyright Copyright 2003-2011 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: tpl_modules_main_product_image.php 18698 2011-05-04 14:50:06Z wilt $
*/
?>
<?php require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_MAIN_PRODUCT_IMAGE));
/* Begin add 1 of 2 by mc12345678 to support product image zoom */
if ($products_image != '') {
if (function_exists('handle_image')) {
$newimg = handle_image($products_image_large, addslashes($products_name), LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT, '');
list($src, $alt, $width, $height, $parameters) = $newimg;
$products_image_large_test = zen_output_string($src);
if (file_exists($products_image_large_test)) {
$products_image_large = $products_image_large_test;
}
}
}
/* End add 1 of 2 by mc12345678 to support product image zoom 14-10-31*/
?>
<div id="productMainImage" class="centeredContent back">
<script language="javascript" type="text/javascript"><!--
document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '\\\')">' . zen_image(addslashes($products_image_medium), addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT,/* Begin add 2 of 2 by mc12345678 14-10-31*/ (file_exists($template->get_template_dir('loader_product_image_zoom.php',DIR_WS_TEMPLATE, 'auto_loaders','auto_loaders'). '/loader_product_image_zoom.php') ? 'data-zoom-image="' . $products_image_large . '"' : ''))) /* End add 2 of 2 by mc12345678 14-10-31*/ . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>'; ?>');
//--></script>
<noscript>
<?php
echo '<a href="' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '" target="_blank">' . zen_image($products_image_medium, $products_name, MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>';
?>
</noscript>
</div>
The second edit should account for the presence of the product image zoom code by verifying the presence of the auto_loader file in the template. If it doesn't exist, then the javascript shouldn't end up being loaded, and therefore, the zoom option/feature wouldn't work. Of course it is always possible that a javascript file could be removed as an alternative, but if the autoloader is still in place, I believe it would throw an error that it couldn't find the file(s). So seems like the best way to determine the presence of the product image zoom option. Now, if the request is/was to do the hover aspect like with other images on the page without the use of product image zoom, then that's a different story... :)
I might get around to testing the above, but have some other things to work on.