Posted on 24/08/2018 09:14:51
Hi Gaëtan
It is because there is a limit to how much data that can be put into a get request - and that is also why it was required to be a post.
I've asked the dev team to rollback this change you got - because it has to be a post. So you have to change your request to a post in order to make addmulti work. Rapido js Cart.UpdateCart uses a post, but all the data you send is in the querystring - that is what is causing this. So it has to be in the body of the request and not on the URL as qs parameters
So instead of this:
Cart.UpdateCart('miniCart', '/Default.aspx?ID=5&ProductLoopCounter1=1&ProductNumber1=10122&Quantity1=2&ProductLoopCounter2=2&ProductNumber2=30001&Quantity2=5', "&cartcmd=addmulti", false);
You have to do this:
Cart.UpdateCart('miniCart', '/Default.aspx?ID=5', "ProductLoopCounter1=1&ProductNumber1=10122&Quantity1=2&ProductLoopCounter2=2&ProductNumber2=30001&Quantity2=5&cartcmd=addmulti", false);
and change the cart.js from this (or probably better make an overload):
xhr.open('POST', url + command + "&feedtype=Counter");
xhr.onreadystatechange = function () {...};
xhr.send();
to this:
xhr.open('POST', url + "&feedtype=Counter");
xhr.onreadystatechange = function () {...};
xhr.send(command);
Code not tested - but the essense is there...
Sorry about the confusion and inconvenience.