Created
November 3, 2017 17:44
-
-
Save DanielSantoro/0128bc8b17da54fc3b450926a22f3dcb to your computer and use it in GitHub Desktop.
Automatically set orders to Processing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Set all WooCommerce orders to Processing | |
* Based on https://docs.woocommerce.com/document/automatically-complete-orders/ | |
*/ | |
add_action( 'woocommerce_thankyou', 'custom_woocommerce_auto_complete_order' ); | |
function custom_woocommerce_auto_complete_order( $order_id ) { | |
if ( ! $order_id ) { | |
return; | |
} | |
$order = wc_get_order( $order_id ); | |
$order->update_status( 'processing' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment