Very slow performance when adding multiple orderlines to cart
We have a order form with a list of products with input fields with a quantity, like:
Product A - Amount Product B - Amount Product C - Amount ...
The form has around 100 products at the moment
We use the HTML API to send these orderlines to the shoppingcart using the AddOrUpdateOrderLine form fields.
We send the entire form in one call back to the server. We use a smart javascript filter to only POST the orderlines which have an amount of 1 or higher.
This performs OK when we only fill in a couple or orderlines at a time. However, when we send a couple of more orderlines, say for instance 20, the POST to the FormPost.aspx call takes more than 15/20 seconds.
We tried using the javascript api and an AJAX form around the seperate orderlines, however that does not work smoothly either.
Why does this take so long to add these orderlines to the shoppingcart?
Just to clear a thing. The first case - do you ONLY use the HTML API? You say you use some javascript to only post lines that have more than 1. Try and JUST use the HTML API with one form and multiple AddOrUpdateOrderLines and see how that perform.
I am using only the HTML API yes. What i do in Javascript is something like this:
Product A - Amount -> 6 Product B - Amount -> 0 Product C - Amount -> 3
All 3 products have an AddOrUpdateOrderLine hidden field. To save some overhead I remove all hidden fields of Products which have a quantity of 0, so only the active products (with positive amounts) are being posted. The performance issue is really in the formpost.aspx call when I'm looking at the Network tab of the (Chrome) developer tools.
Could you try and send us how many AddOrUpdateOrderLine hidden fields you have that is posted and also its parameters and also the html where the property values are found. SO we can retest your case and see how we can performance update things. But FormPost just parses all the hidden fields and then invoke the methods.
Very slow performance when adding multiple orderlines to cart
We have a order form with a list of products with input fields with a quantity, like:
Product A - Amount
Product B - Amount
Product C - Amount
...
The form has around 100 products at the moment
We use the HTML API to send these orderlines to the shoppingcart using the AddOrUpdateOrderLine form fields.
We send the entire form in one call back to the server. We use a smart javascript filter to only POST the orderlines which have an amount of 1 or higher.
This performs OK when we only fill in a couple or orderlines at a time. However, when we send a couple of more orderlines, say for instance 20, the POST to the FormPost.aspx call takes more than 15/20 seconds.
We tried using the javascript api and an AJAX form around the seperate orderlines, however that does not work smoothly either.
Why does this take so long to add these orderlines to the shoppingcart?
Hi Rody
Just to clear a thing. The first case - do you ONLY use the HTML API? You say you use some javascript to only post lines that have more than 1. Try and JUST use the HTML API with one form and multiple AddOrUpdateOrderLines and see how that perform.
Kind regards
Anders
Hi Anders,
I am using only the HTML API yes. What i do in Javascript is something like this:
Product A - Amount -> 6
Product B - Amount -> 0
Product C - Amount -> 3
All 3 products have an AddOrUpdateOrderLine hidden field. To save some overhead I remove all hidden fields of Products which have a quantity of 0, so only the active products (with positive amounts) are being posted. The performance issue is really in the formpost.aspx call when I'm looking at the Network tab of the (Chrome) developer tools.
Could you try and send us how many AddOrUpdateOrderLine hidden fields you have that is posted and also its parameters and also the html where the property values are found. SO we can retest your case and see how we can performance update things. But FormPost just parses all the hidden fields and then invoke the methods.
Kind regards
Anders
sure, no problem.
I just tested it with 23 products, return from formpost.aspx was after 13 seconds.
The corresponding post fields are:
I will also send you a private link in the mail where you can test it on our development server.
Hello Anders,
I was wondering if you were able to replicate the problem with the links and info i have sent you?
is working on a reply...