How to create cart subtotal-based conditional payments rule
You can show or hide payment methods, or add a fee, based on the cart subtotal. The current admin includes Cart Subtotal (Before Discount) and Cart Subtotal (After Discount) in the Cart Specific group.
Create the rule at WooCommerce > Settings > Payments > Conditions. For a subtotal that applies only to selected products, use Cart Subtotal (Specific Products) instead; that condition has its own article.
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 Cart Subtotal (Before Discount) or Cart Subtotal (After Discount), an operator such as Greater than ( > ), and an amount.
- In Actions, choose Enable Payments Methods, Disable Payments Method, or in Pro Add Payment Method Fee. Click Save Changes, then test checkout.
Pro Tips
- Use Cart Subtotal (Before Discount) when coupons should not reduce the amount the rule looks at, and Cart Subtotal (After Discount) when they should.
- The example screenshot shows the plural label Disable Payments Methods. This guide uses Disable Payments Method in the steps, matching the getting started article.
- You can combine a subtotal condition with a customer or product condition in the same rule.
Common Use Cases
1. Hide Cash on Delivery above a subtotal
Use Cart Subtotal (Before Discount) Greater than ( > ) 50 and Disable Payments Method for Cash on delivery, as in the example above.
2. Add a processing fee for a low subtotal (Pro)
Use Cart Subtotal (Before Discount) below a set amount with Add Payment Method Fee.
3. Hide a method for very high-value orders
Use a high Cart Subtotal (Before Discount) threshold with Disable Payments Method for a method you do not want on those orders.
FAQs
1. What is the difference between before and after discount?
Cart Subtotal (Before Discount) uses the product subtotal before discounts. Cart Subtotal (After Discount) uses the subtotal after coupon discounts are applied.
2. How is this different from Cart Subtotal (Specific Products)?
The before and after discount fields use the whole cart. Cart Subtotal (Specific Products) uses only the selected products, and needs a Product Specific condition as well.
3. Can I add a fee instead of hiding a method?
Yes, in Pro, with Add Payment Method Fee.