I have followed this tutorial and to add a custom order status "Awaiting Shipment":
My problem is I'm trying to update the status via a php function, but it stays sets on pending payment! So it is executing and changing the correct order but not with this new status.
My code:
$order = new WC_Order($order_id);
$order->update_status('Awaiting shipment', 'order_note');
I can set 'Awaiting Shipment' in the WordPress dashboard ok...
What am I doing wrong?