Exemplo n.º 1
0
 /**
  * Set types table.
  *
  * @param Main\Event $event				Manager data.
  * @return void
  */
 protected static function initTypes(Main\Event $event)
 {
     if (self::$existCouponsManager === null) {
         self::initUseMode();
     }
     if (!self::$existCouponsManager) {
         return;
     }
     self::$types = array(self::TYPE_ONE_ROW => Sale\Internals\DiscountCouponTable::TYPE_BASKET_ROW, self::TYPE_ONE_ORDER => Sale\Internals\DiscountCouponTable::TYPE_ONE_ORDER, self::TYPE_NO_LIMIT => Sale\Internals\DiscountCouponTable::TYPE_MULTI_ORDER);
     self::$typeUnknown = $event->getParameter('COUPON_UNKNOWN');
 }
Exemplo n.º 2
0
 /**
  * Return methods for coupons manager.
  *
  * @param array $params					Data from coupons manager.
  * @return Main\EventResult
  */
 public static function couponManager($params)
 {
     self::$types = array(self::TYPE_ONE_ROW => Sale\Internals\DiscountCouponTable::TYPE_BASKET_ROW, self::TYPE_ONE_ORDER => Sale\Internals\DiscountCouponTable::TYPE_ONE_ORDER, self::TYPE_NO_LIMIT => Sale\Internals\DiscountCouponTable::TYPE_MULTI_ORDER);
     $result = new Main\EventResult(Main\EventResult::SUCCESS, array('mode' => Sale\DiscountCouponsManager::COUPON_MODE_SIMPLE, 'getData' => array('\\Bitrix\\Catalog\\DiscountCouponTable', 'getData'), 'isExist' => array('\\Bitrix\\Catalog\\DiscountCouponTable', 'isExist'), 'saveApplied' => array('\\Bitrix\\Catalog\\DiscountCouponTable', 'saveApplied')), 'catalog');
     return $result;
 }