Automatically set orders to Complete from Processing in Woocommerce

/**
 * 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' );
}
No Comments

Sorry, the comment form is closed at this time.