WPML - Currency Symbol Print

  • 3

Requirement:

- Wordpress Website

- Child Theme (Highly Recommended)

- Woocommerce Plugin

- WPML Plugin

 

Description:

Woocommerce currency symbol shows the original currency symbol rather than english (ex. د.ك instead of KD) while it suppose to show as following:

 

Solution:

Phase 1:

We highly recommend to use and activate a child theme so you will not loose the changes once you update your theme. In order to apply the fix and make your currency symbol translatable, apply the following:

1- Login to our web panel " Here " and go to your website status page


2- Click on Files on the top bar menu to go to the file manager page and navigate to httpdocs/wp-content/themes/Your Theme-child/functions.php

3- Open Functions.php by simply clicking on it and add the following code under the child theme default code if there is any and make sure to change KWD and KD to the currency symbol of your woocommerce settings page:

// Woocommerce Currency Fix
add_filter('woocommerce_currency_symbol', 'change_existing_currency_symbol', 10, 2);
function change_existing_currency_symbol( $currency_symbol, $currency ) {
switch( $currency ) {
case 'KWD': $currency_symbol = __( 'KD', 'woocommerce' ); break;
}
return $currency_symbol;
}

4- Save your changes

 

Phase 2:

1- Login to your wordpress admin page and navigate to WPML in menu then "Theme and Plugins Localization"

2- Select your Child Theme checkbox in the "Strings in the themes" and click on "Scan Selected Themes for String" to start scanning for new strings

3- Once Scan is completed and new string is been detected. Go to wordpress admin page and click on WPML then "String Translation"

4- Search for your the currency symbol you have added in Phase 1 (Our example is "KD") then click "Search For"

5- Translate the currency symbol by clicking the + sign to your local currency symbol then it will be saved by it self once you navigate away from the pop up.

6- Clear your website cache (Important)

7- Check your website as your currency should show the correct symbol in both languages


Was this answer helpful?

« Back