/cart/update.js on checkout

Markus4xD
Shopify Partner
21 0 1

Is there a way to POST /cart/update.js on checkout. I know it can be used at the cart page but doesn't seem to work on the checkout page. I just need a way to update the cart while on the checkout steps. Our shop has a Shopify Plus Plan.

 

Thanks!

0 Likes
Jason
Shopify Expert
10037 119 1873

Not all checkouts will have a cart in the first place so posting back there makes no sense. Do your checkouts have a cart or are they created via other channels - like Draft Orders? Depending on what step you're on would also impact what happens to the currency Checkout object.

 

What doesn't work? Do you get an error message? Got an example we can see?

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
Markus4xD
Shopify Partner
21 0 1

I'm trying to update the cart.attributes property on the checkout page.

 

On the cart page, I do this by running the javascript code using jQuery. 

$.post('/cart/update.js', { attributes : { "my-attribute": "my-attribute-value" } } );

 

On checkout page, I ran the code:

$.post('/cart/update.js', { attributes : { "my-attribute": "my-attribute-value-updated" } } );

The code does not update the "my-attribute" value. Is there any other way to change it? Or in some cases even delete it?

 

Thanks,

0 Likes
sadiesaurdiff
New Member
2 0 0

Having the exact same issue, would love to know if there is a solution. 

0 Likes
sadiesaurdiff
New Member
2 0 0

Try posting to /cart.js instead, that's working for me! Also, make sure if you are using jQuery in checkout that you are adding jQuery (it's not added by default). 

0 Likes