I'm working on a site that has recently migrated from Craft v2 with Commerce v1 to Craft v3 with Commerce v2.
Using Commerce v1 I was able to update the cart via Ajax and get a data object with the state of the cart as a response.
After updating to Craft Commerce v2 the ajax requests fail, returning
Status 302 - Redirect instead of the data object, although the changes to the cart are successful.
I can add one or more products or change their quantity via Ajax, however, I need the data object in order to properly update the state of the cart without reloading the page.
- I'm running Craft
v126.96.36.199with Craft Commerce from
1db58f6on a machine running PHP
- The action I'm using is
- The method of all requests is
- Any form data should to be ok since the cart updates succesfully
- All requests are sent with the following headers:
Content-Type: application/x-www-form-urlencoded; charset=UTF-8 X-Requested-With: XMLHttpRequest
I'm I missing anything new in CC2? Any help would be much appreciated.