Created
January 22, 2018 14:36
-
-
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.
This file contains hidden or 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
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