Skip to content
Advertisement

WooCommerce – change order status with php code

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.

JavaScript

Could anyone help me with this?

Advertisement

Answer

Try this code:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement