WooCommerce Custom Order Statuses

If you need Custom Order Statuses in WooCommerce, you can purchase a plugin from WooCommerce for $49 a year for the rest of your life, or you can add this code to the functions.php of your child WordPress theme

function register_awaiting_shipment_order_status() {
    register_post_status( 'wc-awaiting-shipment', array(
        'label'                     => 'Awaiting shipment',
        'public'                    => true,
        'exclude_from_search'       => false,
        'show_in_admin_all_list'    => true,
        'show_in_admin_status_list' => true,
        'label_count'               => _n_noop( 'Awaiting shipment <span class="count">(%s)</span>', 'Awaiting shipment <span class="count">(%s)</span>' )
    ) );
}
add_action( 'init', 'register_awaiting_shipment_order_status' );
// Add to list of WC Order statuses
function add_awaiting_shipment_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-awaiting-shipment'] = 'Awaiting shipment';
        }
    }
    return $new_order_statuses;
}
add_filter( 'wc_order_statuses', 'add_awaiting_shipment_to_order_statuses' );

Granted, the WooCommerce solution is infinitely more robust, but if you’re just needing some order statuses to keep track of things, this is the cleanest and quickest way to do it.

Source: https://stackoverflow.com/questions/53227402/adding-multiple-custom-order-statuses-in-woocommerce

FIX YOUR WEBSITES HEALTH

Results may vary. Some websites may require ongoing therapy.

Real websites, real recovery stories

SUCCESS STORIES

Lisa D.

Store Owner

My website was having performance anxiety. After a few optimization sessions, it's loading faster than ever and enjoys user interactions again.

Treated for:
Performance Depression

Hanna A.

Blog Owner

I thought my site's 404 errors were just a phase, but they helped me understand it was a deeper navigation issue. Now my users can find everything they need.

Treated for:
404 Anxiety Disorder

Robert R.

CEO

Our mobile responsiveness was all over the place. The therapy sessions really helped our site develop a consistent identity across all devices.

Treated for:
Mobile Identity Crisis