/* Register New Order Status WooCommerce */
function wpflt_register_shipped_order_status() {
register_post_status( 'wc-shipped', array(
'label' => 'Shipped',
'public' => true,
'exclude_from_search' => false,
'show_in_admin_all_list' => true,
'show_in_admin_status_list' => true,
'label_count' => _n_noop( 'Shipped (%s)', 'Shipped (%s)' )
) );
}
add_action( 'init', 'wpflt_register_shipped_order_status' );
// Add to list of WC Order statuses
function wpflt_add_shipped_to_order_statuses( $order_statuses ) {
$new_order_statuses = array();
// add new order status after processing
foreach ( $order_statuses as $key => $status ) {
$new_order_statuses[ $key ] = $status;
if ( 'wc-processing' === $key ) {
$new_order_statuses['wc-shipped'] = 'Shipped';
}
}
return $new_order_statuses;
}
add_filter( 'wc_order_statuses', 'wpflt_add_shipped_to_order_statuses' );
By default, there is no order status for shipped orders. Customer can only view their order status as completed or processing.
Most shop owners don’t update the status to ‘completed‘ until the product has reached the customer and they are satisfied. It is just like closing an online support ticket. Because, when an order is marked as completed, if you have enabled coupons, customers will receive them.
If customers want to return the product (or they are not satisfied), coupons once allotted cannot be disabled (can be done, but tedious task and waste of time). Hence it is better to update the status to ‘shipped‘ until the order is fully completed.
You can also register any other custom order status using the same code above by changing the word ‘shipped’ to ‘custom’ order status.