Is there a way to dinamically access order id (when customer is placing order) without checkout extensions (without Shopify Plus plan basically)?
Hello @kurs
If you have access to the Shopify order ID on the thank you page, you can use either Shopify.checkout.order_id or window.Shopify.checkout.order_id to retrieve it. This ID can be obtained from the thank you page. Let me know if you need further clarification or assistance with anything else!
Hi, @Huptech-Web
Can I do this with theme extension?
Yes off course
How can I access only a thank you page using theme extension app embed block?
Should I place there an if statement with template.name or some similar object?
Thank you page isn’t available for customization in Shopify Editor as far as I can understand.
So I need to use app embed and not app blocks.
Also I don’t want the code to be embeded on the whole store, so I would like to limit that only to thank you page
In the Theme App extension, you need to specify conditions for particular pages. For instance, if you’re adding it to the thank you page, you should include a condition for the thank you page specifically. You can achieve this by adding a script tag. Alternatively, you can include a JavaScript file via a script tag, allowing for extensive customization
Unfortunately adding script (tested both body and head) in app embed works for all store pages besides checkout and thank you page.
I did that with web pixels and checkout_completed event (event.data.checkout.order.id)