Wednesday, 19 August 2015

WooCommerce - Add Indian Rupee Symbol

Indian Government has launched its new currency symbol for Indian Rupee.

In WooCommerce we are not able to view our symbol and also many developers are not able to add it on their website.

If you are using WooCommerce for WordPress and want to add Indian Rupee Symbol in your website just follow the following steps.

STEP 1 : Open function.php file of your theme.

STEP 2: Add the following code in your function.php file and save it

<? 

/*** WooCommerce  Add Indian Currency by Bhushan Bagde ***/

add_filter( 'woocommerce_currencies', 'add_custom_currency' );

function add_custom_currency( $currencies ) {
$currencies["INR"] = 'Indian Rupee';
return $currencies;
}

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

function add_custom_currency_symbol( $currency_symbol, $currency ) {
switch( $currency ) {
case 'INR': $currency_symbol = '&#8377'; break;
}
return $currency_symbol;
}


?>

Now, goto WooCommerce > Settings > Select Indian Currency.

That's it.

Thank You

No comments:

Post a Comment