Adding ship date to customer order status screen

Highlighted
Excursionist
15 0 6

I am looking to add the expected ship date to the info on the customers' order stats screen.

<p><br>Your order is expected to ship between <span id="fromDate"></span> and <span id="toDate"></span>.</p>
{{ '//cdnjs.cloudflare.com/ajax/libs/datejs/1.0/date.min.js' | script_tag }}
<script>
var fromDate = Date.today().addDays(5);
if (fromDate.is().saturday() || fromDate.is().sunday()) {
fromDate = fromDate.next().monday();
}
var toDate = Date.today().addDays(7);
if (toDate.is().saturday() || toDate.is().sunday()) {
toDate = toDate.next().monday();
}
document.getElementById('fromDate').innerHTML = fromDate.toString('dddd MMMM dS');
document.getElementById('toDate').innerHTML = toDate.toString('dddd MMMM dS');
</script>

1. How do I change the date from

Date.today

to the date the order was placed?
I tried

order.created_at

, but of course it isn't THAT easy...


2. If I want to hide this code once and order is fulfilled, I assume I have to add something similar to this as well

{% if order.fulfillment_status== 'unfulfilled' %}
      Shopify.Checkout.OrderStatus.addContentBox(
       'INSERT JAVA CODE CALLING DATE HERE'
      )
    {% endif %}

Am I even remotely close???

0 Likes
Highlighted
Excursionist
15 0 6

bump?

0 Likes