Hi,
I have a question about `Shopify` global object on order status page. I need to use `Shopify.checkout` object to grab data about current order but i noticed two things :
1) `Shopify.checkout` is sometimes not presented at all
2) There is no documentation about this.
Maybe documentation is presented somewhere? Should i use liquid snippet instead to make sure everything order ?
Hello greg12,
You are usinf shopify or shopify plus?
In shopify we have no control of checkout page.
Okay.
Refer below link for more help:
https://help.shopify.com/en/themes/liquid/objects/checkout
Sounds like you might be running into this, from the documentation:
"the Shopify.Checkout.step and Shopify.Checkout.page [javascript] objects are only defined here the first time you land on the page; at this point, it’s a “Thank You” page. If the customer revisits or reloads the page, this “checkout” is converted to an “order”, and the page loads as an “Order Status” page. . .
Upon reload, both the Shopify.Checkout.step and Shopify.Checkout.page objects will return as undefined, while the Shopify.Checkout.OrderStatus will still show as an object"
Hey guys, I'm reopening the conversation as I found some discrepancies in what the Shopify.checkout shows on the thank you page (the first time it loads).
I'm using Javascript to send a JSON message to an affiliation platform on the thank you page. I use the Shopify.checkout object to read a few pieces of information about the order, like the amount, the detail (the lines), but my problem is with the order ID or the order number.
I explain: for now, I'm scrapping the HTML (via the class .os-order-number) which contains the order number of the order. As the Javascript Shopify.checkout does not contain the order number ... but only the order_id which is different.
Sometimes though, I'm having nothing in the os-order-number and also nothing in the Shopify.checkout.order_id ... but the amount is here and the detail is here also.
Why is the Thank you page is not showing any order number in some cases or does not even contain an order_id in the Shopify.checkout ?
In our experience, it's 2 to 3% of the orders.
Thanks for the help if you know anything about that.
Hey RemiLPE,
So I have found an answer I think. Basically, when Shopify is too busy with orders, they must have a queue or something, if the queue has not treated the order quick enough, Shopify will show the order page without the order number. Therefore, there's no Shopify.checkout.order_id value neither (null value). That is highly annoying, but unfortunately there seems to have no way to reach Shopify about this matter.
I know that's it's not a documented thing to use the Shopify.checkout object in the success page, but still, you'd expect consistent values in there.
So now, I know why it does that (or at least have a very high assumption) but I still don't know how to fix it.
If someone knows about the problem, is there a way to fix it?
User | Count |
---|---|
28 | |
7 | |
7 | |
6 | |
5 |