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' );