Skip to content

Instantly share code, notes, and snippets.

@johnmccole
Created January 22, 2018 14:36
Show Gist options
  • Save johnmccole/04abfa8d57ac8a305f6d883774e95685 to your computer and use it in GitHub Desktop.
Save johnmccole/04abfa8d57ac8a305f6d883774e95685 to your computer and use it in GitHub Desktop.
Add auto-complete.php to the theme's functions.php to auto complete all 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