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.

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).
The Actions dropdown open, listing Enable Payments Methods, Disable Payments Methods (selected), and Add Payment Method Fee, with Cash on delivery chosen and an Add Action button
Figure - The Actions dropdown, showing the three action types

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.

A rule with Product equal to Chaz Kangeroo Hoodie, Product Quantity less or equal to 5, a note that a Product Specific option is required, and Enable Payments Methods for Cash on delivery
Figure - An Enable Payments Methods action for Cash on delivery, based on product and product quantity

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).

A rule with User Role equal to Shop manager and Enable Payments Methods for Direct bank transfer and Cash on delivery
Figure - An Enable Payments Methods action for the Shop manager role

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.

A rule with Country equal to Australia and a Disable Payments Methods action for Check payments
Figure - A Disable Payments Methods action for Check payments in Australia
Checkout with Country / Region set to Australia, showing Direct bank transfer and Cash on delivery, with an annotation that Check payments is disabled for Australia
Figure - A checkout page for Australia with Check payments hidden

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.

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