Shopify notification email guide
Add line item properties to the Shopify shipping confirmation email
What you’ll need
Access to Settings in your Shopify admin
How to get this: Access to Settings in your Shopify admin
- Sign in at admin.shopify.com with the account you use for your store.
- If you are staff rather than the owner, ask the owner to give you Settings permission in Settings › Users.
Shopify’s email template to paste into
How to get this: Shopify’s email template to paste into
- Settings › Notifications › Customer notifications, open Order confirmation (or the email the tool names), then Edit code.
- Copy the current code somewhere safe first, so you can undo.
Steps
- In Shopify admin, go to Settings › Notifications › Customer notifications › Shipping confirmation and click Edit code.
- Search (Ctrl+F or Cmd+F) for {% if line.line_item.selling_plan_allocation %}. It appears once.
- Click at the start of that line and paste the loop below on new lines above it.
- Save and Preview.
The loop
{% comment %} Added with Easy Store Tools: line item properties {% endcomment %}
{% for property in line.line_item.properties %}
{% assign property_first_char = property.first | slice: 0 %}
{% if property.last != blank and property_first_char != '_' %}
<span class="order-list__item-variant">{{ property.first }}: {% if property.last contains '/uploads/' %}<a href="{{ property.last }}" class="link">{{ property.last | split: '/' | last }}</a>{% else %}{{ property.last }}{% endif %}</span><br/>
{% endif %}
{% endfor %}Why line.line_item
In shipping emails the loop goes over fulfillment.fulfillment_line_items. Each of those wraps the original order line, so the properties are on line.line_item.properties, not line.properties.
Questions
Does this work for Shipping update and Out for delivery too?
Those templates use the same fulfillment line items, so the same loop works; place it in their item list the same way.
Related tools and guides
- Add the fields to your product page (line item properties generator)
Liquid Snippet Studio