Quote from Ronan on November 24, 2023, 12:15
Hi
I have pro licence
I have setup translate press, I want to link the currency with the language because of cache etc.. its simpler just to have on UK site GBP and US is USD, I dont want on the fly switching as there is too much issues with cache. I have Euro as the default currency on the site.
I have a language switcher and it seems to work ok, when I switch the language.
I have reviewed the page: https://currency-switcher.com/search?s=translatepress
This is what I have done in the Fox control panel, is this right, is there anything else I can do?
I set the php session as the currency.
I have hid the floating currency switcher (i want to lock the currency to the language and dont want changeable currency)
I have turned off "I am using cache plugin on my site"
I have put this in functions:
add_filter('wp_head', function() {
$lang = get_locale();
global $WOOCS;
switch ($lang)
{
case 'en_US':
$WOOCS->set_currency('USD');
break;
case 'en_GB':
$WOOCS->set_currency('GBP');
break;
default:
$WOOCS->set_currency('EUR');
break;
}
});
Hi
I have pro licence
I have setup translate press, I want to link the currency with the language because of cache etc.. its simpler just to have on UK site GBP and US is USD, I dont want on the fly switching as there is too much issues with cache. I have Euro as the default currency on the site.
I have a language switcher and it seems to work ok, when I switch the language.
I have reviewed the page: https://currency-switcher.com/search?s=translatepress
This is what I have done in the Fox control panel, is this right, is there anything else I can do?
I set the php session as the currency.
I have hid the floating currency switcher (i want to lock the currency to the language and dont want changeable currency)
I have turned off "I am using cache plugin on my site"
I have put this in functions:
add_filter('wp_head', function() {
$lang = get_locale();
global $WOOCS;
switch ($lang)
{
case 'en_US':
$WOOCS->set_currency('USD');
break;
case 'en_GB':
$WOOCS->set_currency('GBP');
break;
default:
$WOOCS->set_currency('EUR');
break;
}
});