Skip to content

Instantly share code, notes, and snippets.

@DanielSantoro
Created November 3, 2017 17:44
Show Gist options
  • Save DanielSantoro/0128bc8b17da54fc3b450926a22f3dcb to your computer and use it in GitHub Desktop.
Save DanielSantoro/0128bc8b17da54fc3b450926a22f3dcb to your computer and use it in GitHub Desktop.
Automatically set orders to Processing
/**
* 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