+321 123 4567
info@test.com
  • Home
  • My Services
    • Web Design
    • Web Development
    • Technical Writing
  • Portfolio
  • My Thoughts
  • Free Tools
    • Photo Editor
    • Avatar Generator
    • Email Migration Tool
    • QR Code Generator
    • RSS to HTML Converter
    • IP Address Geolocation
    • Base64 Image Encoder
    • NATO Translator
    • All Tools
  • Contact
Home
Wordpress
How to Add Nigerian Naira and other Currencies to WooCommerce

How to Add Nigerian Naira and other Currencies to WooCommerce

Wale Adekile
December 7, 2013

WooCommerce transforms your WordPress blog to an online store with and I recently had to use it on a client’s website. Although it’s free and works great, there are lots of features you need to manually add through functions.php or find a plugin to do the job. One of such is the limited currencies available from the dashboard. The online store is based in Nigeria and it only makes sense to ensure the currency is in Naira.


woocommerce

In my search to find a solution, I stumbled across this code by Sean Barton. By editing this code you can add just about any currency to your store:

add_filter('woocommerce_currencies', 'sb_add_ngn_currency');
add_filter('woocommerce_currency_symbol', 'sb_add_ngn_currency_symbol', 10, 2);
function sb_add_ngn_currency($currencies) {
$currencies['NGN'] = __( 'Nigerian Naira (NGN)', 'woocommerce' );
return $currencies;
}
function sb_add_ngn_currency_symbol($currency_symbol, $currency) {
switch( $currency ) {
case 'NGN':
$currency_symbol = '₦';
break;
}
return $currency_symbol;
}

It’s easy to edit this code and there are just a few things to change to add your own custom currency. For example, to add the Vietnamese Dong, you should have this:

add_filter('woocommerce_currencies', 'sb_add_vnd_currency');
add_filter('woocommerce_currency_symbol', 'sb_add_vnd_currency_symbol', 10, 2);
function sb_add_ngn_currency($currencies) {
$currencies['VND'] = __( 'Vietnames Dong (VND)', 'woocommerce' );
return $currencies;
}
function sb_add_vnd_currency_symbol($currency_symbol, $currency) {
switch( $currency ) {
case 'VND':
$currency_symbol = '₫';
break;
}
return $currency_symbol;
}

For your currency code and exact symbol to use, you may check this page. You can change this to work the way you want and add any currency.


Previous Post
Tips for Taking Advantage of Google+ For SEO
Next Post
How to Enlarge Images and Retain Picture Quality
Wale Adekile
Husband to the world's most beautiful woman and father to two awesome kids. A nerd, obviously; also, a technical business analyst, a web designer who preaches the gospel of WordPress, and a writer. You can check out my published books on Amazon.
facebook embed
WebmastersWordpress

Fix: Facebook Post Embed not Working on WordPress

10 years ago
how to migrate, move, copy or export blog posts from blogger to wordpress
BloggerWordpress

Moving Your Blog From Blogger To WordPress Without Losing Traffic And SEO

14 years ago

Recent Articles

wahl rapic clip hair clipper
Wahl Rapid Clip Hair Clipper Review: DIY Made Easy
BenQ LaptopBar Review: Luxury or Necessity?
yunmai easepro unboxed
Yunmai EasePro Massage Gun Review
g20
Teendow G20 Robot Vacuum and Mop Review
bathroom
Dear Men, Spraying All Over the Toilet Seat is Disgusting and Irresponsible
winx mediatrans
How to Transfer Photos from iPhone to Computer Without iTunes
google workspace
How to Migrate Emails From Google Workspace/G Suite to cPanel
synology diskstation ds920+
Synology DiskStation DS920+ Review
playstation 4
Why I haven’t Upgraded to the PlayStation 5 Yet
pain
Started Watching Anime as an Adult? You’re Not Alone

All contents on this blog are copyright protected and cannot be reproduced on other websites without permission.

Copyright © 2022 – NerdieDad | Home | Contact | About | Privacy Policy