In this tutorial, we’ll show you how to disable payment gateways based on the country in WooCommerce. In this example, we will disable payment gateways by billing country, but you can use the same steps if you want to disable payment methods by shipping country.
Some reasons to restrict payment gateways based on the customer’s country:
- Your products are not allowed in a specific country.
- The payment gateway is not available in a country.
- You want to reduce the risk of credit card fraud from a specific country.
- Billing charges are too high for orders coming from a specific country.
- You don’t ship your products to some countries.
- Shipping costs are too high on specific countries.
Something important is that our method doesn’t require you to be a programmer in order to disable payment gateways by country.
We will use the WooCommerce Conditional Payment Gateways plugin.
This plugin allows you to restrict or allow payment methods in WooCommerce using several conditions like billing or shipping country, order total, product in cart, user details, etc.
Here are some examples:
- Allow a payment method by order total
- Disable a payment gateway for a specific product being purchased
- Disable a payment method for a specific country, etc.
You can download the plugin here:
Download WooCommerce Conditional Payment Gateways Plugin - or - Read more
After installing and activating the plugin, go to WooCommerce > Conditional Payment Gateways.
1- Create a new condition
To disable payment methods by country, you need to create a condition that states that the payment method is not available for specific countries.
For example, let’s say you want to disable a payment method for Afghanistan. Customers visiting your WooCommerce store from Afghanistan will not be able to use the payment method.
For this you need to add a new condition, so click on the Add condition button.
2- Disable WooCommerce payment gateways based on country
Now you need to select these values in order to disable or hide a specific payment method like Stripe or PayPal for specific countries:
- Enter the Condition title in the Add new condition field
- What happens when the conditions are met: Disable the payment method(s)
- Select the payment methods: Select the payment method you want to disable by country. In this case, we will select the Credit Card (Stripe) payment gateway. But you can select any of the payment methods you have on your WooCommerce store.
- Condition 1: Billing country = Afghanistan
- Note. You choose which countries won’t be able to use the selected payment gateway.
- Click Publish.
After publishing your condition, the payment gateways that have been restricted won’t be available for the selected countries.
This way you can reduce costs or fraud risks.
As you can see, the WooCommerce Conditional Payment Gateways plugin allows you to restrict payment gateways by country with a few clicks.
You don’t need to be a programmer to disable payment methods based on the country of the customer.
You just need to set up some easy conditions on your WooCommerce payment gateways.
If you want to learn more on how to use the plugin, you can read more tutorials by clicking here.
You can download the plugin here:
Download WooCommerce Conditional Payment Gateways Plugin - or - Read more