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

Need coding help for Order Printer app

Need coding help for Order Printer app

ShopTempTats
Visitor
1 0 0

I need help adding a line of code to the app Order Printer so that it shows order notes. I'm trying to use the same line of code that I used in the legacy app, but it is not working. I also need code so that it shows the date the order was placed. My old code is not working for that either.

 

The code I was using for notes was 

{% if note %}
<h3 style="margin: 0 0 1em 0;">Note</h3>
<p>{{ note }}</p>
{% endif %}

 

The code I was using to show the order date was

{{ created_at | date: "%m/%d/%y" }}

Reply 1 (1)

tim
Shopify Partner
3911 394 1435

https://help.shopify.com/en/manual/orders/printing-orders/shopify-order-printer/migration#order-attr... 

Order attributes being removed from the global namespace

To access order attributes, prepend them with order.. For instance, billing_address is now accessed as order.billing_address.

 

So your code should be like

{% if order.note %}
  <h3 style="margin: 0 0 1em 0;">Note</h3>
  <p>{{ order.note }}</p>
{% endif %}

 
{{ order.created_at | date: "%m/%d/%y" }}
If my post is helpful, consider liking it -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com