WooCommerce includes a lightbox that opens product images in a larger view when customers click them. If you prefer a simple product gallery without the popup, you can disable it with a small snippet.
Steps
- Open your theme’s
functions.phpfile. - Add the code below.
- Save the file.
- Clear your website cache and refresh the product page.
Done — the WooCommerce product image lightbox will be disabled.
function disable_woocommerce_image_lightbox() {
remove_theme_support( 'wc-product-gallery-lightbox' );
}
add_action(
'after_setup_theme',
'disable_woocommerce_image_lightbox',
100
);