All things Shopify and commerce
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 %}
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.
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
*Sorry, accidental post here and couldn't find a way to delete it. The @speedboostr solution should work.
@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
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
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.
As 2024 wraps up, the dropshipping landscape is already shifting towards 2025's trends....
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024In today’s interview, we sat down with @BSS-Commerce to discuss practical strategies f...
By JasonH Nov 13, 2024