Show selected variant images - debut theme

PHOTO EMBED

Fri Mar 25 2022 11:23:22 GMT+0000 (UTC)

Saved by @websensepro #shopify #variantimages #debut

 _filterThumbnails: function(variant) {
      
      
      $('[thumbnail-color]').hide();

if (variant.featured_image != null && variant.featured_image.alt != null) {
  
  var selected_color = variant.featured_image.alt;
  var thumbnail_selector = '[thumbnail-color="' + selected_color + '"]';
  
  $(thumbnail_selector).show();
  
}	
else {
$('[thumbnail-color]').show();
}

},
content_copyCOPY

https://websensepro.com/blog/how-to-show-only-selected-variant-images-shopify-debut-theme/