The code in this article is considered a customisation. As such, it's outside the scope of our support service. Should you need assistance implementing the code, please feel free to contact us to request a consultation.  

The Aelia Currency Switcher provided several options to customise the display of prices, by setting custom currency symbol and adjusting their position. This article describes how to configure the plugin to achieve the desired appearance.


1. How to set custom currency symbols
The Aelia Currency Switcher allows to enter custom currency symbols and set their positions by going to WooCommerce > Currency Switcher. Example below:


Tip

In the Symbol column, it's possible to enter any text as the currency symbol. The easiest way to prevent confusion between currencies that have the same symbol, such as the "dollar" ones, is to enter a symbol such as USD$, AUD$, CAD$, or US$, AU$, CA$. This allows visitors to immediately identify the currency being used.


2. How to change the position of the currency symbols

The options listed in the Symbol Position column come from WooCommerce, which allows add the symbol before the price (position left) or after the price (position right). This feature works out of the box, and it's sufficient to choose the desired option and save the settings to apply it on the frontend.


3. How to append the currency code after the price

Out of the box, WooCommerce doesn't allow to show a currency symbol, or code, both before and after the price.  To implement that feature, it's necessary to use some custom code. 

The example below shows an example of a filter for hook woocommerce_get_price_html, which appends the active currency to the price displayed on the frontend.
add_filter('woocommerce_get_price_html', function($price_html, $product) {
  // Append the currency code to the price. When the currency symbol is configured to
  // appear on the left, the price will be displayed like "$10 USD"
  $html .= ' ' . get_woocommerce_currency();
  return $html;
}, 10, 2);


Tip

Rather than adding custom code to the site, it could be preferable to just add the currency code to the symbol, as described in section #1. That solution works out of the box, and it's a convenient way to quickly identify the currency being used.


4. Contact us if you have any questions

As indicated at the top of the article, all the code examples are provided on an "as is" basis, and they fall outside the scope of our support service. Although we won't be able to implement them for you, nor provide a guarantee that they will work, we will be happy to answer any questions you might have. You can simply contact us, and we will get back to you as soon as possible.


You can purchase the Currency Switcher from our online shop.