You May Ask Why Should i Use a Custom Currency in WooCommerce? WooCommerce supports AED by default But When You Wanted to Use it, Your Prices will be like 1000 د.ا and not 1000 AED. if you need a custom currency unit—such as “AED” this guide will walk you through the process.
Table Of Contents
Adding a Custom Currency Unit in WooCommerce
If you want to modify WooCommerce settings, you’ll often need to make changes via custom coding. The easiest and most effective way is by adding a function to your theme’s files.
Even if you aren’t a developer, don’t worry! We’ve provided a simple WordPress function below that you can copy and use to add a custom currency unit to WooCommerce.
How to Add a Custom Currency Unit to WooCommerce
Add a Custom Currency
to add a custom currency follow these steps:
Open your theme’s functions.php file.
If your theme doesn’t have a functions.php file, create one inside your theme folder.
if you dont want to lose your codes after theme updates, you can use wordpress custom code plugins like “Koolak Custom Code Plugin” or WP Code
Make sure the code is placed between <?php and ?>.
Insert the following code into the functions.php file:
add_filter( 'woocommerce_currencies', 'add_my_currency' );
function add_my_currency( $currencies ) {
$currencies['ABC'] = __( 'AED', 'woocommerce' ); /// OR JUST 'AED';
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 = 'K AED'; break;
}
return $currency_symbol;
}
How This Code Works
The first function adds a new currency unit to WooCommerce (in this example, “AED”).
The second function assigns a currency symbol to it (e.g., “AED”).
Edit Existing Currency Symbol
for editing a custom currency you can use this code:
function add_my_currency_symbol( $currency_symbol, $currency ) {
switch( $currency ) {
case 'aed': $currency_symbol = 'AED'; break;
}
return $currency_symbol;
}
you can change aed to any other currencies to edit it’s symbol, for example use usd to edit US Dollars and etc…
Activating Your Custom Currency
After adding the code, follow these steps:
Go to WooCommerce → Settings → General.
Scroll down to the Currency Options section.
Select your newly added currency from the dropdown list.
In the Currency Position setting, choose Right with Space for better formatting.
Final Thoughts
By following this guide, you can easily add and configure a custom currency unit in WooCommerce, such as Thousand AED or Million AED. This customization helps improve user experience and enhances pricing psychology for better conversions.
If you found this tutorial helpful, check out our other WooCommerce guides for more advanced customizations! 🚀