Site logo

Archived topic

Remove Woocommerce image zoom and link to individual image

7 replies · Started by Aaron on February 5, 2023

Viewing posts 1–8 of 8

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' );

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 );

Thanks, that did it.

Glad to hear that.

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>' );
}

Great David! Really appreciate this!

You're welcome

This archived topic is closed to new replies.