Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Rody 80 posts 280 karma points
    Feb 20, 2014 @ 14:02
    Rody
    0

    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? 

  • Anders Burla 2560 posts 8256 karma points
    Feb 24, 2014 @ 11:23
    Anders Burla
    0

    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

  • Rody 80 posts 280 karma points
    Feb 24, 2014 @ 11:28
    Rody
    0

    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. 

  • Anders Burla 2560 posts 8256 karma points
    Feb 24, 2014 @ 11:36
    Anders Burla
    0

    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

  • Rody 80 posts 280 karma points
    Feb 24, 2014 @ 11:58
    Rody
    0

    sure, no problem.

    I just tested it with 23 products, return from formpost.aspx was after 13 seconds. 

    The corresponding post fields are: 

    AddOrUpdateOrderLine:productIdentifier : productIdentifier-1767, quantity : quantity-1767, overwriteQuantity: overwriteQuantity, properties: properties-1767
    productIdentifier-1767:1767
    properties-1767:
    quantity-1767:2
    AddOrUpdateOrderLine:productIdentifier : productIdentifier-1768, quantity : quantity-1768, overwriteQuantity: overwriteQuantity, properties: properties-1768
    productIdentifier-1768:1768
    properties-1768:
    quantity-1768:1
    AddOrUpdateOrderLine:productIdentifier : productIdentifier-1884, quantity : quantity-1884, overwriteQuantity: overwriteQuantity, properties: properties-1884
    productIdentifier-1884:1884
    properties-1884:
    quantity-1884:2
    AddOrUpdateOrderLine:productIdentifier : productIdentifier-1885, quantity : quantity-1885, overwriteQuantity: overwriteQuantity, properties: properties-1885
    productIdentifier-1885:1885
    properties-1885:
    quantity-1885:1
    AddOrUpdateOrderLine:productIdentifier : productIdentifier-1886, quantity : quantity-1886, overwriteQuantity: overwriteQuantity, properties: properties-1886
    productIdentifier-1886:1886
    properties-1886:
    quantity-1886:2
    AddOrUpdateOrderLine:productIdentifier : productIdentifier-1887, quantity : quantity-1887, overwriteQuantity: overwriteQuantity, properties: properties-1887
    productIdentifier-1887:1887
    properties-1887:
    quantity-1887:1
    AddOrUpdateOrderLine:productIdentifier : productIdentifier-1888, quantity : quantity-1888, overwriteQuantity: overwriteQuantity, properties: properties-1888
    productIdentifier-1888:1888
    properties-1888:
    quantity-1888:2
    AddOrUpdateOrderLine:productIdentifier : productIdentifier-1889, quantity : quantity-1889, overwriteQuantity: overwriteQuantity, properties: properties-1889
    productIdentifier-1889:1889
    properties-1889:
    quantity-1889:1
    AddOrUpdateOrderLine:productIdentifier : productIdentifier-1890, quantity : quantity-1890, overwriteQuantity: overwriteQuantity, properties: properties-1890
    productIdentifier-1890:1890
    properties-1890:
    quantity-1890:2
    AddOrUpdateOrderLine:productIdentifier : productIdentifier-1891, quantity : quantity-1891, overwriteQuantity: overwriteQuantity, properties: properties-1891
    productIdentifier-1891:1891
    properties-1891:
    quantity-1891:1
    AddOrUpdateOrderLine:productIdentifier : productIdentifier-1892, quantity : quantity-1892, overwriteQuantity: overwriteQuantity, properties: properties-1892
    productIdentifier-1892:1892
    properties-1892:
    quantity-1892:2
    AddOrUpdateOrderLine:productIdentifier : productIdentifier-1894, quantity : quantity-1894, overwriteQuantity: overwriteQuantity, properties: properties-1894
    productIdentifier-1894:1894
    properties-1894:
    quantity-1894:1
    AddOrUpdateOrderLine:productIdentifier : productIdentifier-1895, quantity : quantity-1895, overwriteQuantity: overwriteQuantity, properties: properties-1895
    productIdentifier-1895:1895
    properties-1895:
    quantity-1895:2
    AddOrUpdateOrderLine:productIdentifier : productIdentifier-1896, quantity : quantity-1896, overwriteQuantity: overwriteQuantity, properties: properties-1896
    productIdentifier-1896:1896
    properties-1896:
    quantity-1896:1
    AddOrUpdateOrderLine:productIdentifier : productIdentifier-1897, quantity : quantity-1897, overwriteQuantity: overwriteQuantity, properties: properties-1897
    productIdentifier-1897:1897
    properties-1897:
    quantity-1897:2
    AddOrUpdateOrderLine:productIdentifier : productIdentifier-1898, quantity : quantity-1898, overwriteQuantity: overwriteQuantity, properties: properties-1898
    productIdentifier-1898:1898
    properties-1898:
    quantity-1898:1
    AddOrUpdateOrderLine:productIdentifier : productIdentifier-1899, quantity : quantity-1899, overwriteQuantity: overwriteQuantity, properties: properties-1899
    productIdentifier-1899:1899
    properties-1899:
    quantity-1899:2
    AddOrUpdateOrderLine:productIdentifier : productIdentifier-1900, quantity : quantity-1900, overwriteQuantity: overwriteQuantity, properties: properties-1900
    productIdentifier-1900:1900
    properties-1900:
    quantity-1900:1
    AddOrUpdateOrderLine:productIdentifier : productIdentifier-1901, quantity : quantity-1901, overwriteQuantity: overwriteQuantity, properties: properties-1901
    productIdentifier-1901:1901
    properties-1901:
    quantity-1901:2
    AddOrUpdateOrderLine:productIdentifier : productIdentifier-1902, quantity : quantity-1902, overwriteQuantity: overwriteQuantity, properties: properties-1902
    productIdentifier-1902:1902
    properties-1902:
    quantity-1902:1
    AddOrUpdateOrderLine:productIdentifier : productIdentifier-1903, quantity : quantity-1903, overwriteQuantity: overwriteQuantity, properties: properties-1903
    productIdentifier-1903:1903
    properties-1903:
    quantity-1903:2
    

    I will also send you a private link in the mail where you can test it on our development server. 

  • Rody 80 posts 280 karma points
    Mar 04, 2014 @ 11:43
    Rody
    0

    Hello Anders, 

    I was wondering if you were able to replicate the problem with the links and info i have sent you?

Please Sign in or register to post replies

Write your reply to:

Draft