Skip to the content
Documentation

currency

No ratings yet

Summary

Fetches a currency object.

Usage

fetch( 'shop', 'currency',
       hash( 'code', code ) )

Parameters

Name Type Description Required
code string The three-character code of the target currency. Yes.

Returns

An ezcurrencydata object or FALSE.

Description

This function fetches the currency specified by the "code" parameter and returns it as an ezcurrencydata object. The function will return FALSE if the specified currency is unavailable.

Examples

Example 1

{def $code = 'EUR'}

{def $currency = fetch( 'shop', 'currency',
                          hash( 'code', $code ) )}

{if $currency}
     The currency symbol for EUR is {$currency.symbol}. <br />
{/if}

Outputs the currency symbol that is used for the "EUR" currency if available.

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.