[Resolved] Disable Woo product images linking to gallery page

Home Forums Support Disable Woo product images linking to gallery page

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #907047
    John

    This seems like it should be incredibly simple and obvious, but I’ve thought and looked and googled and I’m clearly just missing something somewhere.

    I have created some products in WooCommerce and added product images (see attached image).

    Images display as they should, clicking one makes it the main (bigger) image and mouseover zooms. All great.

    What I also have and don’t want is a zoom icon on the top right of main image which clicks through to a separate gallery page.

    I would like to disable this, but it doesn’t seem obvious how.

    I know I can just hide it with css using display: none; but surely there is a better solution, what am I missing?

    #907068
    Leo
    Staff
    Customer Support
    #907397
    John

    Thanks Leo but that function doesn’t do exactly what I am looking for.

    If I use that function then I get rid of the magnifying glass but clicking anywhere on the image takes me to a popup gallery page and I lose the rollover zoom functionality.

    What I want is to keep the images with rollover zoom but get rid of the link to the ‘gallery’ so that you see and can zoom on the images on the product page but there is no clickable link (the magnifying glass) to take you away from the product page.

    #907398
    John

    What I want to get rid of is this:

    <a href="#" class="woocommerce-product-gallery__trigger"><img draggable="false" class="emoji" alt="πŸ”" src="https://s.w.org/images/core/emoji/12.0.0-1/svg/1f50d.svg"></a>

    But without making the entire image then turn into a link to the gallery.

    #907619
    David
    Staff
    Customer Support

    Hi there,

    maybe this topic is of help – the user wanted to remove the lightbox and then the link from the featured image:

    https://wordpress.org/support/topic/disable-lightbox-for-woocommerce-products/

    #908024
    John

    Yep, this function does pretty much exactly what I was looking for.

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

    Excellent, thanks.

    #908089
    David
    Staff
    Customer Support

    Glad we could be of help

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.