How to Add a Custom Currency or Symbol in Woocommerce

Spread the love

You might be in a situation where you don’t see or have your desired currency in woocommerce currency lists. Don’t be panic! It is very simple. Infact, adding custom Currency in Woocommerce is quite easy.

 

How to Add a Custom Currency or Symbol in Woocommerce

For adding a custom currency please paste the following code in your theme functions.php file and swap out the currency code and symbol with your own. After doing so it will be available from WooCommerce settings.


add_filter( 'woocommerce_currencies', 'add_my_currency' );

function add_my_currency( $currencies ) {
$currencies['ABC'] = __( 'Currency name', '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;
}

I hope you enjoyed this simple tips. Lets woo with your e-commerce website. Please let me know about the article.


Spread the love

Submit a Comment

Must be required * marked fields.

:*
:*

Related Articles

Programming
Mizanur Rahaman Mizan

7Zip Command Tutorial

Spread the love

Spread the loveTo Install 7Zip in the VPS or in your linux: sudo apt-get install


Spread the love
Read more:
WordPress stylesheet with dynamic value

Passing some dynamic values to the stylesheet of WordPress using PHP, might be a great way to utilize custom values...

Cache Your WordPress Website For Faster Site Load Times

WordPress is a CMS that powers more than 60 million websites (According to the claim of WordPress.org), and it’s by...

Close