getting liquid object checkout.order on additional scripts is unstable

Solved

getting liquid object checkout.order on additional scripts is unstable

kevinz
Shopify Partner
2 0 1

Hi,

 

Hope you are doing well.

 

I encounter an issue when I customize the Order Status page (Thank You page) using additional scripts.

 

Here is my scripts sample:

 

<script type="text/javascript">
console.log('{{checkout.order.gateway}}');

console.log('{{checkout.order.financial_status}}');

</script>

 

I have functions that depend on the order info.

 

https://shopify.dev/api/liquid/objects/checkout#checkout-order 

https://shopify.dev/api/liquid/objects/order 

 

So, I enabled a custom manual payment method and I processed to checkout with it.

However, on the Order Status page (Thank You page), most of time this liquid object "checkout.order" returns empty/null. Sometimes it returns correct result. 

 

How can I resolve this issue?

 

Please help! Thank you in advance!

Accepted Solution (1)

made4Uo
Shopify Partner
3845 717 1187

This is an accepted solution.

hi @kevinz

 

Based on what information you need, you should use the checkout.transactions, documentation here. Since checkout.order depends on payment provider. You can check the gateway and the financial status with checkout.transactions.

If this fixed your issue Likes and Accept as Solution is highly appreciated. Coffee tips fuels my dedication.
Get EXPERIENCED Shopify developers at affordable rates—visit Made4Uo.com for quick quote!
Do not lost your Shopify store! Get FREE trial with ✔️ Rewind Backup: Automatic, reliable, stress-free

View solution in original post

Replies 2 (2)

made4Uo
Shopify Partner
3845 717 1187

This is an accepted solution.

hi @kevinz

 

Based on what information you need, you should use the checkout.transactions, documentation here. Since checkout.order depends on payment provider. You can check the gateway and the financial status with checkout.transactions.

If this fixed your issue Likes and Accept as Solution is highly appreciated. Coffee tips fuels my dedication.
Get EXPERIENCED Shopify developers at affordable rates—visit Made4Uo.com for quick quote!
Do not lost your Shopify store! Get FREE trial with ✔️ Rewind Backup: Automatic, reliable, stress-free
kevinz
Shopify Partner
2 0 1

Thank you for the prompted answer!!!

 

Now I am using checkout.transactions[0].gateway_display_name and checkout.transactions[0].status to get the values.