Caution: This documentation is for eZ Publish legacy, from version 3.x to 5.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.

currency_list

Summary

Fetches the available currencies.

Usage

fetch( 'shop', 'currency_list' [, hash( 'status', status )] )

Parameters

NameTypeDescriptionRequired
status string The status of the target currencies. No.

Returns

An array of ezcurrencydata objects or FALSE.

Description

This function fetches the available currencies and returns an array of ezcurrencydata objects. The resulting array starts with the most recently added currency. When the optional "status" parameter is used then only currencies with the specified status will be fetched.

Examples

Example 1

{def $currency_list = fetch( 'shop', 'currency_list' )}
{if count( $currency_list )}
    {foreach $currency_list as $Currency}
          {$Currency.code} <br />
    {/foreach}
{else}
    There are no currencies.
{/if}

Outputs the currency codes for all the available currencies.

Example 2

{def $currency_list = fetch( 'shop', 'currency_list', hash( 'status', 'active' ) )}
{if count( $currency_list )}
    The following currencies are active: <br />
    {foreach $currency_list as $Currency}
          {$Currency.code} <br />
    {/foreach}
{else}
    There are no active currencies.
{/if}

Outputs the currency codes for active currencies only.

Svitlana Shatokhina (05/05/2006 9:39 am)

Svitlana Shatokhina (05/05/2006 10:30 am)


Comments

There are no comments.