Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 2 replies, has 2 voices.

Last updated by Bruno 3 years, 11 months ago.

Assigned support staff: Arvish Mungur.

Author Posts
May 10, 2017 at 5:28 pm #1273107


I am trying to:
Disable or hide a checkout method (or a so-called payment gateway) depending on the currency choosen by the customer.

Is there a nice way to do it ? Does this method is still relevant:

Many thanks.

May 11, 2017 at 8:40 am #1273549

Arvish Mungur

Hello Bruno,

Thank you for contacting WPML support.

I will be happy to help with your issue.

To remove payment gateways based on currency, you can essentially use the same code as follows:

Modify as required and add the following to your theme’s functions.php

add_filter( 'woocommerce_available_payment_gateways', 'hide_gateways' );

function hide_gateways( $gateways ) {
global $woocommerce_wpml;
$get_current_currency_wcml = new WCML_Multi_Currency();
$get_current_currency = $get_current_currency_wcml->get_client_currency();
if( $get_current_currency == 'ABC' ){
//disable gateway paypal if currency is ABC
unset( $gateways['paypal'] );

} elseif( $get_current_currency == 'XYZ' ){

//disable gateway blabla if currency is XYZ
unset( $gateways['blabla'] );

//otherwise disable gateway humdidum
unset( $gateways['humdidum'] );

return $gateways;

Please let me know if this works.

Kind regards

May 11, 2017 at 10:02 am #1273665


Hi Arvish,
I knew that would be very easy to help me 😉
Thank you very much, that works perfectly.
Best regards