Color Variant Selector

PHOTO EMBED

Tue Jun 28 2022 11:24:00 GMT+0000 (UTC)

Saved by @mushdesk #html #liquid #shopify

{%- 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 -%}
content_copyCOPY