Bitrix Site Manager

CCatalogGroup::Update

bool
CCatalogGroup::Update(
 int ID, 
 array arFields
);

The method Update is used to update information on the price type identified by the ID. The parameter arFields contain new values of the updated price type. This method can update both all the language-dependent and independent parameters. Additionally, you can specify user groups allowed to view and purchase products at prices of this type. 

Parameters

ParameterDescription
ID The ID of the price type to be updated.
arFields Associated array with the parameters of the updated price type. In this array, keys are the parameters names. The following key names are allowed.
  • NAME - internal name of the price type;
  • SORT - sort weight;
  • USER_GROUP - array with the ID's of user groups that are allowed to view prices of this type;
  • USER_GROUP_BUY - array with the ID's of user groups that are allowed to purchase items at prices of this type;
  • USER_LANG - array with the language-dependent parameters of the price type. Keys in this array are the language ID's, and values are names of the price type in the corresponding language.

Return Values

Returns True on success or False otherwise.

Example



<?
$arFields = array(
   "NAME" => "retail",
   "SORT" => 100,
   "USER_GROUP" => array(2, 4),   // allow members of groups 2 and 4 to view
   "USER_GROUP_BUY" => array(2),  // allow members of group 2 to purchase
   "USER_LANG" => array(
      "fr" => "Prix de détail",
      "en" => "Retail price"
      )
);

if (!CCatalogGroup::Update($ID, $arFields))
   echo "Error updating price type";
?>