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 3 replies, has 3 voices.

Last updated by peterH-72 4 years, 3 months ago.

Assigned support staff: Beda.

Author Posts
July 12, 2015 at 8:18 pm #657515

Kristin Gudmundsdottir

I am trying to: Change the currency symbol for danish krona and icelandic krona. Both have kr. but I need it to be ISK for icelandic krona and DKK for the danish one. Only having kr. can be confusing. Is this possible? I had found some code to change the symbol, but not for when you have two (or more) currencies.

URL of (my) website where problem appears: hidden link and hidden link

July 13, 2015 at 4:24 pm #658208

Beda
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch ) Italian (Italiano )

Thank you for contacting us here in the Support Forum

The information you need is already there, it is the Currency Code, instead of the Currency Symbol.

You can adjust your Currency Switcher in WPML > WooCommerce Multilingual > Currency switcher options

There you can create a Custom template, and using the %code% parameter in the template will display ISK and DKK instead of Kr. and kr.
https://wpml.org/documentation/related-projects/woocommerce-multilingual/multi-currency-support-woocommerce/

Please also see my screenshot in regard.

That above is for the Currency Switcher.

Now, if you want the Currency Symbol to change, beneath each Price, you could use this Function in your functions.php:
hidden link

add_filter('woocommerce_currency_symbol', 'change_existing_currency_symbol', 10, 2);

function change_existing_currency_symbol( $currency_symbol, $currency ) {
     switch( $currency ) {
          case 'ISK': $currency_symbol = 'ISK'; break;
	  case 'DKK': $currency_symbol = 'DKK'; break;
     }
     return $currency_symbol;
}

Above will display ISK and DKK beneath the Price instead of Kr. and kr.

Please let me know if you have further questions regarding the issue mentioned in this Thread
and let me know if the above solution works for you, I look forward to your reply!

Thank you

July 16, 2015 at 7:27 am #660343

Kristin Gudmundsdottir

Hi 🙂

Yes this was perfect.

Thanks
K

July 5, 2019 at 9:56 am #4150021

peterH-72

Thank you so much for this! Just what I need.
And don't forget you can also use a character as a symbol:

example from functions code:

case 'GBP': $currency_symbol = '£'; break;