PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

detect current selected language

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

Hi,

I have tried to implement switching currency with language change. However, this code did not work:

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’

 

I have been told that to forward the request to the currency plugin developer to find out a way to change the currency using javascript using this:

"You can check how to detect the current language here."

 

Please could you help?

Hello

Ok!

To switch currency in JS:

woocs_redirect(currency_code);

Hi Pablo,

Where would I add that line of code?

Hello

In the language switch event  OR  check current language on page load

In any case, you need custom JS code