This thread is resolved. Here is a description of the problem and solution.
Problem:
The client has an online store serving the GCC countries and is using WPML and WCML plugins to translate the store and provide products in local currencies. The issue is that WooCommerce only shows currency symbols in Arabic format, which is not professional, and the client wants to display custom currency symbols for both English and Arabic versions of the store.
Solution:
We recommended registering the currency symbol string to a text domain using the following code and replacing "your-domain-name-here" with a descriptive domain name:
add_filter("woocommerce_currency_symbol", "change_existing_currency_symbol", 10, 2); function change_existing_currency_symbol($currency_symbol, $currency) { switch ($currency) { case "AED": if (ICL_LANGUAGE_CODE == "en") { $currency_symbol = __("AED", "your-domain-name-here"); } else { $currency_symbol = __("درهم إماراتي", "your-domain-name-here"); } break; } return $currency_symbol; }
After adding the code to the theme's functions.php file, the client should scan the theme for strings and translate them. For more information, please refer to our documentation on enabling text translation for themes not compatible with WPML.
If this solution does not apply or is outdated, or if you encounter further issues, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If needed, please open a new support ticket in our support forum.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
This topic contains 1 reply, has 2 voices.
Last updated by 7 months, 3 weeks ago.
Assisted by: Mateus Getulio.