WooCommerce – Automatically Complete Orders

/**
* Auto Complete all WooCommerce orders.
*/
add_action( ‘woocommerce_thankyou’, ‘bwt_woocommerce_auto_complete_order’ );
function bwt_woocommerce_auto_complete_order( $order_id ) {
if ( ! $order_id ) {
return;
}

$order = wc_get_order( $order_id );
$order->update_status( ‘completed’ );
}

Similar Posts