WooCommerce Custom Order Status “Processing”

Sometimes there is a need for a custom new order status for WooCommerce orders such as “Processing”, “Shipment Suspended On Holidays”, “Picked Up by Courier” and so on.

Below is the code snippet you may add to the bottom of theme functions.php for example “Processing” new order status. You may replace text “Processing” with your own custom order status label as well.

// Add custom WooCommerce order status - "Processing"
function tt_new_processing_order_status() {
    register_post_status( 'wc-processing', array(
            'label' => _x( 'Processing', 'Order Status', 'woocommerce' ),
            'public' => true,
            'exclude_from_search' => false,
            'show_in_all_admin_list' => true,
            'show_in_admin_status_list' => true,
            'label_count' => _n_noop( 'Processing <span class="count">(%s)</span>', 'Processing <span class="count">(%s)</span>', 'woocommerce' )
        )
    );
}
add_action( 'init', 'tt_new_processing_order_status' );


function tt_invoice_order_status( $order_statuses ){
    $order_statuses['wc-processing'] = _x( 'Processing', 'Order Status', 'woocommerce' );
    return $order_statuses;

}
add_filter( 'wc_order_statuses', 'tt_invoice_order_status' );


function tt_custom_in_bulk_actions() {
    global $post_type;

    if( 'shop_order' == $post_type ) {
        ?>
            <script type="text/javascript">
                jQuery(document).ready(function(){
                    jQuery('<option>').val('mark_processing').text('<?php _e( 'Change Status to Processing','woocommerce' ); ?>').appendTo("select[name='action']");
                    jQuery('<option>').val('mark_processing').text('<?php _e( 'Change Status to Processing','woocommerce' ); ?>').appendTo("select[name='action2']");
                });
            </script>
        <?php
    }
}
add_action( 'admin_footer', 'tt_custom_in_bulk_actions' );
terrytsang

Share
Published by
terrytsang

Recent Posts

Unveiling the Mystery: Why Do We Call It ‘Startup’?

1. The Origin and The Meaning of Startup The word "start" refers to the beginning…

2 years ago

Get More Done in Less Time: 13 Must-Have AI Tools for Skyrocketing Your Productivity

=== #1: AI Chatbot === 1. ChatGPTGet Started here: https://chat.openai.comChatGPT, one of the most significant language…

2 years ago

How to Add Dashicons to WordPress Frontend

Dashicons is the official icon font since WordPress admin as of 3.8. https://developer.wordpress.org/resource/dashicons/ However, it…

3 years ago

Coffee Chat with Founder of Hai Kuang

Recently I had a great coffee chat with my old pal - Wei Ming, founder…

3 years ago

Logo Design Ideas

Here is a list of logo branding ideas for your next business or startup:  …

3 years ago

Display Purchase Note in All WooCommerce Emails

Purchase Note from the Product Data will be displayed at the customer's new order which…

3 years ago