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' );
}
4 thoughts on “WooCommerce: Disable Zoom, Lightbox and Product Gallery Slider @ Single Product Page”
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!
Is there a way to disable just the lightbox site-wide?
URL: http://jgl.677.myftpupload.com/shop-all/
It seems to be an issue after the infinite load function
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
Removing it should work, as PHP code will only work if it exists for execution.
Check if you have server side cache or not?