Preferred currency
Every visitor sees prices in one currency, the preferred currency. It is stored per user as the preference user_preferred_currency; a visitor who has not chosen one gets the default:
# settings/override/shop.ini.append.php [CurrencySettings] PreferredCurrency=EUR
The default must be a currency of the currency list, and an active one; otherwise prices cannot be shown in it and a warning is written to the debug output.
Letting visitors choose
The view shop/preferredcurrency shows the active currencies with a Set button; it posts to shop/setpreferredcurrency. Both need the policy shop/buy. A link can set it directly:
/shop/setpreferredcurrency/(currency)/NOK
In the administration the same choice is on Store > Preferred currency. Only active currencies are accepted.
Limits
- For anonymous visitors the preference lives in the session, so it is lost when the session ends.
Contributors
- Svitlana Shatokhina
- Rustam Commenter
- Graham Brookins Updated Maintainer
Comments (1 historical)
Written by readers of the earlier documentation sites, kept as they were.
setpreferredcurrency function in shop module
Rustam ·
Access denied when trying change preffered currency by anonymous user (don't have access to shop module). There is no appropriate function in shop module to grant access to shop/setpreferredcurrency for user.
Shop account handler - ezdefault.
eZ 3.8.6