
When customizing an ecommerce store, you might not find any other platform that’s more flexible than WooCommerce. By default, WooCommerce comes with multiple currency options. However, you can add more currencies and their symbols to your store to improve your customer’s user experience.
This tutorial highlights the importance of a currency symbol and how to add a custom currency symbol in WooCommerce. Also, I will add a dummy currency with the name “Cloudways Currency” and use the symbol ‘CW$’ for my online store.
Importance of Custom Currency Symbol
You would like to add a custom currency symbol to your WooCommerce store because of the following reasons:
- It makes your store versatile, providing users with various currency options.
- Displaying the product prices in your customer’s local currencies creates familiarity and enhances their shopping experience.
- Customers can opt for a hassle-free method to select their preferred currency.
- It also increases conversion rates.
- It expands your reach to new regions without worrying about currency conversion.
Managed WooCommerce Hosting Starting from $10/month.
Create, manage, and customize your WooCommerce store with complete freedom.
Add Custom Currency in WooCommerce
You may add a custom currency and its symbol to your WooCommerce store by following the steps below:
- Go to your WooCommerce Dashboard > Appearance
- Select Theme File editor
- Open the functions.php, located in the theme folder.
- Add the following lines of code at the end of the file and save the file.
add_filter( 'woocommerce_currencies', 'add_cw_currency' ); function add_cw_currency( $cw_currency ) { $cw_currency['CLOUDWAYS'] = __( 'CLOUDWAYS CURRECY', 'woocommerce' ); return $cw_currency; } add_filter('woocommerce_currency_symbol', 'add_cw_currency_symbol', 10, 2); function add_cw_currency_symbol( $custom_currency_symbol, $custom_currency ) { switch( $custom_currency ) { case 'CLOUDWAYS': $custom_currency_symbol = 'CW$'; break; } return $custom_currency_symbol; }
Note: Refer to this section for the code’s explanation.
- Go to your WordPress dashboard.
- Navigate to the WooCommerce tab, and click Settings.
- Click the Currency drop-down under Currency Options; you will see the newly added custom currency at the end of the dropdown.
- Select the newly added currency from here and save the settings.
Validate Custom Code in WooCommerce
Here’s a breakdown of the code we used in the steps above. The following function adds a custom currency:
add_filter( 'woocommerce_currencies', 'add_cw_currency' ); function add_cw_currency( $cw_currency ) { $cw_currency['CLOUDWAYS'] = __( 'CLOUDWAYS CURRECY', 'woocommerce' ); return $cw_currency; }
- I have created a custom currency, i.e., Cloudways Currency, and it appears on the backend:
- The function below adds the currency symbol. And I have used CW$ as the currency symbol.
add_filter('woocommerce_currency_symbol', 'add_cw_currency_symbol', 10, 2); function add_cw_currency_symbol( $custom_currency_symbol, $custom_currency ) { switch( $custom_currency ) { case 'CLOUDWAYS': $custom_currency_symbol = 'CW$'; break; } return $custom_currency_symbol; }
- Go to the site’s front end, and refresh the page.
You will see the newly added custom currency being displayed on product pages.
Summary
This tutorial lists the steps to add custom currency and symbols to WooCommerce. The process is simple, and even a beginner can follow the steps to add a custom currency and its symbol to their stores.
The coding part involves adding a custom filter to the functions.php file. If you need further help with the topic, leave a comment below, and I will get back to you.
Frequently Asked Questions
Q. How do I add a custom currency and symbol in WooCommerce?
A. Follow the steps below to add a custom currency and symbol to your WooCommerce store:
- Go to your child’s theme function file or install a code snippets plugin
- Insert the following code snippet:
/** * Custom currency and currency symbol */ 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; }
Note: Don’t change your parent theme directly because it is risky. We recommend using a child theme for risk-free custom code integration.
Q. How do I set currency in WooCommerce?
A. Modify the currency settings by following the steps below:
- Go to WooCommerce Dashboard.
- Click Settings > General Tab.
- Look for the Currency options section.
- Select your custom currency symbol field.
Q. Can you have multiple currencies in WooCommerce?
A. Yes, WooCommerce has a Multi-Currency extension that allows you to switch currencies and re-calculate rates.
Also, you can use a multi-currency plugin such as WooCommerce Currency Switcher to add any type of currency to your WooCommerce store.
Owais Alam
is the WordPress Community Manager at Cloudways - A Managed WooCommerce Hosting Platform and a seasoned PHP developer. He loves to develop all sorts of websites on WordPress and is in love with WooCommerce in particular. You can email him at [email protected]