Hello Tom.
This code has been deprecated since the release of WooCommerce version 3.0+.
Now the code that works is this, however, only if you have a single image for the product.
function custom_single_product_image_html( $html, $post_id ) {
$post_thumbnail_id = get_post_thumbnail_id( $post_id );
return get_the_post_thumbnail( $post_thumbnail_id, apply_filters( 'single_product_large_thumbnail_size', 'shop_single' ) );
}
add_filter('woocommerce_single_product_image_thumbnail_html', 'custom_single_product_image_html', 10, 2);
But in my case, as have a gallery of images, I solved with CSS (and without the code above):
.woocommerce-product-gallery__image.flex-active-slide {
pointer-events: none !important;
}
Sorry to put the options here, but maybe I can help other people. π