Admin Dashboard

WooCommerce Automatically Update The Completed Order Status To Processing

Pre-Requisites

There are no pre-requisites in order for you to be able to implement this solution.

How To Implement This Solution?

Simply copy the pre-coded solution to your active theme’s functions.php or preferably the Code Snippets Plugin.

About This Solution

By default, only Virtual + Downloadable product orders move to the Completed order status automatically. This snippet looks at orders once created and if the order status is set to completed, will automatically and immediately revert it from Completed to Processing. You may wish to do this if you don’t have the Order Complete email turned on but do have activated the Customer Processing Order email.

/**
* Snippet Name:     Automatically update the Completed order status to Processing
* Snippet Author:   ecommercehints.com
*/

function ecommercehints_processing_status_for_virtual_downloadable_products( $order_id ) {
    if ( ! $order_id ) {
        return;
    }

    $order = wc_get_order( $order_id );
    if( 'completed'== $order->get_status() ) {
        $order->update_status( 'processing' );
    }
}
add_action( 'woocommerce_thankyou', 'ecommercehints_processing_status_for_virtual_downloadable_products' );

100 WooCommerce Conversion Rate Optimisation Tips

This field is for validation purposes and should be left unchanged.

Let’s collaborate!

Need to outsource WordPress development?

Join forces with UnlimitedWP for an outsourced white label web development service you can truly rely on.

First Timer Here?

Sign up to receive 20% off on your first month with us.

26027
WELCOME OFFER