I created a new order status in Woocommerce, but I need the status will be paid.
My code that creates a new status is:
add_filter( 'woocommerce_register_shop_order_post_statuses', 'bbloomer_register_custom_order_status' );
function bbloomer_register_custom_order_status( $order_statuses ){
// Status must start with "wc-"
$order_statuses['wc-custom-status'] = array(
'label' => _x( 'Aprobada', 'Order status', 'woocommerce' ),
'public' => false,
'exclude_from_search' => false,
'show_in_admin_all_list' => true,
'show_in_admin_status_list' => true,
'label_count' => _n_noop( 'Custom Status <span class="count">(%s)</span>', 'Aprobadas <span class="count">(%s)</span>', 'woocommerce' ),
);
return $order_statuses;
}
But I can´t put a paid status…
I found this code (in this thread):
if( $booking->get_status() != 'paid' )
$booking->update_status( 'paid', 'order_note' );
But I don´t know how integrate it. I need that a new status will be paid.