Hi,
We are having issues deleting orderlines in our order flow. We wish to delete select orderlines when the user travels backwards through our flow, so that we can add new orderlines with correct quantities when the user chooses to move forward once again.
Thus, when the user moves backwards, we loop through GetLoop("OrderLines") and remove the specific orderlines using the following line:
order.OrderLines.RemoveLine(orderLine.GetString("Ecom:Order:OrderLine.Id"));
This successfully removes the line, as order.OrderLines.Count properly decreases for every line we remove. However, the line still remains somewhere behind the scenes, and will still exist in the cart if the page is refreshed or if the user moves forward through the flow again, causing doubles to be added. We are not sure which save-method to use, thus we have tried all three of these lines of code after removing our orderlines:
orderService.Save(orderService.GetOrder(GetString("Ecom:Order.ID")));
order.OrderLines.Save(GetString("Ecom:Order.ID"));
Dynamicweb.Ecommerce.Frontend.Cart.CartCatch.SaveCart();
It appears as though the order is not being saved properly. Are we using the wrong save-method(s)? We have looked through our cookies, but perhaps there is some DW cache-method that we need to run to save our changes to the order/cart?
Thanks!
Kind regards,
Jacob & Team