N
N
Notice_n2019-11-30 01:13:34
WordPress
Notice_n, 2019-11-30 01:13:34

How to fix lightbox in Woocomerce product gallery?

To make the product gallery work, Woocomerce added the following code to functions.php:

add_action( 'after_setup_theme', 'mytheme_setup' );
function mytheme_setup() {
    add_theme_support( 'wc-product-gallery-zoom' );
    add_theme_support( 'wc-product-gallery-lightbox' );
    add_theme_support( 'wc-product-gallery-slider' );
}

As a result, everything works as usual until an empty product gallery appears.
Those. if the product gallery is empty, and there is only an image of the product, then when the lightbox is closed, the form does not close (or closes partially) and the page has to be reloaded.
How to fix it?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question