Bitrix Site Manager

CCurrency::Add

string
CCurrency::Add(
 array arFields
);

The method Add is used to add a new currency. After the new currency is added, its language dependent parameters are to be set using the CCurrencyLang::Add method.

Parameters

ParameterDescription
arFields Associated array of the currency parameters in which keys are the parameter names and values are the parameter values.
The following parameter names are possible:
  • CURRENCY - the three character currency code (must be set);
  • AMOUNT_CNT - the number of currency units used by default to define the rate of exchange (for example, if CYP 10 equal to USD 21.58, 10 is the number of currency units);
  • AMOUNT - the default rate of exchange. (One of currencies within a site must equal to 1. Such currency is called a base currency. Other currencies are defined relative to the base currency;)
  • SORT - sort order;
  • DATE_UPDATE - the date that the record was last modified.

Return Values

The method returns the ID of the added currency on success, or false otherwise.

Example


<?
// Add a new currency "ISK"
$arFields = array(
   "CURRENCY" => "ISK",
   "AMOUNT" => 157.06,
   "AMOUNT_CNT" => 10000,
   "SORT" => 250
);
CCurrency::Add($arFields);
?>