No, Tea Commerce won't replenish stock values when an order is marked as canceled. If you wanted to achieve this, you'd need to hook into the events system, either the NotificationCenter.Order.PaymentStateChanged event to listen for a canceled payment or a NotificationCenter.Order.OrderStatusChanged to listen for an order being moved to the Canceled order status. From there, you'd need to check the order for the stock amounts to replenish and then call the product service to increase the stock levels for each item:
Update stock value when order status changed to cancelled
Is tea commerce inbuilt functionality updates stock value when a finalized order status is changed to cancelled from tea commerce backend?
I need to update back the order line quantity to current stock value when a order status is changed to cancelled.
If not how can we update the stock value?
Hi Vineeth,
No, Tea Commerce won't replenish stock values when an order is marked as canceled. If you wanted to achieve this, you'd need to hook into the events system, either the
NotificationCenter.Order.PaymentStateChanged
event to listen for a canceled payment or aNotificationCenter.Order.OrderStatusChanged
to listen for an order being moved to the Canceled order status. From there, you'd need to check the order for the stock amounts to replenish and then call the product service to increase the stock levels for each item:Hope this helps
Matt
is working on a reply...