Skip to content

Instantly share code, notes, and snippets.

@CarsonBain
Last active November 7, 2019 04:00
Show Gist options
  • Save CarsonBain/87bd092cd1ba898e257152bd96bb4b28 to your computer and use it in GitHub Desktop.
Save CarsonBain/87bd092cd1ba898e257152bd96bb4b28 to your computer and use it in GitHub Desktop.
Product Line Item Personalization Fields Shopify
{% comment %}
Product personalization line items
{% endcomment %}
<div class="product-single__personalization">
{% comment %}
Product personalization required dropdown
{% endcomment %}
{% assign personalizationOptions = section.settings.dropdown_options | split: "," %}
{% if personalizationOptions.size > 0 %}
<p class="product-single__personalization--line-item">
<label>{{section.settings.dropdown_name}}</label><br>
<select required class="required" id="{{section.settings.dropdown_name}}" name="properties[{{section.settings.dropdown_name}}]">
{% for option in personalizationOptions %}
<option value="{{option}}">{{option}}</option>
{% endfor %}
</select>
</p>
{% endif %}
{% comment %}
Product personalization optional input field
{% endcomment %}
<p class="product-single__personalization--line-item">
<label for="optional-personalization">{{section.settings.monogram}}</label>
<input maxlength="3" placeholder="ABC" id="optional-personalization" type="text" name="properties[{{section.settings.monogram}}]">
</p>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment