Site logo

[Resolved] Remove Woocommerce image zoom and link to individual image

Home Forums Support [Resolved] Remove Woocommerce image zoom and link to individual image

Home Forums Support Remove Woocommerce image zoom and link to individual image

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #2521997
    Aaron

    I need to remove the mouseover effect and the magnifying glass that links to the full size image. I’m using Beaver Beaver Builder’s Themer Product Image Module to insert the product image into a template.

    I have attempted to remove per Woocommerce documentation, but it is not working, when I disaable GP Premium this code does work, so it must be a conflict somewhere with GP Premium:

    add_action( ‘after_setup_theme’, ‘remove_wc_gallery_etc’, 20 );
    function remove_wc_gallery_etc() {
    remove_theme_support( ‘wc-product-gallery-zoom’ );
    remove_theme_support( ‘wc-product-gallery-lightbox’ );
    remove_theme_support( ‘wc-product-gallery-slider’ );

    #2522046
    David
    Staff
    Customer Support

    Hi there,

    try thisL

    
    function remove_image_zoom_support() {
        remove_theme_support( 'wc-product-gallery-zoom' );
        remove_theme_support( 'wc-product-gallery-lightbox' );
        remove_theme_support( 'wc-product-gallery-slider' );
    }
    add_action( 'wp', 'remove_image_zoom_support', 100 );
    #2522070
    Aaron

    Thanks, that did it.

    #2522079
    David
    Staff
    Customer Support

    Glad to hear that.

    #2549575
    Dennis

    Hello and thanks David for this. Also helped me. Is there a way to remove the link on the image? It opens in a new window.
    https://dust2clean.novahost.dk/produkt/drypspand-blaa-20-ltr/

    #2549931
    David
    Staff
    Customer Support

    Hi there,

    try adding this snippet too:

    add_filter('woocommerce_single_product_image_thumbnail_html','wc_remove_link_on_thumbnails' );
     
    function wc_remove_link_on_thumbnails( $html ) {
         return strip_tags( $html,'<div><img>' );
    }
    #2549973
    Dennis

    Great David! Really appreciate this!

    #2550275
    David
    Staff
    Customer Support

    You’re welcome

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