• Resolved msdesignfoto

    (@msdesignfoto)


    Hello everyone
    I am setting up an online store where the products had the lightbox and zoom features disabled by a code snippet until a while back. Also, I removed the magnifying glass icon.

    One thing I do not understand is why on earth the lightbox is active again?

    Is possible to click the product image and it opens in a black blackground. I do not want that. I don’t want a product zoom. I don’t want clickable images. I don’t want the zoom icon on the image (this is still ok, there is no zoom icon).

    Last time I managed to get this to work without clicking and zooming, the image would slide a bit to the sides when the mouse was hovering over it, but this was just with the current code snippets I am still using now. I don’t know what changed. Cache issues perhaps? I was trying this on Chrome’s anonymous mode and the result is the same.

    Here are the actual codes I tried and worked (but now they don’t):

    remove_theme_support( 'wc-product-gallery-zoom' );
    remove_theme_support( 'wc-product-gallery-lightbox' );

    and

    add_action( 'after_setup_theme', 'remove_wc_gallery_lightbox', 100 );
    function remove_wc_gallery_lightbox() {
    remove_theme_support( 'wc-product-gallery-lightbox' );
    }

    I appreciate any help

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support abwaita a11n

    (@abwaita)

    Hi @msdesignfoto,

    This has been open for quite a while.

    I’ll leave it open for a while so that anyone with ideas can share.

    I also wanted to recommend checking for insights from the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Thread Starter msdesignfoto

    (@msdesignfoto)

    Hello
    Thanks for the feedback here and reminding me of this thread.
    I searched all over the web and ended up with this code that is very different from the most that didn’t work with me. It simply disables click events on the images, without affecting other functionalities provided by 3rd party plugins in the product details that obviously need clicking.

    So to disable zoom when clicking in product image, I added this code in CSS customizer:

    /* Disable click and zoom */
    .woocommerce-product-gallery__image {
        pointer-events: none;

    And to disable the magnifying glass icon, I placed this code in the Snippets plugin (same as adding to the functions.php file):

    add_action( 'after_setup_theme', 'remove_pgz_theme_support', 100 );
    
    function remove_pgz_theme_support() { 
    remove_theme_support( 'wc-product-gallery-zoom' );
    }

    And both my issues are now solved. Lightbox is disabled. Zoom is disabled. The images do not move or nudge when the mouse goes over them.

    I hope this helps other people with the same goals.

    Cheers

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Product image with slight zoom’ is closed to new replies.