Open
Reported for: WooCommerce Multilingual & Multicurrency 4.12.6
Overview of the issue
Currently, it is not possible to save any changes in the Country availability of your Stripe settings when using WooCommerce Multilingual and WooCommerce Stripe Payment Gateway.
Our developers are aware of this situation. We reached out to the Stripe team and are still waiting for their reply.
Workaround
In the meantime, you can consider one of the following solutions:
1) If you want to limit Stripe to a single country (i.e. Spain) you can use the following code:
// Limit Stripe to Spain. add_filter( 'woocommerce_available_payment_gateways', function( $gateways ) { $country = WCML\MultiCurrency\Geolocation::getUserCountry(); if ( $country ) { if ( 'ES' !== $country ) { unset( $gateways['stripe'] ); } } return $gateways; } );
2) On the other hand, if you want to exclude a certain country, you can use this variation:
// Limit Stripe to all countries except Spain. add_filter( 'woocommerce_available_payment_gateways', function( $gateways ) { $country = WCML\MultiCurrency\Geolocation::getUserCountry(); if ( $country ) { if ( 'ES' === $country ) { unset( $gateways['stripe'] ); } } return $gateways; } );
You can add the above code to the functions.php file in your theme.
Don’t forget to adjust the country code to your needs (in both examples we use ‘ES’ for Spain).
Hello, please could you fix this problem? I perfectly understand that you suggested a trick to fix it, but we would prefer that you fix it definitely. Could you give us a deadline? Thanks a lot.
Hey there,
Unfortunately we can’t provide you a deadline but we totally understand your situation. We will update this erratum as soon as we have any news.
Thank you for your understanding.
Has there been any progress made for this?
Has there been made any progress on this issue?
Hello Majd,
This is already in our devs roadmap. However, we can’t provide you and ETA as it totally depends on theoir development board.
In the meantime, you can continue using the workaround.
We will keep this erratum updated.
Is it also possible to use this code for specific payment methods to use for a single country? For example, only use IDEAL for the Netherlands?
Hello Stan,
Yes, I guess that’s possible. In that case you would need to find the payment gateway key and select the right country.
Regards
Still no fix for this issue?
Hello @T4ng, the issue is still in progress. For now we recommend using the workaround from errata.
I can understand some issues are not top priorities, especially when you can provide a temporary fix.
However, from a client’s point of view, we’d like to keep our code as clean as possible, in order to prevent other issues coming from patches.
We can’t put bookmark on each of them, and agenda reminders to go and check from time to time if it’s been fixed.
Therefore, could you add a notification on issues, so that we can:
– subscribe to some the ones we’re interested in
– keep a list of which WPML issues we encountered
– be notified some of these get a proper fix
It would also be an interesting KPI for you, about’s what requires focus from your clients point of view.
Thanks
Hi there, thank you very much for your suggestion! I will forward it to our team.
Can we use some fix for multiple countries? All eu countries are only allowed for stripe sepa.
Trying second country doesn’t seem to work ex:
if ( ‘ES’ !== $country) {
unset( $gateways[‘stripe_sepa’] );
}
elseif ( ‘BG’ !== $country) {
unset( $gateways[‘stripe_sepa’] );
}
Hello Joanna,
This fix shouldn’t be necessary if you want to allow it for all the EU countries as this is needed only when you set it for a specific country.
If you are having a different issue, please open a chat in our assistance channel, in that way we can investigate it better.
Regards
Hi,
I think the new task will be a repetiotion of this. It’s the same problem I have as the topic here:
“WooCommerce Stripe Payment Gateway – “Country availability” changes are not saved”
but I’d like to be applied to more than one country please. I am open to solution where the country codes are added as an array or with switch/if logic etc.
I will gladly open a new task copying the same issue if needed.
Best,
Joanna
Thanks for your feedback, Joanna.
Yes, opening a chat in our assistance channel, in that way we can investigate it better.
Regards
Still no fix… ?!
Hello there,
This fix is planned to be publish in our next major release.
We will keep this link updated.
Regards