Quote from bsiteagency on December 16, 2022, 19:39
Hi,
Recently, I was configuring new language versions on my website, so I decided to use your plugin so that the new languages would have the appropriate currencies for each other.
In the functions.php file, I put the following code recommended by you:
==================
add_filter('wp_head', function() {
$lang = get_locale();
global $WOOCS;
switch ($lang)
{
case 'en_GB':
$WOOCS->current_currency='EUR';
$WOOCS->storage->set_val('woocs_current_currency', 'EUR');
break;
case 'es_ES':
$WOOCS->current_currency='EUR';
$WOOCS->storage->set_val('woocs_current_currency', 'EUR');
break;
case 'pl_PL':
$WOOCS->current_currency='PLN';
$WOOCS->storage->set_val('woocs_current_currency', 'zł');
break;
default:
$WOOCS->set_currency('PLN');
break;
}
==================
But even so, the plugin incorrectly matches the currency to the language. Let me know what might be wrong.
Thank you in advance!
Hi,
Recently, I was configuring new language versions on my website, so I decided to use your plugin so that the new languages would have the appropriate currencies for each other.
In the functions.php file, I put the following code recommended by you:
==================
add_filter('wp_head', function() {
$lang = get_locale();
global $WOOCS;
switch ($lang)
{
case 'en_GB':
$WOOCS->current_currency='EUR';
$WOOCS->storage->set_val('woocs_current_currency', 'EUR');
break;
case 'es_ES':
$WOOCS->current_currency='EUR';
$WOOCS->storage->set_val('woocs_current_currency', 'EUR');
break;
case 'pl_PL':
$WOOCS->current_currency='PLN';
$WOOCS->storage->set_val('woocs_current_currency', 'zł');
break;
default:
$WOOCS->set_currency('PLN');
break;
}
==================
But even so, the plugin incorrectly matches the currency to the language. Let me know what might be wrong.
Thank you in advance!