# Cart updating with Ajax

**URL:** <https://forum.modmore.com/t/cart-updating-with-ajax/379>\
**Category:** SimpleCart\
**Created:** [August 6, 2016, 10:06pm UTC](https://forum.modmore.com/t/cart-updating-with-ajax/379 "2016-08-06T22:06:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aschojz](https://forum.modmore.com/letter_avatar_proxy/v4/letter/a/f9ae1b/32.png) [@aschojz](https://forum.modmore.com/u/aschojz)\
**Post date:** [August 6, 2016, 10:06pm UTC](https://forum.modmore.com/t/cart-updating-with-ajax/379/1 "2016-08-06T22:06:41Z")

</div>

For my design and the user experience I want to update my cart with ajax. Is it possible? And if yes, how can I achieve this?  
What the User should do: click the button “Add to Cart” and just the snippet with the cart updates.  
Thanks in advance!

---

<div class="post-metadata">

**Author:** ![mhamstra](https://forum.modmore.com/user_avatar/forum.modmore.com/mhamstra/32/459_2.png) [@mhamstra](https://forum.modmore.com/u/mhamstra)\
**Post date:** [August 9, 2016, 1:02pm UTC](https://forum.modmore.com/t/cart-updating-with-ajax/379/2 "2016-08-09T13:02:21Z")

</div>

It is possible to use AJAX. The suggested way is to progressively enhance the form you’re looking to post via ajax, so non-js users still get the proper behaviour.

When you’ve got it posting via ajax, you might notice that SimpleCart doesn’t return a structured response, it just redirects the request to the cart page again. Unfortunately I don’t think there’s a way around that presently, so you might need to refresh the page after the ajax submit is complete to have the cart show as updated.
