Bitrix Site Manager

CSaleDiscount::Add

int
CSaleDiscount::Add(
  array arFields
);

The method Add adds a new discount.

Parameters

ParameterDescription
arFields Associated array whose keys are the discount parameter names, and the values are the parameter values.

The following keys are possible:
  • LID - the ID of the site to which this discount is bound;
  • PRICE_FROM - minimum total order price to which this discount is applicable;
  • PRICE_TO - maximum total order price to which this discount is applicable;
  • CURRENCY - currency in which all money values are specified in this record;
  • DISCOUNT_VALUE - discount value;
  • DISCOUNT_TYPE - type of the discount value (P - percentage, V - absolute value);
  • ACTIVE - flag indicating the discount is active (Y/N);
  • SORT - sort weight. If more than one discount can be applied to an order price, the discount with the less SORT is taken first.

Return Values

Returns the ID of the new discount or false otherwise.