• Resolved crobelus

    (@crobelus)


    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]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author edo888

    (@edo888)

    Hi,

    It doesn’t seem that you have our paid version for your website, however you are using HTTPS_X_GT_LANG, which is wrong, it is available only for paid version.

    Moreover the language codes in your switch are wrong, it should be ‘de’ instead of ‘de_DE’, etc.

    For the free version the translation process happens on the fly without page reload, I believe you should do a page reload in order to change the currency. If that is not the case and there is a way to change the currency on the fly, then you should use that instead.

    Thanks! ??

    Thread Starter crobelus

    (@crobelus)

    What is the price of the paid version ?
    Is it paid for and individual website or is it one time payment?
    At the moment, this is a test version of the website and will be moved to another domain name.
    If we get the paid version, will it work well with Woocommerce Currency Switcher and will it have the function I described with using the code I showed you (with ‘de’ insead of “de_DE”) ?
    I need a working solution and have no time to waste.

    Plugin Author edo888

    (@edo888)

    Hi,

    You can find more info about the paid version on https://gtranslate.io/#pricing

    It will not work with currency switcher out of the box, but it can be programmed. Your code is very close.

    Thanks! ??

    Thread Starter crobelus

    (@crobelus)

    Thank you for your answer.
    Unfortunately, we don’t have the resources and the time to hire a programmer to do it.
    So we need a ready solution for our website – plugin with the functionality we want or a plugin with ready additional code to add .
    Thank you for your time.

    Plugin Author edo888

    (@edo888)

    You are welcome! ??

    I would recommend to tie the currency to visitor’s geographic location and not the language, it would be more accurate.

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Not compatible with Woocommerce Currency Switcher’ is closed to new replies.