Skip to content

Instantly share code, notes, and snippets.

@zakhardage
Last active April 11, 2017 14:20
Show Gist options
  • Select an option

  • Save zakhardage/7e01229cb902b7ab9055 to your computer and use it in GitHub Desktop.

Select an option

Save zakhardage/7e01229cb902b7ab9055 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