This person https://www.ads-software.com/support/topic/woo-hover-zoom-not-working/ used a theme and he had same problem and he got the solution from theme author but I am the author of my test theme so what should I do.
This code helped him.
<script>
jQuery(document).ready(function ($) {
if( $( '.kt-product-style-large-image .woocommerce-product-gallery' ).length ) {
var container_width = $( '.woocommerce-product-gallery' ).width();
var images = $( '.woocommerce-product-gallery' ).find( '.woocommerce-product-gallery__image' );
$( images ).each( function( index, target ) {
var image = $( target ).find( 'img' );
if ( image.data( 'large_image_width' ) < container_width && (container_width * 0.8) < image.data( 'large_image_width' ) ) {
var start_width = image.data( 'large_image_width' );
image.data( 'large_image_width', start_width + (container_width * 0.2) );
}
} );
}
});
</script>
I used this code without the theme class .kt-product-style-large-image and it didn’t work.