How to create a product-specific conditional payments rule in WooCommerce

Product-specific rules let you show or hide payment methods based on what is in the cart. You pick a Product Specific condition, then choose the action that should apply at checkout.

Create the rule at WooCommerce > Settings > Payments > Conditions. In the current admin, the Product Specific group includes Product, Variable Product, Product Categories, Product Brands, Product Tags, Product Type, Product Visibility, Product Quantity, and Stock Status.

Benefits

Product-specific payment rules can help you:

  • Keep a payment method away from products that should not use it.
  • Limit a method to carts that contain only the products you approve.
  • Use different payment options for clearance, fragile, or high-value products without changing your gateway settings.

How to create the rule

Follow the steps below to add a product-specific rule.

Step 1: Add a new rule

Go to WooCommerce > Settings > Payments, then open Conditions and click Add New. Turn on the Status toggle and enter a Rule Name you will recognize later.

Step 2: Choose a product condition

In Conditions, add a Product Specific condition. You can use:

  • Product: selected products.
  • Variable Product: selected product variations.
  • Product Categories: selected categories.
  • Product Brands: selected brands (in the current admin; an older dropdown screenshot may omit this).
  • Product Tags: selected tags.
  • Product Type, Product Visibility, Product Quantity, or Stock Status.
The Conditions dropdown open on the Product Specific group, with Product selected, and Variable Product, Product Categories, Product Tags, Product Type, Product Visibility, Product Quantity, and Stock Status listed
Figure - An older Product Specific dropdown, which omits Product Brands

Step 3: Use the Only Equal to ( == ) operator

The existing guide and its screenshot show an Only Equal to ( == ) operator for Product (and describe it for Variable Product as well). Select that operator, then choose your products.

The rule matches when every item in the cart is one of the selected products. The cart does not need to contain all of them.

Selected products Cart contents Rule matches?
Hoodie, Cap, Mug Hoodie Yes
Hoodie, Cap, Mug Hoodie, Cap Yes
Hoodie, Cap, Mug Hoodie, Cap, Mug Yes
Hoodie, Cap, Mug Hoodie, Poster No
A Product condition with the Only Equal to ( == ) operator selected and Hoodie with Logo and Helena Hooded Fleece chosen
Figure - The Only Equal to ( == ) operator on a Product condition

The current admin screenshot used for the settings map shows Equal to ( = ) as the example operator and does not show the full operator list, so whether Only Equal to ( == ) still appears in the live dropdown is not confirmed in that screenshot. It is confirmed in this article’s screenshot.

Step 4: Add actions

In Actions, choose Enable Payments Methods or Disable Payments Method for the methods that should change when the condition is met. You can add more than one action with + Add Action.

A rule with Product Categories equal to Clearance, a Disable Payments Method action for Direct bank transfer and Check payments, and an Enable Payments Methods action for Cash on delivery
Figure - A category-based rule that enables only Cash on Delivery for the Clearance category

Step 5: Save and test

Click Save Changes, then add products to your cart and open checkout. Try one cart that should match and one that should not.

Checkout for Chaz Kangeroo Hoodie, annotated as Product category Clearance, showing only Cash on delivery, with a note to enable only COD for clearance items
Figure - A checkout page showing only Cash on Delivery for a Clearance product

Common Use Cases

1. Cash on Delivery for approved items only

If you offer Cash on Delivery only on a short list of products, use Only Equal to ( == ) with those products. A cart that also contains an item outside the list will not match.

2. Only allow Cash on Delivery for a clearance category

Use Product Categories Equal to ( = ) Clearance, disable the other methods, and enable Cash on delivery, as in the example above.

3. Block a method for a product tag

Use Product Tags with Disable Payments Method for a method you do not want to offer on products tagged as fragile.

4. Require a minimum product quantity

Use Product Quantity with a Product condition (the form notes that a Product Specific option is required), then Enable Payments Methods for a method such as Direct bank transfer.

Pro Tips

  • Use the current field names: Product (not “Specific Products”) and Variable Product (singular).
  • Product Brands is in the current Product Specific group, even if an older dropdown screenshot omits it.
  • The exact value lists for Product Type, Product Visibility, and Stock Status are not shown in the current settings-map screenshot, so this guide does not invent those values.

FAQs

1. Does the cart need to contain every product I selected?

No. With Only Equal to ( == ), the cart can hold any combination of your selected products. The condition stops matching when the cart includes a product you did not select.

2. Where can I use Only Equal to ( == )?

The existing guide says it is available for Product and Variable Product. The article screenshot shows it on a Product condition. The current settings-map screenshot does not show the operator list.

3. What happens if the cart has one product that is not on my list?

With Only Equal to ( == ), the condition does not match, so the rule’s actions do not apply to that cart.

4. Can I combine this with other conditions in the same rule?

Yes. Click + Add Condition to add another condition, and + Add Action to add another action.

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