In this article, I will show you how to add/register new order status in the WooCommerce. Here is an example to add Manufacture status in to the WooCommerce order status. Add this to your theme’s functions.php

function register_manufacture_order_status() {
    register_post_status( 'wc-manufacture', array(
        'label'                     => 'Manufacture',
        'public'                    => true,
        'exclude_from_search'       => false,
        'show_in_admin_all_list'    => true,
        'show_in_admin_status_list' => true,
        'label_count'               => _n_noop( 'Manufacture (%s)', 'Manufacture (%s)' )
    ) );
}
add_action( 'init', 'register_manufacture_order_status' );

// Add to list of WC Order statuses
function add_manufacture_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;
        $new_order_statuses['wc-manufacture'] = 'Manufacture';
    }

    return $new_order_statuses;
}
add_filter( 'wc_order_statuses', 'add_manufacture_to_order_statuses' );

You can change wc-manufacture and Manufacture into your custom status to register new order status in WooCommerce.

Have any doubt, then comment here!

Leave a Reply

Your email address will not be published. Required fields are marked *