Not compatible with Woocommerce Currency Switcher
-
Hello,
I want to change my currency when changing any of the languages.
For example, the currency to be changed to Euro, when choosing German.
I’ve installed this plugin: WooCommerce Currency Switcher
And followed the steps for integrating gtranslate with their plugin.
Here you can see the article:
https://currency-switcher.com/switch-currency-with-language-change/
I worked with the code.
It is now implemented in the functions.php of my theme.Here is the code that I am using:
add_filter(‘wp_head’, function() {
$lang = isset($_SERVER[‘HTTPS_X_GT_LANG’]) ? $_SERVER[‘HTTPS_X_GT_LANG’] : ”;
global $WOOCS;
switch ($lang)
{
case ‘fr_FR’:
$WOOCS->set_currency(‘EUR’);
break;
case ‘en_EN’:
$WOOCS->set_currency(‘EUR’);
break;
case ‘de_DE’:
$WOOCS->set_currency(‘EUR’);
break;
default:
$WOOCS->set_currency(‘BGN’);
break;
}
});My default currency is BGN.
I have 3 other languages – french, german and english.
They all must use one currency – EURO.Talked to the support team of the other plugin (you can see the support answers here: https://www.ads-software.com/support/topic/change-currency-by-language-change-2/)
Can you help me with this?The page I need help with: [log in to see the link]
- The topic ‘Not compatible with Woocommerce Currency Switcher’ is closed to new replies.