switch currency when language is switched
-
hello
i would like to switch currency when the language of the website is switched
is there a way to do it
i’ve tried this code and didn’t work for me//———–
`add_filter(‘wp_head’, function() {
$lang = get_locale();
global $WOOCS;
switch ($lang)
{
case ‘da_DK’:
$WOOCS->current_currency = ‘DKK’;
$WOOCS->storage->set_val(‘woocs_current_currency’, ‘DKK’);
break;
case ‘en_GB’:
$WOOCS->current_currency = ‘EUR’;
$WOOCS->storage->set_val(‘woocs_current_currency’, ‘EUR’);
break;
default:
$WOOCS->current_currency = ‘DKK’;
$WOOCS->storage->set_val(‘woocs_current_currency’, ‘DKK’);
break;
}
});
//——————thank you
The topic ‘switch currency when language is switched’ is closed to new replies.