Make thumbnails in woocommerce replace the main image instead of opening fancybox

I have just achieved the effect by my own. I will post it here in case others find this thread:

jQuery(document).on('click','.thumbnails .zoom', function(){
        var photo_fullsize =  jQuery(this).find('img').attr('src').replace('-100x132','');
        jQuery('.woocommerce-main-image img').attr('src', photo_fullsize);
        return false;
    }); 

.replace(‘-100×132’) eliminates the size from url of the image to return the full image and not the thumbnail. Replace it with your own thumbnails sizes.

My solution is based on:

Leave a Comment