Variation Image Gallery issue
-
Hello,
I have a issue with the variation image gallery. On my products I both have color and size and variation image/gallery on the variations.
When I start by changing the color the main image only changes if size is not selected.
I would like it to be so if I change the color it checks the first size in this color and uses the image gallery and if it’s empty it uses the featured images of the product.
Attachments:
You must be
logged in to view attached files.
Hello,
Please provide the URL of the product to check it myself and help you out accordingly.
Best Regards
Hello,
I fixed the issue by adding little jquery code:
<script>
(function($){
$(document).ready(function(){
let isRunning = false;
$('.variable-item').click(function(){
if(isRunning) return;
let element = $(this);
window.setTimeout(function(){
let el = element.parents('tbody');
let classnames = element.attr('class');
$(el).find('tr').each(function(){
let sel = $(this).find('li.selected:first');
let doubleClick = true;
if(!sel.length){
sel = $(this).find('li:not(.disabled):not(.no-stock):first');
doubleClick = false;
}
if(classnames !== sel.attr('class')){
isRunning = true;
sel.click();
if(doubleClick){
sel.click();
}
window.setTimeout(function(){
isRunning = false;
},500);
}
});
},500);
});
});
})(jQuery);
</script>
Hello,
We are Glad that your issue has been Resolved.
Let us know if there’s anything else we can do for you! You can always reach us at any time. We are always here to help you.
Have a wonderful day.
Topic Closed.
Best Regards.
The topic ‘Variation Image Gallery issue’ is closed to new replies.