Documentation

Update

int
CSaleLocationGroup::Update(
  int ID,
  array arFields
);

The method Update replaces parameters of the location group with the new ones.

Parameters

ParameterDescription
ID The location group ID.
arFields Associated array containing new parameters of the location group. In this array, the keys are the parameter names, and the values are the new values. The following keys are possible:
  • SORT - sort weight;
  • LOCATION_ID - array of location ID's that are members of this group;
  • LANG - array of language-dependent parameters of the group. Each entry of this array has the following format: array("LID"=>"parameter language", "NAME"=>"Group name")

Returned values

Returns the ID of the updated group on success or false otherwise.

Example


<?
$arFields = array(
   "SORT" => 150,
   "LOCATION_ID" => array(12, 34, 35, 36, 37),
   "LANG" => array(
      array("LID" => "en", "NAME" => "Group 1")
      array("LID" => "fr", "NAME" => "Groupe 1"),
   )
);

if (!CSaleLocationGroup::Update(2, $arFields))
   echo "Error updating a group";
?>
© «Bitrix24», 2001-2024
Up