{%- if product.metafields.my_fields.product_list != blank -%} <div class="variant-list"> {% for p in product.metafields.my_fields.product_list.value %} <a href="{{ p.url }}" data-color="{{ p.metafields.my_fields.colorname.value }}" class="variant-img {% if product.handle == p.handle %}variant-active-hover variant-selected{% else %}variant-not-hover{% endif %}"> <img src="{{ p | image_url: width: 150 }}" alt="{{ p.title }}"> </a> {% endfor %} </div> {%- endif -%}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter