Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ltakens/0c0c584cfa9c460bb64fc647fa28cfdb to your computer and use it in GitHub Desktop.
Save ltakens/0c0c584cfa9c460bb64fc647fa28cfdb to your computer and use it in GitHub Desktop.
{% comment %}
Do you have customized form fields on the product pages of your Shopify store?
Shopify's order confirmation email does not automatically display the values the customer inputs. Here's how to includes them manually.
1. Go to Settings in the Shopify admin
2. Click Notifications
3. Click the link Order confirmation to open the template editor
4. Now copy and paste this code in the template right in the section where the order's line items are rendered.
Look for a line that contains {{line.variant.title}}. You'll want to experiment with the code location.
5. Click Save to save the template changes.
6. Now create a test order with values for your custom form fields and inspect the result.
{% endcomment %}
{% assign property_size = line.properties | size %}
{% if property_size > 0 %}
{% for p in line.properties %}
{% assign first_character_in_key = p.first | truncate: 1, '' %}
{% unless p.last == blank or first_character_in_key == '_' %}
<span style="font-size: .875em; color: #999;">{{ p.first }}: {{ p.last }}</span><br>
{% endunless %}
{% endfor %}
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment