Guides / WooCommerce
Disable cash on delivery for some postcodes or order totals in WooCommerce
Cash on delivery is popular with customers and risky for shops. A large order refused at the door, or a postcode your courier does not handle, can cost more than the sale. Here is how to limit it.
What WooCommerce does on its own
Open WooCommerce > Settings > Payments > Cash on delivery. You will find:
- Enable for shipping methods. Pick the shipping methods for which cash on delivery is available. If a customer chooses a different method, cash on delivery is not offered.
- Accept for virtual orders. Off by default, so digital-only orders are not offered it.
Because the shipping method is the lever, one workaround is to build shipping zones for the postcodes you serve and attach cash on delivery only to the methods in those zones. It works for places, but it is a roundabout way to write a payment rule.
What it cannot do
- Switch cash on delivery off above a certain order total.
- Switch it off for a customer who has no past orders with you.
- Switch it off for a specific product or category.
- Offer it only to certain customer roles.
The usual answer is a code snippet on the payment gateways filter. That works, but the snippet lives in a theme or helper plugin, and it breaks quietly when something changes.
Write the rule with Tadrik Checkout Rules
This is a Checkout Rules Pro feature ($49/year, 14-day trial without a card). Hiding cash on delivery by cart total, products, categories, role or country is in the free plugin. Rules by postcode, past orders, email and day and time are Pro.
Tadrik Checkout Rules lets you write each rule as a sentence under WooCommerce > Checkout Rules:
Other conditions you can combine: products, categories, shipping classes, coupon, customer role (guests included), country or state, items in the cart, weight, email or email domain (Pro), day and time (Pro), and the shipping method the customer picked. You can also do the reverse and offer only bank transfer to trade customers.
Check the rule on a sample cart
Use the Test a cart tab: pick a customer, an address and some products, and press Show me. You see every payment and shipping method, which rule hid each, and the reason, for example "cart total $320.00 is at least $300".
What if every payment method is hidden?
Then the plugin shows them all and warns you on its page, so a rule mistake never stops a sale. To refuse an order on purpose, use the rule type that stops the order with your own message.
The plugin works with both the block checkout and the classic checkout, and the payment list updates when the customer changes their address.
Common questions
Will the customer see an error? No. The hidden method is simply not in the list, so the customer picks from the methods that remain.
Can I do the same for other payment methods? Yes. The same sentence-style rule works for any payment method on your store, and for shipping methods.
Tadrik Checkout Rules
Hide cash on delivery by postcode, order total or customer, and check the result on a test cart first.
See Tadrik Checkout Rules