Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save keyurshah/7d91f6d071044eacf575d9b64bf4f6a7 to your computer and use it in GitHub Desktop.
Save keyurshah/7d91f6d071044eacf575d9b64bf4f6a7 to your computer and use it in GitHub Desktop.
Line Item Properties from Product Tags
{% for tag in product.tags %}
{% if tag contains 'color-' %}{% assign color = true %}{% endif %}
{% endfor %}
{% if color %}
<div class="select">
<label>Color:</label>
<select id="color" name="properties[Color]">
{% for tag in product.tags %}
{% if tag contains 'color-' %}
<option value="{{ tag | remove:'color-' }}">{{ tag | remove:'color-' }}</option>
{% endif %}
{% endfor %}
</select>
</div>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment