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.

WooCommerce Select Custom Currency - Indonesia Rupiah

WooCommerce Select Custom Currency - Indonesia Rupiah

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

Show Indonesia Rupiah currency for product price

Show Indonesia Rupiah currency for product price