Documentation

Update

Description and parameters

mixed
CCatalogDiscountCoupon::Update (
int $ID,
array arFields
);

Method updates coupon information. Non-static method.

Call parameters

Parameter Description
ID Coupon code (ID).
arFields Associative array with coupon parameters. Can contain the following keys:
  • DISCOUNT_ID - discount code (ID);
  • ACTIVE - active coupon (Y|N);
  • ONE_TIME - single use coupon (Y|N);
  • COUPON - coupon code;
  • DATE_APPLY - date of applied coupon;
  • DESCRIPTION - comment.
Keys, not specified in array won't be updated.
If array is empty, database isn't queried.

Returned value

Method returns coupon code (ID), if record exists, was successfully applied or didn't change (empty array) and false - in case of error. To get detailed information on error, call $APPLICATION->GetException().

Before updating the record in the table, checks for binding parameters by the method CCatalogDiscountCoupon::CheckFields. On successful check and if array is not empty, updates the record.

See Also


© «Bitrix24», 2001-2024