WPML:
- open functions.php of your current wp theme
- drop there next PHP code:12345678910111213141516add_filter('wp_head', function() {$lang = ICL_LANGUAGE_CODE;global $WOOCS;switch ($lang){case 'bg':$WOOCS->set_currency('BGN');break;case 'en':$WOOCS->set_currency('EUR');break;default:$WOOCS->set_currency('USD');break;}});
- See WPML docs about languages codes
Polylang:
- open functions.php of your current wp theme
- drop there next PHP code:12345678910111213141516add_filter('wp_head', function() {$lang = get_locale();global $WOOCS;switch ($lang){case 'bg_BG':$WOOCS->set_currency('BGN');break;case 'en_GB':$WOOCS->set_currency('EUR');break;default:$WOOCS->set_currency('USD');break;}});
- https://wordpress.org/support/topic/switch-currency-with-language-change-polylang/
- See Polylang docs about languages codes
GTranslate:
- open functions.php of your current wp theme
- drop there next PHP code:12345678910111213141516add_filter('wp_head', function() {$lang = isset($_SERVER['HTTP_X_GT_LANG']) ? $_SERVER['HTTP_X_GT_LANG'] : '';global $WOOCS;switch ($lang){case 'bg_BG':$WOOCS->set_currency('BGN');break;case 'en_GB':$WOOCS->set_currency('EUR');break;default:$WOOCS->set_currency('USD');break;}});
- https://wordpress.org/plugins/gtranslate/
qTranslate X integration:
- open functions.php of your current wp theme
- drop there next PHP code:1234567891011121314add_action('wp_head', function () {if (function_exists('qtranxf_getLanguage') AND class_exists('WOOCS')) {$lang = qtranxf_getLanguage();global $WOOCS;switch ($lang) {case 'bg': $WOOCS->set_currency('BGN');break;case 'en': $WOOCS->set_currency('EUR');break;default: $WOOCS->set_currency('USD');break;}}});
