Cracking the Code: How to Display Custom Order Details on Shopify Confirmation Emails
Fellow store owners, let's tackle a common Shopify challenge: getting those all-important custom order details to show up exactly where you want them – on your order confirmation emails and POS receipts.
It's a frequent scenario, especially if you use a product options app for things like custom engravings, gift wrap choices, or, as a recent community thread highlighted, specific burger toppings ordered in-store. You capture these details at checkout, they appear in your admin, but then... they're missing from the customer's receipt. Frustrating, right?
The Challenge: Custom Details Missing in Action
I recently followed a great discussion started by expressivearomas in the Shopify forums. They faced this exact problem: their product options app saved "additional details" for in-store burger orders (e.g., "lettuce and tomatoes"), but these weren't appearing on the customer's order confirmation email or mobile receipt. This crucial information enhances customer experience and brand professionalism.
The core issue? Shopify stores custom data in various places, and your email templates need to know precisely where to look. It's not always a simple plug-and-play.
Understanding Where Your App Stores Data (The Detective Work!)
Before fixing anything, we need to locate the data! As community expert v.marychenka wisely pointed out, different apps can store "additional details" in various spots within an order:
- Line Item Properties: Custom options tied to a specific product variant (e.g., "lettuce" on a "burger"). Often used by product options apps.
- Order Attributes: Details applying to the entire order (e.g., a general gift message).
- Order Note: A simple note for the entire order.
- Metafields: Custom data fields created by apps.
To pinpoint where your app stores these details, v.marychenka shared a brilliant diagnostic trick. This temporary code snippet will print common data points on a test receipt.
Step 1: Your Data Detective Kit – Temporarily Adding Diagnostic Code
Note: Perform this when your shop is quiet, as receipts sent during this time will include test lines. Remove the code afterward!
- Go to your Shopify Admin.
- Navigate to Settings > Notifications.
- Under "Customer notifications," find "POS and mobile receipt" (under "Point of Sale"). Click "Edit code".
- At the very top of the code editor, paste the following Liquid snippet:
Note: {{ note }}
{% for a in attributes %}Order {{ a.first }}: {{ a.last }}
{% endfor %} {% for line in line_items %}{% for p in line.properties %}{{ line.title }} {{ p.first }}: {{ p.last }}
{% endfor %}{% endfor %} - Click "Save".
- Ring up a test order through your POS, finish the sale, and tap "Email receipt" to send it to your own address.
- Check that test email. Look for your custom details next to "Note," "Order attributes," or "Line item properties." This identifies the storage location.
- Important: Once identified, remove this diagnostic code from your "POS and mobile receipt" template.
Step 2: Implementing the Permanent Fix
![]()
Knowing whether your details are in `line.properties` or `attributes`, you can now add the specific code to both your Order confirmation email template and your POS and mobile receipt template. Both are in Settings > Notifications > Customer notifications.
Always back up your template code before making changes! And use the "Preview" button before "Save."
Option A: For Item-Specific Details (line.properties)
If your diagnostic test showed details under "Line item properties" (common for product options), add this code:
- Open the "Order confirmation" email template for editing.
- Do the same for the "POS and mobile receipt" template.
- In both templates, search for `line.title` (product name display).
- Paste the following code snippet immediately *after* the line displaying `line.title`:
{% for p in line.properties %} {% assign first_char = p.first | slice: 0 %} {% unless p.last == blank or first_char == '_' %}
{{ p.first }}: {{ p.last }} {% endunless %} {% endfor %} - This code loops through all properties for each line item, skipping hidden (`_`) or blank ones, then prints them neatly.
- Click "Preview", then "Save".
Option B: For Order-Wide Details (attributes)
If your diagnostic test showed details under "Order attributes" (for general order notes, etc.), use this code:
- Open the "Order confirmation" email template for editing.
- Do the same for the "POS and mobile receipt" template.
- Find a suitable place in the order summary section.
- Paste the following code snippet:
{% for a in attributes %} {{ a.first }}: {{ a.last }}
{% endfor %} - This loop prints all order attributes.
- Click "Preview", then "Save".
What if it's Metafields?
If neither `line.properties` nor `attributes` revealed your custom details, your app likely stores them as metafields. In this case, contact the app's support team. They can provide the exact `namespace` and `key` for the metafield, which you'd then use in Liquid (e.g., `{{ order.metafields.NAMESPACE.KEY }}`).
It's wonderful to see the community collaborate on these challenges. Getting these custom details right in customer communications significantly enhances their experience and reduces confusion. A huge shout-out to v.marychenka for those clear, actionable steps! Diagnosing the data storage location first is truly the professional way to tackle these customizations. Always remember to back up and preview your changes, and you'll achieve that polished look you're aiming for.