Change main image on color swatch hover on category page
-
we would like the images to change on hover and not on click
https://morenad.co.il/product-category/swimwear-on-sale/
for exmaple, the first swimsuit on the left – has 3 images that change only on click.
thanks ahead.
none of the category layouts / styles enables it.
are we missing an option or is there a snippet to enable it?
Attachments:
You must be
logged in to view attached files.
Hi,
Try to add the following code snippet to the Custom JS area on document ready in Theme Settings to fix this issue.
function swatch_hover(){
jQuery('.swatch-on-grid').on('hover mouseover', function(){
if(!jQuery(this).hasClass('active-swatch')) {
jQuery(this).trigger('click');
}
});
}
swatch_hover();
jQuery(document).on('pjax:complete', function() {
swatch_hover();
});
Kind Regards
Thank you very much, works perfectly