WooCommerce is a popular wordpress eCommerce plugin. It was built with great flexibility. Today i would like to share how to add custom currency and currency symbol to your woocommerce shop.
For example, i will add Indonesia Rupiah (Rp).
First, you need to open “functions.php” file in your theme, and place below code:
add_filter( 'woocommerce_currencies', 'add_custom_currency' ); function add_custom_currency( $currencies ) { $currencies["IDR"] = 'Indonesian Rupiah'; return $currencies; } add_filter('woocommerce_currency_symbol', 'add_custom_currency_symbol', 10, 2); function add_custom_currency_symbol( $currency_symbol, $currency ) { switch( $currency ) { case 'IDR': $currency_symbol = 'Rp'; break; } return $currency_symbol; }
Then you save the file, and you are ready to go.
For function add_custom_currency(), you can add any country currency code (refer to ISO 4217 Currency Codes) and update underlined line for below code:
$currencies[“IDR“] = ‘Indonesian Rupiah‘;
For function add_custom_currency_symbol(), you can update underlined line for below code:
case ‘IDR‘: $currency_symbol = ‘Rp‘; break;
If you go to the WooCommerce Settings panel and click General tab, you can select newly added currency.

After saved the settings, you can see updated view at live site.

Thank you, thank you, thank you so much. I was trying this since last two days and eventually I find your site. It worked like charm 😉
You are welcome, Pranjal 🙂 Glad my tips help you solved the problem.
Well done! Thank you for helping people to deal with the custom currency problem which is an important WooCommerce issue. I wrote a tutorial in my blog that deals with the same subject in details. I also found a way to enable Paypal with the new custom currency and to transform the amount before payment in a paypal supported currency. Check it out: http://devseon.com/en/wordpress-tutorials/woocommerce-add-a-paypal-unsupported-currency/
Hi Thorvic, glad you post another useful tutorial to deal with paypal. Cheers!
i have tried and tried and tried, i keep getting the following error :
Parse error: syntax error, unexpected T_FUNCTION in /hsphere/local/home/a895899/secretlilies.com/wp-content/themes/jarida/functions.php on line 87
i am using the jarida theme from them forest
Thank you very much for this post. It helped us.
I am getting error add_filter( ‘woocommerce_currencies’, ‘add_custom_currency’ ); on my website. Pls check http://gurulms.esy.es/
Hi
My website is still under development. I wish to change the symbol of the currency Indian Rupees from ‘Rs’ to the new symbol. In the code above I understand that we must hardcode the value of the symbol. I found this video which explained how to insert the symbol using API but I am not sure how to use it on woocommerce. Could you take a look ?
https://www.youtube.com/watch?v=JYxhRlVNZbU
Thanks ! its working 🙂
Thanks Terry! You are a “STAR”
The currency symbol was an issue for me as well.
Now solved with your code…cheers~
Hi Terry,
I tried to insert the custom currency and symbol but received this message: Parse error: syntax error, unexpected ‘3’ (T_LNUMBER) in /home1/mikemily/public_html/wp-content/themes/storefront/functions.php on line 20
How do I solve this problem? I can’t login to my website.
thank you it works very good,god bless you
I love this guy! It’s really working like magic!
Thanks
Thanks
Very helpful for me