• Resolved pxforti

    (@pxforti)


    The product image lightbox stopped working when I updated to 3.0. I can’t find any setting to turn it on or off. It was in Products > Display but is no longer there. Any ideas how to turn it back on? I’m not getting any console errors.

    Figured it out

    Add this to your functions.php:

    add_theme_support( ‘wc-product-gallery-zoom’ );
    add_theme_support( ‘wc-product-gallery-lightbox’ );
    add_theme_support( ‘wc-product-gallery-slider’ );

    It would be nice if there was a message after the upgrade to remind you to do that.

    • This topic was modified 7 years, 7 months ago by pxforti.
Viewing 14 replies - 1 through 14 (of 14 total)
  • i tried this but not working.. m using mystile theme.

    Thread Starter pxforti

    (@pxforti)

    I just tried it on the WooCommerce theme storefront and it worked.

    If you are using a child theme, make sure you put it in the functions.php for that theme.

    Also, you have to be using WooCommerce version 3.x

    i am using mystile. m not using any child theme. already added 3 lines in my function.php

    fearlessfitnessbeauty

    (@fearlessfitnessbeauty)

    Disregard,…figured it out. ??

    Thread Starter pxforti

    (@pxforti)

    it might be because your images are protected.

    Thread Starter pxforti

    (@pxforti)

    Also, you should try turning off plugins to see it that fixes the problem.

    Image protection plugin has no affect. Tried that already.

    A.Ch

    (@alichakery)

    I have the same issue, and already have added those 3 lines.

    Thread Starter pxforti

    (@pxforti)

    samdobrow. Looks like you got it working. When I click on your page link and click the magnifying glass icon, I get the lightbox image. Is that correct? If so, what did you do to get it to work? Your answer might help others who are having trouble getting the image lightbox theme support function to work.

    Thanks

    Thank you for this!! I was trying to figure out why my lightbox suddenly stopped working and thought I had mangled something in the template.

    Looks like posts here autoupdate straight quotes to curly quotes, after I changed your code to use straight quotes it worked for me.

    add_theme_support( 'wc-product-gallery-zoom' );
    add_theme_support( 'wc-product-gallery-lightbox' );
    add_theme_support( 'wc-product-gallery-slider' );
    • This reply was modified 7 years, 6 months ago by curlypinky.

    I use WordPress 4.7.4 with Woocommerce Version 3.0.6 and the theme Storefront Version 2.1.8.
    I use more than two Pictures in a product and want to use the woocommerce lightbox.

    But When I choose Woocommerce / Settings / product /view I cannot choose a lightbox Checkbox.

    I have also add the three lines into functions.php but I can still not find the Checkbox für the lightbox.
    Here a screenshot: https://www.dropbox.com/s/m7vget4m5plm0d3/storefront.png?dl=0

    Hope you can still help me.
    kindly regards

    With WooCommerce 3 they have removed the lightbox setting in the admin in favor of letting the theme determine how lightbox is applied. So once you have added the 3 lines to your functions.php it should just start working – no checkbox will appear in your WooCommerce settings. If you enabled all 3 then when you go look at your product detail, you will see a zoom effect as you move you mouse over the image and a magnifying glass will appear in the upper right corner of the image. Click the magnifying glass to open the large view in a full screen slider of the product images. If you don’t like the zoom effect then comment out the wc-product-gallery-zoom line in your functions.

    I added below codes to functions.php of my theme by it doesn’t show lightbox yet.

    add_theme_support( 'wc-product-gallery-zoom' );
    add_theme_support( 'wc-product-gallery-lightbox' );
    add_theme_support( 'wc-product-gallery-slider' );

    or

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

    Then I disabled the woocommerce plugin and enabled it again but lightbox doesn’t work yet too.

    I am using wordpress 4.7.4 and woocommerce 3.0.6 on local host .

    please guide me.

    thanks

    • This reply was modified 7 years, 6 months ago by Mohammad.

    Worked for me, thanks a lot !

    @mohammad177 maybe your cache ?

    • This reply was modified 7 years, 6 months ago by akkolad.
Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Product Image Lightbox Not Working in Version 3.0’ is closed to new replies.