How to conditionally disable or hide specific payment methods

Using the Conditional Payments for WooCommerce plugin, you can configure specific payment gateways to disable/hide only when certain conditions are met. Follow these steps:

1. Access Conditional Payments Rules: Navigate to WooCommerce > Settings > Payments > Conditions and click the Add New button.

Admin: Add new rule

2. Activate and Name the Rule: Turn on the rule status and provide a descriptive name, such as "Disable COD for Country Not Equal to US."

Admin: Enable rule status and set rule name

3. Set Conditions: Define the conditions under which the payment method will be shown. For example:

  • Location-Based: Hide Cash on Delivery for country is not equal to US.
Admin: Set rule conditions

4. Add Disable Action: In the Actions section, select Disable Payment Methods and choose the gateway(s) to disable for the defined conditions.

Admin: Set rule actions

5. Save and Apply: Save your changes. The rule will now dynamically disable the specified payment method under the defined conditions.

Front: Checkout page with applied rule

📌 Example Use Case #1: Hide Cash on Delivery for International Customers

Set the condition "Shipping Country ≠ Your Local Country" and action "Disable Cash on Delivery" to ensure COD isn't available for international orders.

📌 Example Use Case #2: Restrict Credit Card Payments for High-Risk Products

For specific products like expensive electronics, set the condition "Product Category = Electronics" and disable "Credit Card" to reduce fraud risks.

📌 Example Use Case #3: Disable Bank Transfer for Small Orders

Create a rule with the condition "Cart Subtotal < $50" and disable "Direct Bank Transfer" to streamline low-value transactions.

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