preferred_currency_code
Summary
Fetches the current user's preferred currency.
Usage
fetch( 'shop', 'preferred_currency_code' )
Returns
A three-character currency code or FALSE.
Description
This function fetches the preferred currency of the current user and returns a three-character currency code. A value for the preferred currency is taken from (sorted by priority ascending)
- shop.ini
- user's preferences
- session variable
The function will return FALSE if the preferred currency is not specified.
Examples
Example 1
{def $currency = fetch( 'shop', 'preferred_currency_code' )}
{if $currency}
Your preferred currency is {$currency}.
{else}
You should choose the preferred currency.
{/if}Outputs the currency code of the current user's preferred currency.
Contributors
- Svitlana Shatokhina Updated
Comments
Add a comment