xxxxxxxxxx
<select id="order_status" name="order_status" >
<option value="wc-pending">Pending payment</option>
<option value="wc-processing">Processing</option>
<option value="wc-on-hold" selected="selected">On hold</option>
<option value="wc-completed">Completed</option>
<option value="wc-cancelled">Cancelled</option>
<option value="wc-refunded">Refunded</option>
<option value="wc-failed">Failed</option>
</select>
xxxxxxxxxx
// Get an instance of the WC_Order object (same as before)
$order = wc_get_order( $order_id );
$order_id = $order->get_id(); // Get the order ID
$parent_id = $order->get_parent_id(); // Get the parent order ID (for subscriptions…)
$user_id = $order->get_user_id(); // Get the costumer ID
$user = $order->get_user(); // Get the WP_User object
$order_status = $order->get_status(); // Get the order status (see the conditional method has_status() below)
$currency = $order->get_currency(); // Get the currency used
$payment_method = $order->get_payment_method(); // Get the payment method ID
$payment_title = $order->get_payment_method_title(); // Get the payment method title
$date_created = $order->get_date_created(); // Get date created (WC_DateTime object)
$date_modified = $order->get_date_modified(); // Get date modified (WC_DateTime object)
$billing_country = $order->get_billing_country(); // Customer billing country
// ... and so on ...
xxxxxxxxxx
$order = wc_get_order( $order_id );
if($order){
$order->update_status( 'pending', '', true );
}