Created
October 2, 2019 03:36
-
-
Save ncyhere/f6b0e792a13bf50250a96c9a99c7ea93 to your computer and use it in GitHub Desktop.
Auto Complete all WooCommerce 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
/** | |
* Auto Complete all WooCommerce orders. | |
*/ | |
add_action( 'woocommerce_thankyou', 'ncydesign_woocommerce_auto_complete_order' ); | |
function ncydesign_woocommerce_auto_complete_order( $order_id ) { | |
if ( ! $order_id ) { | |
return; | |
} | |
$order = wc_get_order( $order_id ); | |
$order->update_status( 'completed' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment