potteryhouse / stock_by_attribute_1.5.4

Stock by Attribute for Zen Cart 1.5.3
GNU General Public License v2.0
2 stars 5 forks source link

attribute switch larger image functionality #40

Closed mc12345678 closed 8 years ago

mc12345678 commented 9 years ago

The below is copied from https://www.zen-cart.com/showthread.php?214797-quot-Stock-by-Attributes-quot-(version-1-5-3)-This-MOD-is-ONLY-for-v1-5-1-whaddda&p=1286954#post1286954 and is related to the image swap feature/functionality...

If nothing else would be something to look into. Brought here for issue tracking/verification. Suggestion would be to try other such "image enlargers" and see if the same issue appears or if it is localized to Zen Magnific and requires some form of additional action to support it.

[QUOTE=simon1066;1286954]Zen Cart v1.54 SBA v1.54 Zen Magnific v1.5

So, I can get the main product image to change according to the attribute selected, but I've hit a brick wall when it comes to clicking on the attribute image to view its larger version.

I'm using a lightbox to display the larger images but for simplicity sake and to make it more relevant to this thread it might be best to use the stock SBA code in tpl_modules_main_product_image.php

<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,'id="SBA_ProductImage"') . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>'; ?>'); //--></script>

I think that the

FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']

has to be replaced with something like

$products_image_large, $products_name, LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT

with the $products_image_large being defined in \modules\main_product_image.php and I probably need to reference the 'attributes_image' field from TABLE_PRODUCTS_ATTRIBUTES

I'm stuck. Has anyone been able to get a larger version of the attribute image?

If it helps, the relevant bit of my lightbox (Zen Magnific) code in tpl_modules_main_product_image.php is

document.write('<?php echo $relBOF . '<a href="' . zen_magnific($products_image_large, addslashes($products_name), LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT) . '" class="' . "nofollow" . '" title="' . addslashes($products_name) . '">' . zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT,'id="SBA_ProductImage"') . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>' . $relEOF; ?>');[/QUOTE]

mc12345678 commented 8 years ago

Made improvements to the image switch capability to where at least clicking on the new image that was swapped when using the simple SBA dropdown having one selectable product will appear in the ZC standard larger image. This is done with jquery, so not sure how/what is needed for other image "viewers" Would be a case-by-case basis. Closing issue. Images addressed beginning at commit: https://github.com/mc12345678/Stock_By_Attributes_Combined/commit/c04d2ae43db09f01a42c0e6ad85a8c864f9ebe88, but incorporated into: https://github.com/mc12345678/Stock_By_Attributes_Combined/