Knowledgebase Fix the WooCommerce Currency Symbol with WPML

Fix the WooCommerce Currency Symbol with WPML

WordPress, WPML, WooCommerce 46 Was this answer helpful? Print

By default, WooCommerce can show some currencies in their native script (for example د.ك instead of KD). This guide makes the currency symbol translatable so it shows correctly in each language.

You'll need: a WordPress site, the WooCommerce and WPML plugins, and ideally a child theme (so your change survives theme updates).

Currency showing the wrong symbol

Part 1 — Add the currency filter to your child theme

  1. Log in to your hosting control panel and open your website's File Manager.
  2. Go to httpdocs/wp-content/themes/your-theme-child/functions.php.

Open functions.php in File Manager

  1. Add the following below the existing child-theme code, changing KWD/KD to match your WooCommerce currency:
// 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;
}

Add the currency filter

  1. Save your changes.

Part 2 — Translate the symbol in WPML

  1. In WordPress admin, go to WPML → Theme and Plugins Localization.
  2. Tick your child theme under Strings in the themes and click Scan selected themes for strings.

Scan the child theme for strings

  1. Go to WPML → String Translation and search for the symbol you added (e.g. KD).

Find the currency string

  1. Click the + to translate it into your other language's symbol (it saves when you close the popup).
  2. Clear your website cache (important), then check your site — the currency now shows correctly in both languages.

Currency now correct in both languages

Was this answer helpful?

Related Articles