• Resolved samrgomes

    (@samrgomes)


    I’m facing an issue where, for all newly added products, the hover zoom in WooCommerce gallery is not working (hover over images simply does not zoom it).
    Can you help me with that?

    Thank you!

Viewing 15 replies - 1 through 15 (of 22 total)
  • hannah

    (@hannahritner)

    Hey,
    Can you post a link?
    Thanks!

    Hannah

    Thread Starter samrgomes

    (@samrgomes)

    Is it possible to follow this via email with Kadence themes? I’ll need to share account credentials, since the Woo store is closed to subscribers only.

    hannah

    (@hannahritner)

    Are you using a plugin with product zoom? The free theme doesn’t have this feature by default.

    Hannah

    Thread Starter samrgomes

    (@samrgomes)

    Hey Hannah.
    I believe this is a Woo default feature. Under ‘Theme Options > Product Settings > Single Product Content Settings’ there’s an option “Enable woocommerce hover zoom for product gallery? (must be woocommerce 3.0+)”, and it’s enabled.

    hannah

    (@hannahritner)

    Oh sorry, I was looking at the wrong theme. You can email me login info if you’d like. [email protected]

    Hannah

    Thread Starter samrgomes

    (@samrgomes)

    Email sent. Thank you!

    hannah

    (@hannahritner)

    Can you tell me what you’ve added to your child theme?

    Hannah

    Thread Starter samrgomes

    (@samrgomes)

    A few functions in functions.php, some custom JS and CSS, and templates (no WC product templates, tho).

    hannah

    (@hannahritner)

    Sorry for the delay. Have you tried deactivating your plugins to test if any are conflicting? I would suggest doing so. Let me know if there’s no change.

    Hannah

    Thread Starter samrgomes

    (@samrgomes)

    I tested disabling some plugins.
    It doesn’t make much sense some of the products showing the zoom, and some don’t. I checked that some products have the image tag with class “zoomImg”, and some don’t. What are the conditions to create this img tag?

    Thread Starter samrgomes

    (@samrgomes)

    Found the cause. The issue is that WooCommerce uses the “woocommerce-product-gallery” div’s width and compares it with the largest thumb for that image. It should only zoom if the largest image is larger than its container (by container, I mean the “woocommerce-product-gallery” div). The problem is that, since the thumbnails are displayed on the side of the featured image, it counts the thumbnails and featured image together as the container width.

    Check the latest WooCommerce release. Find “woocommerce/assets/js/frontend/single-product.js”, row 192.

    In my case (when checking the code above):
    image.data( 'large_image_width' ) = 600
    galleryWidth = 654 (that’s the “woocommerce-product-gallery” div)

    But, if you check my image, it’s 460 in width. That should be counted as the container size, and image should be zoomed.

    I hope I helped finding the solution for this issue, and, hopefully, Ascend can be updated to fix this.

    Apparently, this is not related to the iPad issue.

    If you need any more help, I’l be happy to assist you, Hannah.

    Best regards.

    • This reply was modified 6 years, 6 months ago by samrgomes.

    Hey,
    Thanks for posting. Just want to clarify the issue since I didn’t see your site, you have an image that is larger then 460 but smaller then 654 so the image should zoom a very little but doesn’t because woocommerce script is saying it’s too small?

    Let me know if thats correct.

    Ben

    Thread Starter samrgomes

    (@samrgomes)

    Hey Ben.

    Actually, the main image displayed in gallery (the big one) has 460 exactly, but WooCommerce won’t zoom it (the original image is 800 x 600, and this is the one that should appear in zoom) because the script does not use the actual gallery image size (the one with 460), but the “woocommerce-product-gallery” div size, and this div is 654.

    Woo script then compares “600 > 654?”: No. So it won’t zoom it.
    The correct comparison should be “600 > 460”.

    Could you understand it? I can provide more details about it, or explain it another way, if it helps.

    Any updates on the iPad issue?

    Thanks!

    ok, yeah so your image “width to clarify” is smaller than 654. So you want to have that little zoom working, I’ll work on a fix for this.

    Hannah is going to send me your link when she can so I can see your site in regards to your issue with an ipad. I can’t recreate when testing with an Ipad on the demo.

    Ben

    Hmm, I’m seeing image zoom working on your site.

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘Woo hover zoom not working’ is closed to new replies.