Answer the question
In order to leave comments, you need to log in
How to change the date of the coupon of the rules for working with the basket in Bitrix?
It is necessary to make changes to the date of the existing coupon of the rules for working with the basket, there are all coupon parameters (id, code, etc.).
Tried like this:
$PERIOD = '190 day';
$activeTo = new Bitrix\Main\Type\DateTime();
$activeTo = $activeTo->add($PERIOD);
$fields = [
'ACTIVE_TO' => $activeTo,
];
CCatalogDiscountCoupon::CheckFields('UPDATE', $fields, $cupon["ID"]);
CCatalogDiscountCoupon::Update($cupon["ID"], $fields);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question