Skip to content

Instantly share code, notes, and snippets.

@dancameron
Forked from woogist/functions.php
Last active May 18, 2017 15:00
Show Gist options
  • Save dancameron/e55fe3b6e6f02e3f345996bede25876a to your computer and use it in GitHub Desktop.
Save dancameron/e55fe3b6e6f02e3f345996bede25876a to your computer and use it in GitHub Desktop.
Autocomplete all WooCommerce orders
/**
* Auto Complete all WooCommerce orders.
*/
add_action( 'woocommerce_thankyou', 'custom_woocommerce_auto_complete_order', 1 );
function custom_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