Patrick's Programming Blog

Display Currency Code Infront of Symbol in WooCommerce

WooCommerce has a ton of options for multiple currencies right out of the box. WooCommerce comes bundled with dozens of different currencies you can use in your store, there are snippets to add extra currencies, there's also have a really nice Currency Converter Widget to help you display different currencies in your store.

By default WooCommerce will display the currency symbol with the product. You can do all sorts of things like choosing the position of the symbol (some currencies the symbol goes on the right of the number), you can change the decimal separator (some currencies prefer commas to decimal points), and you can change the number of decimal places (some currencies like Yen don't have decimals). We have docs for all of these settings.

This works great for 99% of the stores out there. There are a few exceptions that might require a couple snippets of code to display it exactly the way you want.

Duplicate Currency Symbols

Which dollar are we using?

One specific example is with currencies that share symbols. For example the Australian, New Zealand, Singapore, and the US all user the same dollar symbol: $. This isn't too big of an issue if you cater to a specific country or region but some users won't understand the difference until they see the bill, or if using PayPal they see the converted total.

Add Currency Code Before Symbol

A potential solution is to show the currency code before the symbol. This way there isn't any confusion about the currency. Go ahead and download this mini plugin and install it into your site.

You can do this with any currency. I just did it for US, Australian, & New Zealand dollars. You just need to enter your three letter currency code located in the get_woocommerce_currencies function.

You can easily see this is Australian Dollars

Exit mobile version