When using Order Printer, there’s a “print date” displayed in the corner. How can I add an “order date” to the same area? I tried using this:
Order Date {{ order.created_at | date: “%m/%d/%y” }}
But that only displays the words “Order Date” and doesn’t show the date the order was created.
Odd. {{ order.created_at | date: “%m/%d/%y” }} seems to be working fine for me. Although I will mention that I actually thought this wasn’t working at first because I was testing it on orders that were placed today - I realized it was working properly when I tested it on an order placed in the past. Is it possible you’ve made the same mistake I did?
If it’s still not working, perhaps posting your entire template code would help to diagnose the issue.
I’ve heavily modified my default template, so I won’t post the whole thing, but this is the block that contains the order date:
- Order Date
{{ order.created_at | date: "%m/%d/%Y" }}
Well that’s certainly odd. I know I’m not completely insane at least because I’m using the code snipped I posted earlier in our own order printer template and it seems to be working fine for us:
Apologies. I’ve been so focused on that new disaster of an app that I just assumed you were talking about the new version. This is the code I was using for order date in my legacy template: “{{ date | date: “%m/%d/%Y” }}”
This ensures any delivery or ship date collected at checkout (stored via order.attributes) shows up on your printed invoices, order confirmation or packing slips.