I am trying to change order status in WooCommerce, but I encountered no luck so far. $order instance is created successfully (I know it because echo $order->status;
works fine, $order_id is also correct. $order->status = 'pending';
simply doesn't change anything, I do not know why.
$order = new WC_Order($order_id);
$order->status = 'pending';
Could anyone help me with this?