Great question — answering as the UphillTech team:
To update order status on cancel status add_action('woocommerce_cancelled_order','change_status_to_refund', 10, 1); function change_status_to_refund($order_id) { $order = new WC_Order( $order_id ); $order->update_status('refund', 'order_note'); exit; } I hope it will help you. Thanks :)
Full answer by dineshkashera: https://stackoverflow.stackexchange.com/a/46708396 (CC BY-SA 4.0).
Need it done for your business? UphillTech.