Apologies if this is wrong location but seems to be multi mod question.

zc 1.5.5a, Responsive Sheffield Blue 2.0 (uses Colorbox, earlier version I think), IH4 (last update from plugins, not from github), attrib_image_module (last updated 2008)

I want to substitute main product image on product info page with attribute image if attribute is clicked.

I fiddled with with on Stock by Attributes but am advised Colorbox is not supported vis the attribute image swap. I tested and fiddled to no avail - won't play nice with my template at all.

The perhaps outdated attrib_ image_module does work for me - plays well with the template as far as I can determine.

On my product info page if I click on the main product image I get the large version, handled by IH4, in a Colorbox. If I click on one of the attributes the main product image is replaced by a similarly sized attribute img. Not sure if IH4 did that or not. But if I click on the now substituted main image, I get a pop up window instead of Colorbox.

The image sizes up appropriately - its just that I'd prefer it to open in the cleaner presentation of Colorbox.

Attached is screen shot of test product page. (the large popup doesn't show in screen grab as is sep window).

Name:  screenshot-localhost 2016-06-02 09-21-38.jpg
Views: 120
Size:  31.1 KB

The attrib_img_mod has a file in the root. I tried cutting and pasting assorted bits from Colorbox into this but I really haven't got a clue what I'm doing.

Code:
<?php
require('includes/application_top.php');

$products_options_values_id = $_REQUEST['products_options_values_id'];
$alt = $_REQUEST['alt'];	
$width = $_REQUEST['width'];	
$height = $_REQUEST['height'];	
$products_id = $_REQUEST['products_id'];	


$sql = "select    pa.attributes_image 
from      " . TABLE_PRODUCTS_ATTRIBUTES . " pa 
where     pa.products_id = '" . (int)$products_id . "'
and       pa.options_values_id = '" . (int)$products_options_values_id ."'";

$account_query = $db->bindVars($sql, ':customersID', $_SESSION['customer_id'], 'integer');
$products_color_image = $db->Execute($sql);

$attributes_image = $products_color_image->fields['attributes_image'];
if($attributes_image!=''){
$image = zen_image('images/'.$attributes_image, $alt, $width, $height);
?>
<?php echo '<a href="javascript:popupWindow(\'' . zen_href_link(FILENAME_POPUP_IMAGE_ADDITIONAL, 'products_image_large_additional=' . 'images/'.$attributes_image) . '\')">' . $image . '<br /><span class="imgLink">' . zen_image('images/bigger_picture.jpg', 'larger image', '140', '44') . '</span></a>'; ?>
<?php }?>
Has anyone dealt with this and/or can anyone help me tidy this up?