Shopify: Displaying Order Attributes To Customers Post Purchase

Notification emails

The notifications in Shopify use slightly different liquid objects to themes, so we need to use the attributes object which is an array, we can cycle through.

<ul>
{% for attribute in attributes -%}
<li><strong>{{ attribute.first }}:</strong> {{ attribute.last }}</li>
{%- endfor %}
</ul>
{% if attributes.delivery-date %}
<strong>Delivery Date</strong> {{ attributes.delivery-date }}
{% endif %}
{% if attributes["Delivery Date"] %}
<strong>Delivery Date</strong> {{ attributes["Delivery Date"] }}
{% endif %}
Your attribute on the email confirmation email
Your attribute on the notification email

Order history

When a customer logs in to view their order history, you can display attributes using the order.attributes object.

<ul>
{% for attribute in order.attributes -%}
<li><strong>{{ attribute.first }}:</strong> {{ attribute.last }}</li>
{%- endfor %}
</ul>
{% if order.attributes.delivery-date %}
<strong>Delivery Date</strong> {{ order.attributes.delivery-date }}
{% endif %}
{% if order.attributes["Delivery Date"] %}
<strong>Delivery Date</strong> {{ order.attributes["Delivery Date"] }}
{% endif %}
Your attribute (delivery date) shown on the customer order history page.

Order Status Page

If you have access to edit the checkout.liquid file on your Shopify Plus plan, then you can do similar things to display the attributes on the order status page, using the order.attributes object similar to the order history.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Stephen Keable

Stephen Keable

166 Followers

Shopify partner, JavaScript/Liquid/Swift developer, convert to serverless architecture and builder of digital products people love to use since 1999.