How to create shipping method-based conditional payments rule

You can show or hide payment methods based on the shipping method the customer selects at checkout. In the current admin, Shipping Method is the field in the Shipping Specific group.

Create the rule at WooCommerce > Settings > Payments > Conditions.

How to create the rule

  1. Go to WooCommerce > Settings > Payments, then open Conditions and click Add New. Turn on Status and enter a Rule Name.
  2. In Conditions, choose Shipping Method, an operator such as Equal to ( = ), and the shipping method or methods (for example, US Zone - Express Delivery).
  3. In Actions, choose Enable Payments Methods, Disable Payments Method, or in Pro Add Payment Method Fee. Click Save Changes, then test checkout with each shipping method you care about.
The Conditions dropdown open on the Shipping Specific group, with Shipping Method selected, and Billing Address fields visible below
Figure - The Shipping Specific group, with Shipping Method
A Shipping Method condition set to Equal to US Zone - Express Delivery, with a Disable Payments Method action for Cash on delivery
Figure - A rule that disables Cash on Delivery for Express Delivery
Checkout with Express Delivery selected, showing Direct bank transfer and Check payments, with an annotation that COD is disabled because Express Delivery is selected
Figure - A checkout page with Cash on Delivery hidden when Express Delivery is selected

Pro Tips

  • Select the exact shipping method name that WooCommerce shows at checkout.
  • Test every shipping option the customer can choose, including free shipping and local pickup if you use them.
  • Shipping Method is different from a shipping address field. Address fields are in Billing Address (and, in older screenshots, a Shipping Address group).

Common Use Cases

1. Hide Cash on Delivery for express shipping

Use Shipping Method Equal to ( = ) your express method and Disable Payments Method for Cash on delivery, as in the example above.

2. Enable PayPal for free shipping

Use Shipping Method Equal to ( = ) Free Shipping and Enable Payments Methods for PayPal.

3. Add a fee for economy shipping (Pro)

Use Shipping Method with Add Payment Method Fee when the customer selects your economy method.

FAQs

1. Which condition do I use?

Shipping Method, in the Shipping Specific group.

2. What does the example rule do?

It disables Cash on delivery when Shipping Method is US Zone - Express Delivery.

3. Can I add a fee based on the shipping method?

Yes, in Pro, with Add Payment Method Fee.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.