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
    1. Sign in at admin.shopify.com with the account you use for your store.
    2. If you are staff rather than the owner, ask the owner to give you Settings permission in Settings › Users.

    Step-by-step guide (opens in a new tab)

  • Shopify’s email template to paste into

    How to get this: Shopify’s email template to paste into
    1. Settings › Notifications › Customer notifications, open Order confirmation (or the email the tool names), then Edit code.
    2. Copy the current code somewhere safe first, so you can undo.

Make the snippet

Steps

  1. In Shopify admin, go to Settings › Notifications › Customer notifications › Shipping confirmation and click Edit code.
  2. Search (Ctrl+F or Cmd+F) for {% if line.line_item.selling_plan_allocation %}. It appears once.
  3. Click at the start of that line and paste the loop below on new lines above it.
  4. Save and Preview.

The loop

Paste above the selling plan line
{% 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.

More guides