• With the new update (3.0.1) a zoom and lightbox were added to the single products pages.

    How can I disable that?

    Before you guys had an option to disable under Settings > Products > Display, which is now gone.

    Please help!
    Thanks!

Viewing 15 replies - 1 through 15 (of 17 total)
  • I Have the same problem !

    Rynald0s

    (@rynald0s)

    Automattic Happiness Engineer

    Hi there!

    You can disable lightbox using:

    remove_theme_support( 'wc-product-gallery-lightbox' );

    and zoom using:

    remove_theme_support( 'wc-product-gallery-zoom' );

    Those lines can be added to your child theme’s functions.php file or via a plugin that allows custom functions to be added – such as My Custom Functions or Code Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be wiped entirely when you update.

    Cheers!

    @rynald0s.. It not works with Storefront Child..

    Thread Starter fariadesign

    (@fariadesign)

    @rynald0s

    That doesn’t work. I am very familiar with adding custom functions via functions.php file, and I am sure I added them correctly.

    Additionally, I switched the theme temporarily to “Twenty Seventeen” and deactivated all the plugin to make sure they weren’t conflicting. None of that worked.

    Please advice.

    Thanks!

    Rynald0s

    (@rynald0s)

    Automattic Happiness Engineer

    Hi @fariadesign / @newmediologo

    See if this works:

    add_action( 'after_setup_theme', 'remove_pgz_theme_support', 100 );
    
    function remove_pgz_theme_support() { 
    remove_theme_support( 'wc-product-gallery-zoom' );
    }

    Ps. this only removes product gallery zoom

    Cheers!

    Thread Starter fariadesign

    (@fariadesign)

    Awesome! Worked, thanks!
    Any idea of how this action would work for removing the lightbox too?

    I try to add the other function
    remove_theme_support( 'wc-product-gallery-lightbox' );
    to the same action, but it only “un-styled” the current lightbox, kind removing the black background. But the user is still able to click on the image.

    Thanks!

    @rynald0s

    Thanks! great solution. It works for me. (“dream spa” child theme)

    Thank @rynald0s it works…:-)

    Help. This code above doesn’t work for me. I really need to disable the lightbox/zoom because it calls in full size images in the lightbox. I sell images so the shop must only show watermarked images and full-size images have no watermark because those are the ones that can be downloaded after purchase.

    Should this code work with any theme. Mine is Create by Catchthemes and I put the code in the child functions.php but it didn’t do anything.

    Thanks.

    Hello,

    What happens if we disable lightbox and zoom ? Visitors cannot click on the main picture at all ?

    Thanks.

    Hi
    See if this works:

    
    add_action( 'after_setup_theme', 'remove_pgz_theme_support', 100 );
    function remove_pgz_theme_support() { 
    remove_theme_support( 'wc-product-gallery-zoom' );
    remove_theme_support( 'wc-product-gallery-lightbox' );
    }
    
    • This reply was modified 6 years, 10 months ago by mizfa.

    That worked for me #mizfa, thanks!!!

    I seem to be having trouble getting this to work for me. I’ve added the above code to my child theme functions.php, but I can’t seem to disable this %$^$#$$ gallery! I’ve successfully eliminated some unnecessary tabs by adding the following, but cannot get the gallery slider to go away. Basically, I want all the product gallery images to be displayed all at once. Thanks in advance.

    // add_filter( ‘woocommerce_product_tabs’, ‘bbloomer_remove_product_tabs’, 98 );

    add_action( ‘woocommerce_after_single_product_summary’, ‘comments_template’, 50 );

    add_filter( ‘woocommerce_product_tabs’, ‘woo_remove_product_tabs’, 98 );

    function woo_remove_product_tabs( $tabs ) {

    // unset( $tabs[‘description’] ); // Remove the description tab
    unset( $tabs[‘reviews’] ); // Remove the reviews tab
    unset( $tabs[‘additional_information’] ); // Remove the additional information tab

    return $tabs;

    }

    Hi, I tried the code to disable lightbox and zoom: it works

    BUT when people click on my products picture, it still open a page showing the picture on a black background (and hiding my complete product page).

    Can you tell me how to disable this totally ? I do not want that my customers leave the product page at all, so I do not want that they click on the product image.

    Thank you.

    EDIT: I have found this and it works:
    https://wpexplorer-themes.com/total/snippets/disable-lightbox-woocommerce-products/

    So actually maybe no need to disable lightbox ? People cannot click on the pictures anymore when using this code:

    
    .woocommerce-product-gallery__image {
        pointer-events: none;
    }
    

    SORRY, EDIT AGAIN ??

    Actually we need both, disable lightbox and zoom + the css code, or visitors could still click on the pictures (that open full screen without lightbox).

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Disable new gallery and zoom at single product pages’ is closed to new replies.