
- Adding custom currencies and symbols to your WooCommerce store enhances the customer experience by offering local currency options, potentially boosting conversions.
- This tutorial provides a step-by-step guide on how to add a custom currency and its symbol to your WooCommerce store using code snippets and clear instructions.
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 $11/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.
Experience Superior & Hands-Off WooCommerce Hosting with Autonomous
Keep your online store ready for all the unexpected traffic spikes with Cloudways Autonomous. Stay ahead of the curve with advanced scalability and cutting-edge technology.
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.
Q. How to add a custom currency symbol in WooCommerce?
A. To add a custom currency symbol in WooCommerce, use the woocommerce_currency_symbols filter in your theme’s functions.php file. Define your custom symbol and assign it to a currency code.
Q. How to get WooCommerce currency symbol?
A. You can get the currency symbol in WooCommerce using the
get_woocommerce_currency_symbol()
function. This function returns the symbol for the currency set in your WooCommerce settings.
Q. How do I change the currency in WooCommerce?
A. To change the currency in WooCommerce, go to WooCommerce > Settings > General, and select your desired currency from the “Currency” dropdown menu. Save changes to update the store’s currency.
Q. How do you add a currency symbol?
A. You can add a currency symbol by customizing the woocommerce_currency_symbols filter in the functions.php file. Assign the symbol to a specific currency code, and it will appear on your store.
Sarim Javaid
Sarim Javaid is a Sr. Content Marketing Manager at Cloudways, where his role involves shaping compelling narratives and strategic content. Skilled at crafting cohesive stories from a flurry of ideas, Sarim's writing is driven by curiosity and a deep fascination with Google's evolving algorithms. Beyond the professional sphere, he's a music and art admirer and an overly-excited person.