Switch currency with language change
-
Hi,
I’ve been trying to implement switching currency when the language is changed. I’ve used this code:
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’
Please could you help?
The page I need help with: [log in to see the link]
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Switch currency with language change’ is closed to new replies.