How can I disable product lightbox but still can click on other pictures?

edited March 2021 in WooCommerce

Hi, I use this code to disable the lightbox and zooming effect

.woocommerce div.product div.images .woocommerce-product-gallery__wrapper .zoomImg {display:none!important}
.woocommerce div.product .images {pointer-events: none !important;}

But it also disable to click-on other pictures of products.

It there any way to disable the lightbox effect only on the main picture?

Here's the single product page

https://allmyloveyogurt.com/shop/mango_yogurt/

Thanks a lot!

Comments

  • Hello,

    To disable the zoom effect, please go to Betheme -> Theme options -> Blog, Portfolio & Shop -> Shop, and in the Single Product section, select Product image: Disable zoom effect.

    But to disable the lightbox, please, use the following CSS Code:

    .woocommerce .woocommerce-product-gallery__image a{
       pointer-events: none!important;
    }
    

    Thanks

  • Hi, thanks for helping.

    But the lightbox effect still on...

    and it's like two lightbox (sry, not really know how to expain that.)

  • I tried to click on the main image, and the lightbox does not show up.

    Are you able to send me an example website of how it should work?

    Or maybe try to explain in more detail what you want to achieve.


    Best regards

  • Hi, sry if I didn’t say it clearly!

    I want the lightbox effect disable on all images.

    because at first I use the code I said above, the lightbox is gone but it also makes me can not click to see other images.

  • I tried to click on other images, and the lightbox is not working either but switching to see other images works.

    Can you send me a link to the page that contains an image with a lightbox and a screenshot showing what you are referring to, please?


    Thanks

  • But I can still click on those images and the lightbox still popup. ( sry if I misunderstanding the "lightbox.")

    as you can see from the picture, this is what it shows when I click on the images. There's two lightbox.

    How can I make the images unclickable? I think this is the main question.

    Thanks again!

  • Are you able to record where do you click and these lightboxes and upload them here, please?

    Thanks to that, I will be sure what you are referring to.


    Thanks

  • Hi! I figure it out... I just simply add this css

    .woocommerce-product-gallery__image {
        pointer-events: none;
    }
    

    sorry if I didn't say it clearly before!

    Thanks :)

  • That is great you found the solution!

    If you have any other questions or problems, feel free to ask.


    Best regards

Sign In or Register to comment.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.