• Resolved mshire

    (@mshire)


    Hi,

    I’ve been trying to implement switching currency when the language is changed. I’ve used this code:

    add_filter(‘wp_head’, function() { $lang = isset($_SERVER[‘HTTP_X_GT_LANG’]) ? $_SERVER[‘HTTP_X_GT_LANG’] : ”; global $WOOCS; switch ($lang) { case ‘fr_FR’: $WOOCS->set_currency(‘EUR’); break; case ‘en_GB’: $WOOCS->set_currency(‘GBP’); break; default: $WOOCS->set_currency(‘GBP’); break; } });

    I’ve even tried case ‘fr’ / case ‘en’

    Please could you help?

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author edo888

    (@edo888)

    Hi,

    In our free version the language change happens on the fly and no server side code is involved, so you will need to change the currency using javascript.

    You can check how to detect the current language here.

    Please forward the request to the currency plugin developer to find out a way to change the currency using javascript if you cannot figure it out yourself.

    The code you are using is specific to our paid version and you do not have it. If you decide to go with our paid option, then please use our live chat for support requests.

    Thanks! 🙂

Viewing 1 replies (of 1 total)

The topic ‘Switch currency with language change’ is closed to new replies.