update cart

Highlighted
New Member
3 0 0

Hi I'm using the Shopify Ajax API to add and remove a product on the cart. 

But the cart is not updated until I reload the page. There is a function or way to upload the cart automatically without reloading the page?

To Add:  /cart/add.js   sending id and quantity = 1

To Remove :  /cart/change.js   sending line and quantity=0

 

Thanks.

0 Likes
Highlighted
Shopify Partner
67 6 14

Hi @pampereyra welcome to the forums!

If you are on the Cart page, you can activate automatic cart updates, which might solve your problem?

From the Shopify Admin > Current Theme: Customise > From the top left, select Cart from the dropdown > From the left nav bar, select Cart page > Enable automatic cart updates

Hope this works for you!

Was this helpful? Press like!
Did it fix the problem? Mark it as the solution for others!
Buy me a beer? Well, sure!
0 Likes