Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Re: Add Additional Details on an order to the notifications

Add Additional Details on an order to the notifications

charlesingrum
Visitor
3 0 0

My order has additional detail but those details are not passed to the email notifications.  

We have tried many things like the following but with no success.

 

{% for attribute in attributes %}
{{ attribute | date }}
{% endfor %}

 

Replies 6 (6)

speedboostr
Trailblazer
136 20 26

Try accessing with dot notation like this:

 

{% for attr in attributes %}
  {{ attr.date }}
{% endfor %}

 

This assumes the attribute name is "date".

 

If you're not sure the exact attribute name you can look at the order JSON data to see:

1. Go to the order details page in Shopify admin and add ".json" to the end of the url (it will look something like your-store.com/admin/orders/123214434.json)

2. Press enter to load the data

3. Search for "note_attributes". There you should see the name / value pairs of the attributes

 

If that doesn't work you could try this:

{% for attr in attributes %}
  {{ attr.name }} = {{ attr.value }}
{% endfor %}

 

In the API it's name / value pair, not sure if that's how it works in the order confirmation but either 1 of those should work for you.

Creator of Theme Scientist (A/B testing app and theme scheduler). Creator of Shopify Analyzer (1st performance analysis tool for Shopify, free for the community). Founder of Speed Boostr (Shopify optimization experts + app developers). More apps from our team: Tip Jar (add a tip button), File Optimizer (optimize CSS, JS, Liquid).
charlesingrum
Visitor
3 0 0

these code examples are not working. 

In the .json file I see this

"note_attributes":[{"name":"date","value":"April 8, 2022"}]

 

How do I tweak the code?

 

Thanks,


Charles

 

 

 

JoesIdeas
Shopify Partner
2444 225 661

*Sorry, accidental post here and couldn't find a way to delete it. The @speedboostr solution should work.

• Creator of Order Automator [auto tag, fulfill, connect FBA, daily jobs]
• Co-Creator of Product Automator [suite of features for products / collections]
• Shopify developer for 10+ years, store owner for 7 years
• Blog: Shopify Tips, Guides, and Automation Tactics
speedboostr
Trailblazer
136 20 26

@charlesingrum Try it with just the variable, no for loop, like this:

 

{{ attributes.date }}

 

That should work according to this reference: https://help.shopify.com/en/manual/orders/notifications/email-variables

Creator of Theme Scientist (A/B testing app and theme scheduler). Creator of Shopify Analyzer (1st performance analysis tool for Shopify, free for the community). Founder of Speed Boostr (Shopify optimization experts + app developers). More apps from our team: Tip Jar (add a tip button), File Optimizer (optimize CSS, JS, Liquid).
charlesingrum
Visitor
3 0 0

This did not work.  Just so we are clear, I am putting this in the Packing List Template to test it.   

 

What else can I try?

 

Thanks,

 

Charles

 

speedboostr
Trailblazer
136 20 26

Ah dang, in that case I would have said the guide was incorrect and you should contact Shopify support, but since you're now talking about packing slips you'll need to consult a different guide.

 

I found this: https://help.shopify.com/en/manual/shipping/setting-up-and-managing-your-shipping/packing-slips-vari...

 

Tip: Shopify has guides for almost everything in the store. Whenever you need help just search "shopify [what you're looking for] guide". The guides are pretty good, they can help you understand what you're editing and make you a stronger store manager. And of course post in the forums if you need help too, plenty of us like to help.

 

I read that guide and don't see order attributes available, so you may have to change your flow and use either order notes or line item properties (you can see how to access both of those variables in the guide).

 

Example:

{{ order.note }}

 

If you're not sure how to change the attributes to notes, I would contact either the app or the developer that set that up, they might be able to do it.

Creator of Theme Scientist (A/B testing app and theme scheduler). Creator of Shopify Analyzer (1st performance analysis tool for Shopify, free for the community). Founder of Speed Boostr (Shopify optimization experts + app developers). More apps from our team: Tip Jar (add a tip button), File Optimizer (optimize CSS, JS, Liquid).