Documentation

Add

int
CSaleOrderPropsVariant::Add(
  array arFields
);

The method Add creates a new variant (choice) that can be used to select a value with controls like radio button group (RADIO) and list (SELECT, MULTISELECT).

Parameters

ParameterDescription
arFields Associated array containing parameters of the new order property value whose keys are the order parameter names, and values are the parameter values.

The following values are possible:
  • ORDER_PROPS_ID - the order property ID;
  • NAME - variant name;
  • VALUE - variant value;
  • SORT - sort weight for positioning in lists;
  • DESCRIPTION - variant description.

Returned values

Returns the ID of the new variant on success or false otherwise.

Example


<?
$arFieldsV = array(
   "ORDER_PROPS_ID" => 12,
   "VALUE" => "F",
   "NAME" => "Full package",
   "SORT" => 100,
   "DESCRIPTION" => "Order is not shipped until it is complete."
);

if (!CSaleOrderPropsVariant::Add($arFieldsV))
   echo "error adding variant";
?>
© «Bitrix24», 2001-2024
Up