Snippets Collections
filterMedia() {
    
         $('[thumbnail-color]').hide();
    
    var selected_variant = this.currentVariant.featured_media.alt;
    
    var selected_attribute = '[thumbnail-color="' + selected_variant + '"]';
    
    if (selected_variant == selected_variant) {
      
      $(selected_attribute).show();

    } }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
 _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();
}

},
star

Mon Mar 28 2022 10:38:54 GMT+0000 (Coordinated Universal Time)

#shopify #variantimages #dawntheme
star

Fri Mar 25 2022 14:39:28 GMT+0000 (Coordinated Universal Time)

#shopify #variantimages #debut
star

Fri Mar 25 2022 11:23:22 GMT+0000 (Coordinated Universal Time) https://websensepro.com/blog/how-to-show-only-selected-variant-images-shopify-debut-theme/

#shopify #variantimages #debut

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension