Hi,
Just installed IH2 on our 1.3.7.1 cart and it's working great. Brilliant contribution! But I had some minor issues:
1) couldn't get zooms working on category product listings (but worked on New Products, Featured Products, etc.)
2) couldn't get zooms working on medium (product page) images
After pulling apart the IH code, I learned some stuff that might be helpful to other IH users, which I couldn't find in the documentation at
BreakMyZenCart. (Apologies if this has already been posted...I haven't read through all 215 pages of this thread to find out, and can't seem to find anything relevant by searching.)
Problem #1: ImageHandler handles three "sizetypes" of images: "small", "medium" and "large". It determines which sizetype it's working with in two ways:
1) for medium and large images, it searches for "_medium" and "_large" in the filenames
2) for small images, it checks to see if the width and height of the image are IDENTICAL to the "Small Image Width" and "Height" set in Admin > Configuration > Images. If the dimensions are not identical, and the image is not already identified as a medium or large image, it's labelled as "generic", and no zoom behavior can be applied.
Therefore, to enable zoom behavior on ALL images (e.g., category product listings, "new product" listings, "featured product" listings, etc.), you first need to make sure that the following options MATCH the "Small Image Width" and "Height" in Admin > Configuration > Images:
Image - Product Listing
Image - Product Listing
Image - Product New Listing
Image - Product New Listing
Image - New Products Width
Image - New Products Height
Image - Featured Products Width
Image - Featured Products Height
Image - Product All Listing Width
Image - Product All Listing Height
Problem #2: I discovered that the IH get_additional_parameters() function in includes\classes\bmz_image_handler.class.php, which adds the zoom behavior to images, checks to see if the current image sizetype allows zooming (an option set for small and medium images in Admin > Configuration > Images). However, it's limited to sizetype == 'small' on the previous line, excluding the possibility that medium images can have zooms.
I changed this sizetype != 'large', so that the only images that are excluded from having zooms are large ones.
Once that was working, and I had zooms on both small and large images, I realized it was pretty silly to zoom the "No picture available" pictures. I made some minor tweaks in the IH files to prevent zooms on these default pictures. I also tweaked the main_product_image template so that if a zoom is applied to a medium image, it does not also show the default ZenCart "larger image" caption and link to the popup (which seems redundant).
Here's my tweaks as a patch. Would love it if somebody could download and test these changes and let me know what they think!
Bookmarks