How to create product quantity-based conditional payments rule
You can show or hide payment methods, or add a fee, based on the quantity of a specific product or the total quantity in the cart.
Create the rule at WooCommerce > Settings > Payments > Conditions. Use Product Quantity (in Product Specific) for a single product, and Cart Quantity (in Cart Specific) for the whole cart.
In The Article
How to create the rule
- Go to WooCommerce > Settings > Payments, then open Conditions and click Add New. Turn on Status and enter a Rule Name.
- In Conditions, choose Product Quantity or Cart Quantity, an operator, and a number. If you use Product Quantity, also add a Product Specific condition such as Product. The form shows a note that the quantity rule will only work if you have selected any one Product Specific option.
- In Actions, choose Enable Payments Methods, Disable Payments Method, or in Pro Add Payment Method Fee. Click Save Changes, then test checkout.
Pro Tips
- Always pair Product Quantity with a Product Specific condition such as Product. The red note on the form is required, not optional.
- Use Cart Quantity when the total units in the cart matter, regardless of which products they are.
- Number Of Items is a different cart condition. It counts line items, not total units.
Common Use Cases
1. Hide Cash on Delivery above a product quantity
Use Product Quantity Greater or Equal to 5 plus a Product condition, then Disable Payments Method for Cash on delivery, as in the example above.
2. Hide a method when the cart quantity is high
Use Cart Quantity with Disable Payments Method for a method you do not want on large-quantity orders.
3. Add a large-order fee (Pro)
Use Cart Quantity above your threshold with Add Payment Method Fee.
FAQs
1. What is the difference between Product Quantity and Cart Quantity?
Product Quantity is the quantity of a specific product and needs a Product Specific condition as well. Cart Quantity is the total quantity of all products in the cart.
2. Why is there a red note under Product Quantity?
The form says: “This rule will only work if you have selected any one Product Specific option.” Add a Product (or another Product Specific) condition to the same rule.
3. What does the example rule do?
It disables Cash on delivery when Product Quantity is 5 or more for Chaz Kangeroo Hoodie.