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?
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.
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
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
Works a charm Anders :) Thanks for the quick response
Tom
is working on a reply...