Sandesh

April 21, 2020

WooCommerce: Disable Zoom, Lightbox and Product Gallery Slider @ Single Product Page

WooCommerce has exciting features like image zoom effect. Lightbox and product images gallery. But, it may not be needed for everyone. If you want to disable Zoom, Lightbox, and Product gallery slider, then this code snippet will work for you.

Names in the code are self-explanatory about the function.

PHP code snippet :

/**
 * @snippet       WooCommerce: Disable Zoom, Lightbox and Product Gallery Slider @ Single Product Page
 * @author        Sandesh Jangam
 * @donate $7     https://www.paypal.me/SandeshJangam/7
 */
 
add_action( 'wp', 'ts_remove_zoom_lightbox_gallery_support', 99 );
  
function ts_remove_zoom_lightbox_gallery_support() { 
   remove_theme_support( 'wc-product-gallery-zoom' );
   remove_theme_support( 'wc-product-gallery-lightbox' );
   remove_theme_support( 'wc-product-gallery-slider' );
}

Where to add custom PHP code?

Add the above PHP code at the end of to your child theme’s functions.php. There are many ways to add custom PHP code ( custom functionality ) to WordPress / WooCommerce website. Read this article for more information

Why this code is not working?

If you face any issue with the above code, then please let me know in the comment. I will be happy to review the code, and If it is working for you, then show me some love in the comment section.

Thank you in advance…!

Sharing is Caring!
Share on facebook
Share on twitter
Share on linkedin
Share on pinterest
Share on telegram
Share on whatsapp

About the Author

Sandesh Jangam is Developer, WooCommerce Expert, and Podcaster. He is working as a WordPress developer since 2014 and helping people with this blog. He loves to travel ancient temples, chilling at the beach and reading books

Join 1,000+ Subscribers

Get exclusive access to WordPress, WooCommerce tips, articles, tutorials right in your inbox.​

Share on facebook
Share on twitter
Share on linkedin
Share on pinterest
Share on telegram
Share on whatsapp

4 thoughts on “WooCommerce: Disable Zoom, Lightbox and Product Gallery Slider @ Single Product Page”

  1. Hi Sandesh, I’ve tried this code, but what happens is my product images then completely disappear. Or if I use a product gallery/slider plugin (I’ve tried 5 or 6 different ones) I get all the images underneath each other, rather than in a slider… If you have any tips on how to solve that I’d be very appreciative! My site is olalakids.co.uk – thank!

  2. Hi, i tried this snippet and now my add to cart text has disappeared. whats the code to undo this function? removing it from fucntions.php didn’t help, thanks

    1. Removing it should work, as PHP code will only work if it exists for execution.

      Check if you have server side cache or not?

Leave a Comment

Your email address will not be published.

Become a WooCommerce Customization Expert and Earn More​

Get an early access notification right in your inbox.

Learn More or Register Now >>>