Is it possible to skip/disable/catch the stock remove after checkout is done and complete?
I have a manual stock removal when I add a product to the cart and after checkout is done and complete it is removing the quantity from stock again:(
Is it possible to skip/disable/catch the stock remove after checkout is done and complete?
I have a manual stock removal when I add a product to the cart and after checkout is done and complete it is removing the quantity from stock again:(
Hi Yung
You cannot disable the stock level handling in DW - you can however subscribe to the Notifications.eCommerce.Stock.StatusChanged notification which is available when the stock level is changed by DW and revoke it from there...
I did this is in the CheckoutDoneOrderIsCompleteObserver and also worked:
private void CounterStockRemoval(Order order)
{
foreach (var orderLine in order.OrderLines)
{
orderLine.Product.Save();
}
}
When I do this, the stock is also staying the same amount.
Perfect, thanks for sharing.
You must be logged in to post in the forum