Paypal & Stripe Currency Converter for WordPress with WooCommerce & WPML

Omar Kasem
2 min readApr 29, 2020

Do you want to show your WooCommerce store with a currency that’s not supported by Paypal and Stripe and also use them as payment gateways ?

And show your default currency on all the website except on the user goes to the checkout page ?

We will do that using the WPML & WooCommerce, here’s the plugins you will need to be installed to achieve that

  • WPML Multilingual CMS
  • WooCommerce
  • String Translation
  • Translation Management
  • WooCommerce Multilingual
  • WooCommerce Stripe

1- Add the new currency that you want customers to pay with and also set the exchange rate with the default currency, don’t worry you don’t have to show it in the frontend for the users

(AED is default currency and USD is the checkout currency)

2- We need to enable PayPal gateway in the website as it won’t be enabled because our default currency is not supported so add this snippet to solve this issue.

Change ‘AED’ with your default currency code.

add_filter( 'woocommerce_paypal_supported_currencies', 'wcc_add_new_paypal_currency' );       
function wcc_add_new_paypal_currency( $currencies ) {
array_push ( $currencies , 'AED' );
return $currencies;
}

3- Now we will have to show the default currency in the whole website except the checkout page, and we can do that with this snippet

Change ‘USD’ to your new currency

Change ‘AED’ to your default currency

add_filter('wcml_client_currency','wcc_change_currency_for_client');
function wcc_change_currency_for_client($client_currency){
if(is_checkout()){
$client_currency = 'USD'; //currency code
}else{
$client_currency = 'AED';
}
return $client_currency;
}

Now the issue is solved and all visitors and customers can now pay with PayPal and Stripe in your non supported currency store.

--

--