Woocommerce : Indian Currency and symbol

I’ve been playing around with Woocommerce to create online retail stores. In the initial setup, you realise that Woocommerce doesn’t have Indian Currency and the new unicode symbol ₹ as an option.

To add this feature, you can do the following:

a. Find and edit the functions.php file of the Theme that is currently active.

b. Add the following code at the end:

 add_filter( 'woocommerce_currencies', 'add_my_currency' );
 
function add_my_currency( $currencies ) {
     $currencies['ABC'] = __( 'Indian Rupee (₹)', 'woocommerce' );
     return $currencies;
}
 
add_filter('woocommerce_currency_symbol', 'add_my_currency_symbol', 10, 2);
 
function add_my_currency_symbol( $currency_symbol, $currency ) {
     switch( $currency ) {
          case 'ABC': $currency_symbol = '₹ '; break;
     }
     return $currency_symbol;
}

c. Go  to WordPress Admin -> Woocommerce -> Settings and select the new Indian Rupee option that appears.

That should do it!

Leave a Reply

Your email address will not be published.


*