Currently when the order status changes to cancelled the stock of the products is increased.
I would like to disable the stock increase when the new status is cancelled but only for some previous order status (not all).
For example, when the status changes:
- From
processingtocancelled: Do not increase stock - From
shippedtocancelled: Do not increase stock - From
other-statustocancelled: Increase the stock - From
cancelledtoprocessing: Decrease the stock
So far I have tried this:
- Disabling Auto Restocking for Cancelled Orders
- Get last old order status before updated status in Woocommerce
- Reduce stock only for specific order statuses and payment method in Woocommerce
I tried remove_action with the wc_increase_stock_levels function but it's not working for me. Where am I doing wrong?