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' );
				
			
WooCommerce Conversion Rate Optimisation (CRO) eBook
100 WooCommerce Conversion Rate Optimisation Tips

Leave a Reply

If you are going to write code in the comments, please wrap it between code tags.

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

Other Recent Guides

Subscribe To Emails

Get exclusive WooCommerce tips that I only share with email subscribers

Join hundreds of other subscribers