0
votes

Is it possible to get the cart attributes on the Shopify order status ("") page and if so how?

On my Shopify store website I have some JavaScript which POSTs some JSON data to "/cart/update.js", with the data set to { attributes: {"MyLocalVar":1234} } which sets "MyLocalVar" in the cart attributes and is available elsewhere on my website when I GET from "/cart.js". What I would like to do now is to access "MyLocalVar" on the order status ("") page.

Does anyone know how I can do this?

An alternative would be to set "MyLocalVar" in the line item properties since that is available on the order status page, however I can't see how you can set this using the Shopify AJAX API.

1

1 Answers

1
votes

On the Shopify order status page there is a global checkout object that has the cart attributes.

To access, use checkout.attributes which is an array of the cart attributes.