How to add a condition to a conditional payments rule

Conditions control when a Conditional Payments for WooCommerce rule applies. You add them on the Add Conditional Payments Rules form at WooCommerce > Settings > Payments > Conditions.

Each condition has a field, an operator such as Equal to ( = ), and a value. Click + Add Condition to add another condition to the same rule.

How to add conditions

  1. Go to WooCommerce > Settings > Payments, then open Conditions and click Add New, or open an existing rule.
  2. In Conditions, choose a condition field, an operator, and a value.
  3. Click + Add Condition if you need another condition, then continue to Actions and click Save Changes.

The three parts of a condition are the field (for example, Product, Cart Subtotal (Before Discount), or User Role), the operator (for example, Equal to ( = ) or Greater or Equal to), and the value (for example, a product, country, or quantity).

The Conditions section with a Product equal to Chaz Kangeroo Hoodie row, a Country equal to row, delete icons, and an Add Condition button
Figure - The Conditions section of a rule, with two conditions and Add Condition

Condition groups

In the current admin, conditions are grouped as follows:

  • Product Specific: Product, Variable Product, Product Categories, Product Brands, Product Tags, Product Type, Product Visibility, Product Quantity, Stock Status.
  • Cart Specific: Cart Subtotal (Before Discount), Cart Subtotal (After Discount), Cart Subtotal (Specific Products), Cart Quantity, Shipping Class, Coupon, Total Weight, Number Of Items, Total Volume.
  • Shipping Specific: Shipping Method.
  • Billing Address: First Name, Last Name, Company, Address, Address 2, Country, State / Province, City, Postcode, Email, Phone.
  • Customer: Logged in / out, User, User Role, Previous Order (the list continues below Previous Order in the dropdown).

Existing documentation screenshots also show a Shipping Address group (for example, First Name, Last Name, Company, Address, Address 2, Country, City, Postcode) and a Time Specific group (Day Of Week, Date, Time). Those groups are not visible in the current admin condition dropdown screenshot.

The Conditions dropdown open on a rule named Hide COD for Specific Product, showing Product Specific and Cart Specific options, with Shipping Specific visible at the bottom
Figure - An older Conditions dropdown showing Product Specific and Cart Specific options

The screenshot above is from an earlier plugin version. It does not yet list Product Brands or Cart Subtotal (Specific Products), which appear in the current admin dropdown.

Examples

Example 1: A billing country

Use Country with Equal to ( = ) and a country such as United Kingdom (UK).

A Country condition set to Equal to United Kingdom (UK), with an Add Condition button
Figure - A Country condition for the United Kingdom

Example 2: A specific product

Use Product with Equal to ( = ) and the product you want the rule to match.

A Product condition set to Equal to Frankie Sweatshirt, with an Add Condition button
Figure - A Product condition for Frankie Sweatshirt

Example 3: A cart quantity of 5 or more

Use Cart Quantity with Greater or Equal to and a value of 5. In the checkout example below, Cash on Delivery is hidden when the cart quantity is 5 or more.

A Cart Quantity condition set to Greater or Equal to 5, with an Add Condition button
Figure - A Cart Quantity condition of 5 or more
Checkout showing Chaz Kangeroo Hoodie times 6, Local pickup, Direct bank transfer and Check payments, with an annotation that COD is disabled when cart quantity is 5 or more
Figure - A checkout page with Cash on Delivery hidden for a cart quantity of 6

Pro Tips

  • Use the current group and field names when you build a rule, even if an older screenshot uses a shorter list.
  • You can add more than one condition with + Add Condition. The existing debug documentation describes rulesets where all conditions have to pass (AND).
  • After you save, test a matching cart and a non-matching cart at checkout.

FAQs

1. Where do I add a condition?

Open a rule at WooCommerce > Settings > Payments > Conditions. The Conditions section is on the Add Conditional Payments Rules form.

2. What does each condition row contain?

A condition field, an operator such as Equal to ( = ), and a value, plus a delete icon and + Add Condition.

3. Are time or shipping-address conditions still available?

Existing documentation screenshots show Time Specific and Shipping Address groups. Those groups are not visible in the current admin dropdown screenshot, so their current placement is unconfirmed.

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