Skip to content

Instantly share code, notes, and snippets.

@woogist
Created June 16, 2015 07:47
Show Gist options
  • Save woogist/10db35b4c5f45df25a7f to your computer and use it in GitHub Desktop.
Save woogist/10db35b4c5f45df25a7f 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' );
function custom_woocommerce_auto_complete_order( $order_id ) {
if ( ! $order_id ) {
return;
}
$order = wc_get_order( $order_id );
$order->update_status( 'completed' );
}
@AladinDridi
Copy link

Hello please i need help to make the order change completed just for the last order of any costumer , wish answer me soon , best regards , thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment