Hello,
I will like to change the main product image based on the image clicked in the thumbnail. So when they click whatever thumbnail instead of it poping up in a lightbox it would just show that image in the main product image box?
Hi adotopanuga!
Please try adding following code to Functions.php file in Appearance > Editor
function add_custom_target(){
?>
<script>
jQuery(document).on('mouseenter','.thumbnails .zoom', function(){
var photo_fullsize = jQuery(this).find('img').attr('src').replace('-200x300','').replace('-169x300','').replace('-300x111','').replace('-300x200','').replace('-214x300','').replace('-300x169','');
jQuery('.woocommerce-main-image img').attr('src', photo_fullsize);
return false;
});
</script>
<?php
}
add_action('wp_footer', 'add_custom_target');
If it does not work for you, please feel free to request such feature here – https://kriesi.at/support/enfold-feature-requests/ or hire a freelance developer as it would be out of scope we can provide through support
Best regards,
Yigit
Hello Yigit,
Thank you very much, it worked as expected just one slight issue i noticed. When i mouse over a thumbnail it changes the main image above it, but when i now click the newly changed main image to open it in a light box, it does not open the newly updated image instead shows the default image in the lightbox.
How can i fix it.
Hi!
Sorry but you are going to need to hire a freelance developer for such changes unfortunately. That was a quick code i threw in for my friends website and i wanted to share with you before recommending to hire a developer :)
Regards,
Yigit
Okay. no problem, Thanks for the help so far.