Variant images not updating

Highlighted
New Member
1 0 0

Hi All,

So I have somewhat ignored this issue for a while but it's really becoming frustrating now. When a product has multiple variants e.g. color and separate images have been uploaded and linked to those variants I would expect the correct image to display when selected from the drop down. This certainly used to work but stopped working perhaps 12-24 months ago (maybe more) presumably when Shopify updated something.

Example product here: https://www.sportingservices.co.uk/products/swatcom-active8-waterproof-headset-with-headband 

I'm using an old Shopify Theme 'New Standard' and a very lightly customized product template to hide the 'add to basket' options as per a thread I originally read on here. I can see code at the bottom of the liquid file that I assume is supposed to select images:

{% if look_for_image_match %}
// If a Color is selected, show the matching product image.
jQuery('.single-option-selector:eq({{ option_index }})').bind('change', function() {
if (!Shopify.doNotTriggerClickOnThumb) {
jQuery('#product-photo-thumbs img[alt="' + jQuery(this).val() + '"]:eq(0)').trigger('click');
}
Shopify.doNotTriggerClickOnThumb = false;
return true;
});
// If an image is shown in Main View, auto-select the corresponding Color option.
jQuery('#product-photo-thumbs img').bind('click', function() {
var color = jQuery(this).attr('alt');
if (color && color !== '') {
var options = jQuery('.single-option-selector:eq({{ option_index }}) option[value="' + color + '"]');
if (options.size() !== 0) {
Shopify.doNotTriggerClickOnThumb = true;
jQuery('.single-option-selector:eq({{ option_index }})').val(color).trigger('change');
}
}
return true;
});
{% endif %}

Any pointers as to what I should be looking for really appreciated as I'm really not sure where to start !

Best Regards

Ian.

0 Likes