In this tutorial, we’ll show you how to disable payment gateways based on the customer’s currency in WooCommerce.
WooCommerce allows us to enable several payment methods like direct bank transfer, check payment, cash on delivery, PayPal, credit cards (stripe), etc.
There are also multi-currency plugins that allow you to add multiple currencies for users to select their currency when buying products in your WooCommerce store.
The problem comes when you have several payment gateways available in the store but not all of them are applicable to all payment gateways.
For example, you may have cash on delivery, check payments, PayPal, and direct bank transfer available in your WooCommerce store, but want to disable the first two payment gateways for the Euro currency.
There are many reasons for this. For instance, you may want to avoid having to pay large amounts of taxes or big exchange rates.
That’s why in this tutorial we will show you how to easily disable payment methods based on the customer’s currency.
We will use the WooCommerce Conditional Payment Gateways plugin, which allows you to restrict payment methods by applying multiple conditions in WooCommerce.
You can download the plugin here:
This plugin is fully compatible with the following multi-currency plugins:
- WOOCS – WooCommerce Currency Switcher
- Currency Switcher for WooCommerce by WP Wham
- Multi Currency for WooCommerce
For this example, we’re using Multi Currency for WooCommerce, but you can use any of the other plugins and the steps will be the same.
Step 1. Create a new condition for your payment gateways
After installing the WooCommerce Conditional Payment Gateways plugin, you need to go to WooCommerce > Conditional Payment Methods in wp-admin to see the list of conditions.
Now you need to click “Add New Condition” to create a new condition that allows you to restrict payment methods based on the customer’s currency.
Note: It is important to mention that you must have previously configured the currencies using your preferred multi-currency plugin settings.
Step 2. Restrict payment gateways based on the customer’s currency
To restrict your payment gateways based on the customer’s currency, you need to select these values on the new condition:
- Add new condition: Enter the condition title
- What happens when the conditions are met: Disable the payment method(s)
- Select the payment methods: You need to choose the payment gateways you will disable. If the payment method you want to disable doesn’t appear in the list, tick the My gateway doesn’t appear in the list checkbox and add it manually.
- Conditions: Currency = EUR (for example)
- Publish the condition.
If you have more than two currencies, and you want to disable the selected payment gateways for more than one, you can click the Add ‘Or’ group button and add the other currency when creating the restriction condition. This way, the payment gateways will be disabled for all the selected currencies.
Make sure the Enable conditions checkbox is ticked at WooCommerce > Conditional Payment Methods. If this option is not marked, your conditions won’t apply.
Step 3. Verify that the condition is working correctly
To verify that the condition works correctly, you can open your store page in an incognito page or in another browser where you are not logged in to wp-admin. Add some products to the cart and go to the checkout page.
In our case, the four payment gateways we have enabled in the store are available without restrictions for the Dollar currency.
Users can select any currency on checkout.
However, if we change the currency from Dollar to Euro, we will notice that the “Cash on delivery” and “Direct bank transfer” payment methods are disabled.
Users can only select the “PayPal” and “Check payment” payment gateways when placing an order in our WooCommerce store.
That was really simple!
Restricting payment methods by currency is really easy and very useful. You can avoid having to pay large amounts of taxes or exchange rates if you disable specific payment methods for specific currencies.
You can download the plugin here: