Home » WooCommerce: Disable Zoom, Lightbox, And Gallery Slider

WooCommerce: Disable Zoom, Lightbox, And Gallery Slider

Last updated on December 23, 2020 by

As you know guys, WooCommerce comes with a bunch of features but some of them not required to keep and might clients don’t want to keep as it is. In this article, we will see how in WooCommerce disable zoom, lightbox, and gallery slider. Let’s see how to do it.

Table of Contents
1. Disable WooCommerce Product Zoom In Single Page
2. Disable WooCommerce Product Gallery Slider In Single Page
3. Disable WooCommerce Product Lightbox In Single Page
4. Disable All Together
5. Where To Add This Snippet?

01 Disable WooCommerce Product Zoom In Single Page

In older version of WooCommerce didn’t provide inbuilt zoom functionality for a single product but in the latest version WooCommerce providing it as a default functionality. Add the following code snippet in your child theme’s function.php file to disable it.

add_action( 'after_setup_theme', 'scratchcode_disable_wc_zoom', 20 );
function scratchcode_disable_wc_zoom() {
    remove_theme_support( 'wc-product-gallery-zoom' );
}
add_action( 'after_setup_theme', 'scratchcode_disable_wc_gallery_slider', 20 );
function scratchcode_disable_wc_gallery_slider() {
    remove_theme_support( 'wc-product-gallery-slider' );
}

03 Disable WooCommerce Product Lightbox In Single Page

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

04 Disable All Together

add_action( 'after_setup_theme', 'scratchcode_disable_wc_lightbox_zoom_slider', 20 );
function scratchcode_disable_wc_lightbox_zoom_slider() {
    remove_theme_support( 'wc-product-gallery-zoom' );
    remove_theme_support( 'wc-product-gallery-lightbox' );
    remove_theme_support( 'wc-product-gallery-slider' );
}

Where To Add This Snippet?

Most Important: Add the following code to your child theme’s functions.php file. If you add custom code directly to your parent theme’s functions.php file then it will be wiped entirely when you update the theme.

If you are using a custom theme and if it doesn’t require any update then you can directly place the code into wp-content/themes/your-theme/function.php file.

Please also note that we have tested all codes in the GeneratePress child theme & Storefront child theme.

Additionally, read our guide:

  1. How to Add Products Per Page Dropdown in WooCommerce
  2. “Sorry, your session has expired. Return to homepage” – WordPress WooCommerce Error
  3. How to Create a Plugin in WordPress from Scratch
  4. How to Disable Admin Bar in WordPress Without Plugin
  5. How to Rollback WordPress Plugin Update
  6. How To Send Custom Emails in WordPress

That’s it for now. We hope this article helped you WooCommerce disable zoom, lightbox, and gallery slider in a single product page.

Please let us know in the comments if everything worked as expected, your issues, or any questions. If you think this article saved your time & money, please do comment, share, like & subscribe. Thank you in advance 🙂

 
 

4 thoughts on “WooCommerce: Disable Zoom, Lightbox, And Gallery Slider”

  1. I found your weblog web site on google and test just a few of your early posts. Proceed to maintain up the excellent operate. I just further up your RSS feed to my MSN News Reader. Looking for ahead to reading more from you afterward!…

    Reply

Leave a Comment

*

code