During the set up of Orbisius e-store we've noticed that the product prices were displayed only with the dollar sign. It's always good to be as clear as possible that way there won't be any disappointed customers we've decided to explicitly show the currency code as well. This is also useful because some products can be shown in a different currency than the one configured in the settings. For example a store owner may want to show prices in EUR for European customers and the reset of the world can be in USD. Hosting companies have this practice. From business standpoint charging in EUR is good because it's usually higher than the USD and the businesses can make more money from purchases from European customers but let's keep that between me and you :).
The code snippet works for USD, CAD, NZD, AUD & EUR.
// source: https://orbisius.com/p4102 add_filter('woocommerce_currency_symbol', 'orb_wc_show_cur', 30, 2); function orb_wc_show_cur( $currency_symbol, $currency ) { switch( $currency ) { case 'USD': case 'CAD': case 'NZD': case 'AUD': $currency_symbol = $currency . ' $'; break; case 'EUR': $currency_symbol = '€ '; break; } return $currency_symbol; }
The currency code in this case is added before the price amount which makes a very simple solution.