How to add an action to a conditional payments rule
Actions define what happens when a rule’s conditions are met. You can add one or more actions on the rule form, using + Add Action.
The current rule form and the documentation screenshots show three action types: Enable Payments Methods, Disable Payments Method, and Add Payment Method Fee. Some documentation screenshots use a plural Disable Payments Methods or a singular Enable Payments Method label. This guide uses the labels settled in the getting started article, and the figure captions describe the wording in each screenshot.
In The Article
Available actions
Open a rule at WooCommerce > Settings > Payments > Conditions. In Actions, choose an action and the payment method or methods it should affect:
- Enable Payments Methods: Show the selected methods when the conditions are met. If the rule has no conditions, this can apply storewide.
- Disable Payments Method: Hide the selected methods when the conditions are met, or storewide if no conditions are set.
- Add Payment Method Fee: Add a fee to a selected method, with a fee title, amount (fixed or percentage), and a tax class (Pro).
Examples
Example 1: Enable Cash on Delivery for a product quantity
The example below uses Product Equal to ( = ) Chaz Kangeroo Hoodie and Product Quantity Less or Equal to ( <= ) 5. A red note under Product Quantity says the rule will only work if you have selected any one Product Specific option. The action is Enable Payments Methods for Cash on delivery.
Example 2: Enable methods for a user role
Use User Role Equal to ( = ) a role such as Shop manager, then Enable Payments Methods for the methods that role should see (for example, Direct bank transfer and Cash on delivery).
Example 3: Disable Check payments for a country
Use Country Equal to ( = ) Australia and Disable Payments Method for Check payments. At checkout, Check payments is hidden when the billing country is Australia.
Pro Tips
- You can add more than one action with + Add Action, for example disabling some methods and enabling another in the same rule.
- Add Payment Method Fee is a Pro action. Choose the method, enter a fee title and amount, choose a fixed amount ($) or a percentage, and choose a tax class if needed.
- When a Product Quantity condition is used, add a Product Specific condition as well. The form shows a note that the quantity rule will only work if you have selected any one Product Specific option.
FAQs
1. How many actions can a rule have?
You can add one or more actions with + Add Action.
2. What are the action names?
This guide uses Enable Payments Methods, Disable Payments Method, and Add Payment Method Fee. Some documentation screenshots show Disable Payments Methods (plural) or Enable Payments Method (singular).
3. Do actions apply if I leave Conditions empty?
The existing guide says an enable or disable action without conditions can apply storewide. Confirm this in a test checkout before you use a rule with no conditions.