The Currency Switcher contains an extensive list of currencies, and an association between a country and the currency used in it. For example, all

countries in the Eurozone are associated to Euro, with the exception of United Kingdom, Sweden, Norway, Denmark and a few others. Depending on your setup, you may need to ensure that visitors from a country see prices in a specific currency, which may not match the one set by default in the Currency Switcher.


How to modify the default country/currency association list

You can change the currency associated with each country by implementing a custom filter. Below you can find a sample filter, which you can copy and adapt to your needs.

   

/**
 * Alters the currency associated with several countries.
 *
 * @param array country_currencies An array of country code => currency code pairs.
 * @return array
 */
function change_country_currencies($country_currencies) {
  // Set currency to Euro for Denmark, Finland, Norway, Sweden and Great Britain
  $country_currencies['DK'] = 'EUR';
  $country_currencies['FI'] = 'EUR';
  $country_currencies['NO'] = 'EUR';
  $country_currencies['SE'] = 'EUR';
  $country_currencies['GB'] = 'EUR';

  return $country_currencies;
}

add_filter('edd_aelia_currencyswitcher_country_currencies', 'change_country_currencies', 10, 1);

   

You can purchase the Currency Switcher from our online shop.