Documentation

init

void public static
\Bitrix\Sale\DiscountCouponsManager::init(
 integer $mode = self::MODE_CLIENT,
 array $params = array(),
 boolean $clearStorage = false
);

Method initializes coupon manager. Static method.

Parameter

ParameterDescriptionVersion
$modeOperation mode.
$paramsArray with original parameters. Keys are case-sensitive:
  • userId - order owner ID (only for modes MODE_MANAGER or MODE_ORDER);
  • orderId - order ID, required only for mode for handling coupons of existing order (only for the mode MODE_ORDER);
  • oldUserId - old order owner, when customer was updated in the edit form (only for modes MODE_MANAGER or MODE_ORDER).
$clearStorageWhen accepts true, removes entered coupons on a current hit.

Example



© «Bitrix24», 2001-2024