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

Translatepress, I want Currency linked with 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 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;
}
});

 

So when I go to a language page eg /us/ its shows euro sometimes, i think its a cache thing , there is no need as the whole url and currency should always be the same.

Hello Ronan

Please paste your license key here - https://share.pluginus.net/image/i20230222134241.png -> https://share.pluginus.net/image/i20230222134511.png and  wp-admin access - https://share.pluginus.net/image/i20230222134615.png

Ok did it,

 

I have a test site and live site in the pivate area

 

I have the code above in the code snippets plugin on the site. see the cloudapp link.

so I want to link the currency with the locale

 

thank you.

Im getting this error below when I deactivate the fox currency. Im on php 8.2 maybe thats an issue other than that  its normal woocommerce.

There has been a critical error on this website.

Learn more about troubleshooting WordPress.

 

 

i fixed that error it was the code installed.

Hello

I checked on the test site, everything works fine

I pasted the code in functions.php - https://share.pluginus.net/image/i20231127115312.png - And the currency switches correctly (USD and EUR)