int CSaleLocation::Add( array arFields );
The method Add adds a new location, optionally including the country and the city.
Parameter | Description |
---|---|
arFields | Associated array of the location parameters. The following keys are
possible:
|
Returns the new location ID on success, or false otherwise.
<? $arFields = array( "SORT" => 100, "COUNTRY_ID" => 0, "WITHOUT_CITY" => "N" ); $arCountry = array( "NAME" => "France", "SHORT_NAME" => "FR", "fr" => array( "LID" => "fr", "NAME" => "France", "SHORT_NAME" => "FR" ) "en" => array( "LID" => "en", "NAME" => "France", "SHORT_NAME" => "FR" ), ); $arFields["COUNTRY"] = $arCountry; $arCity = array( "NAME" => "Paris", "SHORT_NAME" => "Paris", "fr" => array( "LID" => "fr", "NAME" => "Paris", "SHORT_NAME" => "Paris" ), "en" => array( "LID" => "en", "NAME" => "Paris", "SHORT_NAME" => "Paris" ) ); $arFields["CITY"] = $arCity; $ID = CSaleLocation::Add($arFields); if (IntVal($ID)<=0) echo "Error adding location"; ?>
© 2001-2005 Bitrix | Bitrix Site Manager |