[Support request] disable lightbox/image zoom woocommerce

Home Forums Support disable lightbox/image zoom woocommerce

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1251594
    Nick

    Hi there,

    I would like to disable the image zoom/lightbox for the products.
    I can not find in in woo settings or customizer?
    I am using the woocommerce element/module from GP premium.
    Thank you in advance.

    Site is not live so i cant give any URL.

    #1251668
    Leo
    Staff
    Customer Support

    Hi there,

    Try this snippet:

    function remove_image_zoom_support() {
        remove_theme_support( 'wc-product-gallery-zoom' );
        remove_theme_support( 'wc-product-gallery-lightbox' );
    }
    add_action( 'wp', 'remove_image_zoom_support', 100 );

    Adding PHP: https://docs.generatepress.com/article/adding-php/

    #1252841
    Nick

    Hi there,

    Thank you, that works!

    But one more thing: now the image can still be clicked on and is then enlarged but now way to navigate back to the site (other then the arrow in the browser).
    Is there a way to also switch off clicking/enlarging on/off the image?

    Thank you in advance.

    #1253043
    David
    Staff
    Customer Support

    Hi there,

    try adding this snippet as well:

    add_filter('woocommerce_single_product_image_thumbnail_html','wc_remove_link_on_thumbnails' );
     
    function wc_remove_link_on_thumbnails( $html ) {
         return strip_tags( $html,'<img>' );
    }
    #1253084
    Nick

    Hi there,

    Sadly that also makes all variations images “gone” as in when you click on a variation from the dropdown/swatches the variation image doesnt appear when this snippet is added..

    The zoom is not that much of an “issue” (if it can be removed it would be nice but otherwise no problem).

    The lightbox/larger image on click is an issue since it doesnt contain any navigation (arrows/dots/similair) or an X or something to close it (people get “lost”, i gave a few the option to try it).

    Could use some more help 🙂
    Thank you!

    #1253180
    David
    Staff
    Customer Support

    Try adding this CSS just to disable the main images link:

    .woocommerce-product-gallery .flex-viewport {
        pointer-events: none;
    }
    #1253254
    Nick

    Hi there,

    Same result sadly: the zoom is gone, and so is the magnifying glass icon but still the images can be opened as/in a lightbox with no navigation/arrows or way to go back (other then clicking the browser arrow).

    for now i will leave it like this, once the site is live (next week) i will send a message in this topic, it is probably easier for you if you can see it 🙂

    Have a nice day.

    #1253288
    David
    Staff
    Customer Support

    For sure – let us know when the site is live.

    #1322442
    Tris

    I was just looking for how to do this…glad someone else asked. Could this be added to GP Premium Woocommerce options? Just a nice little checkbox in the Layout -> Woocommerce section. Thank you!

    #1322635
    Nick

    Site is live: http://www.spuitbuswinkel.nl

    maybe support can have a look?

    #1322655
    Leo
    Staff
    Customer Support
Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.