May 4, 2025

Place Order Without Payment When Cart Total is Zero

In WooCommerce, there are cases where the cart total may be zero — for example, free products, sample giveaways, or 100% discounts from coupons. By default, WooCommerce still expects a payment method to be selected, which can cause issues if the selected gateway doesn’t support zero-amount transactions.

To allow orders to be placed without payment when the total is zero, you can use the following snippet. This will bypass the payment step and let customers place the order directly:

add_filter( 'woocommerce_cart_needs_payment', function( $need_payment, $cart ) {
    if ( $cart->get_total('edit') == 0 ) {
        $need_payment = false;
    }
    return $need_payment;
}, 10, 2 );

This method is useful for free orders and other custom workflows like booking systems or quote requests. Just adjust the logic as needed for your specific case.