Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Automatically complete woocommerce orders when paid
// Automatically complete woocommerce orders on successful payment (skip "processing") - Robin Scott for SiliconDales.com
add_action( 'woocommerce_thankyou', 'sd_woocommerce_auto_complete_order' );
function sd_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
You can’t perform that action at this time.