Copied to clipboard

Flag this post as spam?

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


  • Tom Steer 161 posts 596 karma points
    Aug 19, 2015 @ 13:37
    Tom Steer
    0

    Adding Multiple Products to the Basket

    Hey,

    I have a method which allows a user to re-order a previous order which is working great apart from when it is a large order (30+ items). I'm currently looping through the previous order and then using the TC.AddOrUpdateOrderLine method however with large orders this appears to take quite a long time to complete the entire order. I believe this is possibly because it does a db call each time. I was just wondering if there was a better approach to adding multiple orderlines in one call?

    Cheers,

    Tom

  • Anders Burla Johansen 2560 posts 8256 karma points
    Aug 20, 2015 @ 07:07
    Anders Burla Johansen
    100

    Hi Tom

    What if you do order.OrderLines.AddOrUpdate(...) and then at the end order.Save(). I think the problem is properly that Tc.AddOrUpdateOrderLine saves the order for each line that is added.

    Kind regards

    Anders

  • Tom Steer 161 posts 596 karma points
    Aug 20, 2015 @ 08:20
    Tom Steer
    0

    Works a charm Anders :) Thanks for the quick response

    Tom

Please Sign in or register to post replies

Write your reply to:

Draft