In Woocommerce, if you want sell in Australian or New Zealand dollars you only get the dollar symbol. The same goes if you want to sell in the more commonly used US dollars – there is no way to differentiate between them. Even if you’ve set Woocommerce up to sell in NZD it just displays as ‘$’ next to the price, not ‘NZ$’, so a user may not realise the currency the site is operating in.
If you would like to change this so that all references on your site more clearly indicate the currency you are selling in then here’s how you do this. You can add letters to the currency symbol so that it displays as “NZ$” instead of just “$” by placing the following code in your functions.php file.
- In the code below you need to change the text ‘ABC’ to the be currency code that you’re referring to, for example NZD.
- In the ‘Currency name’ you should write the name that you would like to display in the dropdown in the settings of Woocommerce where you set the currency.
- Where you see ‘$’ you should change this to whatever you wish to display instead, for example: ‘NZ$’
- Once you’ve included this in your functions.php file you then need to go into your Woocommerce settings and select the new options.
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; }