72 return GetModuleEvents(
"sale", $event,
true);
80 public static function onSalePayOrder(Main\
Event $event)
82 if (static::$disableEvent ===
true)
87 $parameters = $event->getParameters();
90 $order = $parameters[
'ENTITY'];
94 Main\EventResult::ERROR,
100 $id = $order->getId();
101 $value = $order->getField(
'PAYED');
103 static::setDisableEvent(
true);
104 foreach(GetModuleEvents(
"sale", static::EVENT_COMPATIBILITY_ON_ORDER_PAID,
true) as $oldEvent)
106 ExecuteModuleEventEx($oldEvent, array($id, $value));
108 static::setDisableEvent(
false);
112 if (Main\Loader::includeModule(
"statistic"))
114 \CStatEvent::AddByEvents(
"eStore",
"order_paid", $id,
"", $order->getField(
"STAT_GID"), $order->getPrice(), $order->getCurrency());
119 if (Main\Loader::includeModule(
"statistic"))
121 \CStatEvent::AddByEvents(
"eStore",
"order_chargeback", $id,
"", $order->getField(
"STAT_GID"), $order->getPrice(), $order->getCurrency(),
"Y");
125 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
133 public static function onSaleOrderPaidSendMail(Main\Event $event)
135 if (static::$disableEvent ===
true)
137 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
140 $parameters = $event->getParameters();
143 $order = $parameters[
'ENTITY'];
144 if (!$order instanceof
Sale\Order)
146 return new Main\EventResult(
147 Main\EventResult::ERROR,
148 new Sale\ResultError(Main\Localization\
Loc::getMessage(
'SALE_EVENT_COMPATIBILITY_WRONG_ORDER'),
'SALE_EVENT_COMPATIBILITY_ORDER_PAY_SEND_EMAIL_WRONG_ORDER'),
153 $value = $order->getField(
'PAYED');
157 $registry = Sale\Registry::getInstance($order::getRegistryType());
160 $notifyClassName = $registry->getNotifyClassName();
161 $notifyClassName::sendOrderPaid($order);
163 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
171 public static function onSaleOrderCancelSendEmail(Main\Event $event)
173 if (static::$disableEvent ===
true)
175 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
178 if (static::$disableMailSend ===
true)
180 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
183 $parameters = $event->getParameters();
186 $order = $parameters[
'ENTITY'];
187 if (!$order instanceof
Sale\Order)
189 return new Main\EventResult(
190 Main\EventResult::ERROR,
191 new Sale\ResultError(Main\Localization\
Loc::getMessage(
'SALE_EVENT_COMPATIBILITY_WRONG_ORDER'),
'SALE_EVENT_COMPATIBILITY_ORDER_CANCEL_SEND_EMAIL_WRONG_ORDER'),
196 $id = $order->getId();
197 $value = $order->getField(
'CANCELED');
201 $registry = Sale\Registry::getInstance($order::getRegistryType());
204 $notifyClassName = $registry->getNotifyClassName();
205 $notifyClassName::sendOrderCancel($order);
207 if (Main\Loader::includeModule(
"statistic"))
209 \CStatEvent::AddByEvents(
"eStore",
"order_cancel", $id,
"", $order->getField(
"STAT_GID"));
212 $GLOBALS[
'SALE_ORDER_CANCEL_SEND'][$id] =
true;
215 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
224 public static function onOrderNewSendEmail(Main\Event $event)
226 if (static::$disableEvent ===
true)
228 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
231 if (static::$disableMailSend ===
true)
233 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
236 $parameters = $event->getParameters();
239 $order = $parameters[
'ENTITY'];
240 $isNew = $parameters[
'IS_NEW'];
242 if (!$order instanceof
Sale\Order)
244 return new Main\EventResult(
245 Main\EventResult::ERROR,
246 new Sale\ResultError(Main\Localization\
Loc::getMessage(
'SALE_EVENT_COMPATIBILITY_WRONG_ORDER'),
'SALE_EVENT_COMPATIBILITY_ORDER_NEW_SEND_EMAIL_WRONG_ORDER'),
251 $id = $order->getId();
255 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
258 $registry = Sale\Registry::getInstance($order::getRegistryType());
261 $notifyClassName = $registry->getNotifyClassName();
262 $notifyClassName::sendOrderNew($order);
264 $GLOBALS[
'SALE_NEW_ORDER_SEND'][$id] =
true;
266 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
275 public static function onBeforeOrderDelete(Main\Event $event)
277 if (static::$disableEvent ===
true)
279 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
282 $parameters = $event->getParameters();
285 $order = $parameters[
'ENTITY'];
286 if (!$order instanceof
Sale\Order)
288 return new Main\EventResult(
289 Main\EventResult::ERROR,
290 new Sale\ResultError(Main\Localization\
Loc::getMessage(
'SALE_EVENT_COMPATIBILITY_WRONG_ORDER'),
'SALE_EVENT_COMPATIBILITY_BEFORE_ORDER_DELETE_WRONG_ORDER'),
295 $id = $order->getId();
297 static::setDisableEvent(
true);
298 foreach(GetModuleEvents(
"sale", static::EVENT_COMPATIBILITY_ON_BEFORE_ORDER_DELETE,
true) as $oldEvent)
300 if (ExecuteModuleEventEx($oldEvent, array($id)) ===
false)
302 return new Main\EventResult(
303 Main\EventResult::SUCCESS,
308 static::setDisableEvent(
false);
310 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
318 public static function onOrderDelete(Main\Event $event)
320 if (static::$disableEvent ===
true)
322 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
325 $parameters = $event->getParameters();
328 $order = $parameters[
'ENTITY'];
329 if (!$order instanceof
Sale\Order)
331 return new Main\EventResult(
332 Main\EventResult::ERROR,
333 new Sale\ResultError(Main\Localization\
Loc::getMessage(
'SALE_EVENT_COMPATIBILITY_WRONG_ORDER'),
'SALE_EVENT_COMPATIBILITY_ORDER_DELETE_WRONG_ORDER'),
338 $deleted = $parameters[
'VALUE'];
339 $id = $order->getId();
341 static::setDisableEvent(
true);
342 foreach(GetModuleEvents(
"sale", static::EVENT_COMPATIBILITY_ON_ORDER_DELETED,
true) as $oldEvent)
344 ExecuteModuleEventEx($oldEvent, array($id, $deleted));
346 static::setDisableEvent(
false);
348 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
357 public static function onSaleDeliveryOrder(Main\Event $event)
359 if (static::$disableEvent ===
true)
361 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
364 $parameters = $event->getParameters();
367 $shipment = $parameters[
'ENTITY'];
368 if (!$shipment instanceof
Sale\Shipment)
370 return new Main\EventResult(
371 Main\EventResult::ERROR,
372 new Sale\ResultError(Main\Localization\
Loc::getMessage(
'SALE_EVENT_COMPATIBILITY_WRONG_SHIPMENT'),
'SALE_EVENT_COMPATIBILITY_DELIVER_ORDER_WRONG_SHIPMENT'),
378 if (!$shipmentCollection = $shipment->getCollection())
380 throw new Main\ObjectNotFoundException(
'Entity "ShipmentCollection" not found');
384 if (!$order = $shipmentCollection->getOrder())
386 throw new Main\ObjectNotFoundException(
'Entity "Order" not found');
389 $id = $order->getId();
391 static::setDisableEvent(
true);
392 foreach(GetModuleEvents(
"sale", static::EVENT_COMPATIBILITY_ON_SHIPMENT_DELIVER,
true) as $oldEvent)
394 ExecuteModuleEventEx($oldEvent, array($id, $shipment->getField(
'ALLOW_DELIVERY')));
396 static::setDisableEvent(
false);
398 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
406 public static function onOrderSave(Main\Event $event)
408 if (static::$disableEvent ===
true)
410 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
413 $parameters = $event->getParameters();
416 $order = $parameters[
'ENTITY'];
417 $oldValues = $parameters[
'VALUES'];
418 if (!$order instanceof
Sale\Order)
420 return new Main\EventResult(
421 Main\EventResult::ERROR,
422 new Sale\ResultError(Main\Localization\
Loc::getMessage(
'SALE_EVENT_COMPATIBILITY_WRONG_ORDER'),
'SALE_EVENT_COMPATIBILITY_ORDER_SAVE_WRONG_ORDER'),
427 $isNew = $order->isNew();
428 $id = $order->getId();
431 $orderFields = array();
435 if ($resultOrderFields->isSuccess())
437 if ($orderFieldsResultData = $resultOrderFields->getData())
439 if (!empty($orderFieldsResultData[
'FIELDS']) && is_array($orderFieldsResultData[
'FIELDS']))
441 $fields = $orderFieldsResultData[
'FIELDS'];
443 if (!empty($orderFieldsResultData[
'ORDER_FIELDS']) && is_array($orderFieldsResultData[
'ORDER_FIELDS']))
445 $orderFields = $orderFieldsResultData[
'ORDER_FIELDS'];
450 static::setDisableEvent(
true);
453 foreach(GetModuleEvents(
"sale", static::EVENT_COMPATIBILITY_ON_ORDER_ADD,
true) as $oldEvent)
455 ExecuteModuleEventEx($oldEvent, array($id, $orderFields));
460 foreach(GetModuleEvents(
"sale", static::EVENT_COMPATIBILITY_ON_ORDER_UPDATE,
true) as $oldEvent)
462 ExecuteModuleEventEx($oldEvent, array($id, $orderFields));
465 static::setDisableEvent(
false);
467 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
474 public static function onOrderSaved(Main\Event $event)
476 if (static::$disableEvent ===
true)
478 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
481 $parameters = $event->getParameters();
484 $order = $parameters[
'ENTITY'];
485 $oldValues = $parameters[
'VALUES'];
486 if (!$order instanceof
Sale\Order)
488 return new Main\EventResult(
489 Main\EventResult::ERROR,
490 new Sale\ResultError(Main\Localization\
Loc::getMessage(
'SALE_EVENT_COMPATIBILITY_WRONG_ORDER'),
'SALE_EVENT_COMPATIBILITY_ORDER_SAVED_WRONG_ORDER'),
495 $isNew = $parameters[
'IS_NEW'];
496 $id = $order->getId();
503 if ($resultOrderFields->isSuccess())
505 if ($orderFieldsResultData = $resultOrderFields->getData())
507 if (!empty($orderFieldsResultData[
'FIELDS']) && is_array($orderFieldsResultData[
'FIELDS']))
509 $fields = $orderFieldsResultData[
'FIELDS'];
511 if (!empty($orderFieldsResultData[
'ORDER_FIELDS']) && is_array($orderFieldsResultData[
'ORDER_FIELDS']))
513 $orderFields = $orderFieldsResultData[
'ORDER_FIELDS'];
518 static::setDisableEvent(
true);
519 foreach(GetModuleEvents(
"sale", static::EVENT_COMPATIBILITY_ON_ORDER_SAVE,
true) as $oldEvent)
521 ExecuteModuleEventEx($oldEvent, array($id,
$fields, $orderFields, $isNew));
523 static::setDisableEvent(
false);
525 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
532 public static function onOrderAdd(Main\Event $event)
534 if (static::$disableEvent ===
true)
536 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
539 $parameters = $event->getParameters();
542 $order = $parameters[
'ENTITY'];
543 $isNew = $parameters[
'IS_NEW'];
546 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
549 if (!$order instanceof
Sale\Order)
551 return new Main\EventResult(
552 Main\EventResult::ERROR,
553 new Sale\ResultError(Main\Localization\
Loc::getMessage(
'SALE_EVENT_COMPATIBILITY_WRONG_ORDER'),
'SALE_EVENT_COMPATIBILITY_ORDER_ADD_WRONG_ORDER'),
558 $id = $order->getId();
565 if ($resultOrderFields->isSuccess())
567 if ($orderFieldsResultData = $resultOrderFields->getData())
569 if (!empty($orderFieldsResultData[
'ORDER_FIELDS']) && is_array($orderFieldsResultData[
'ORDER_FIELDS']))
571 $orderFields = $orderFieldsResultData[
'ORDER_FIELDS'];
576 static::setDisableEvent(
true);
577 foreach(GetModuleEvents(
"sale", static::EVENT_COMPATIBILITY_ON_ORDER_ADD,
true) as $oldEvent)
579 ExecuteModuleEventEx($oldEvent, array($id, $orderFields));
581 static::setDisableEvent(
false);
583 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
589 public static function onOrderBeforeSaved(Main\Event $event)
593 if (static::$disableEvent ===
true)
595 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
599 $parameters = $event->getParameters();
602 $order = $parameters[
'ENTITY'];
604 if (!$order instanceof
Sale\Order)
606 return new Main\EventResult(
607 Main\EventResult::ERROR,
608 new Sale\ResultError(Main\Localization\
Loc::getMessage(
'SALE_EVENT_COMPATIBILITY_WRONG_ORDER'),
'SALE_EVENT_COMPATIBILITY_ORDER_BEFORE_SAVED_WRONG_ORDER'),
613 $id = $order->getId();
620 if ($resultOrderFields->isSuccess())
622 if ($orderFieldsResultData = $resultOrderFields->getData())
624 if (!empty($orderFieldsResultData[
'ORDER_FIELDS']) && is_array($orderFieldsResultData[
'ORDER_FIELDS']))
626 $orderFields = $orderFieldsResultData[
'ORDER_FIELDS'];
631 $currentOrderFields = $orderFields;
635 static::setDisableEvent(
true);
636 foreach(GetModuleEvents(
"sale", static::EVENT_COMPATIBILITY_ON_BEFORE_ORDER_ADD,
true) as $oldEvent)
638 if (ExecuteModuleEventEx($oldEvent, array(&$orderFields)) ===
false)
640 if ($ex = $APPLICATION->GetException())
642 return new Main\EventResult(
643 Main\EventResult::ERROR,
644 new Sale\ResultError($ex->GetString(), $ex->GetID()),
652 static::setDisableEvent(
false);
656 foreach ($orderFields as $orderFieldName => $orderFieldValue)
658 if (in_array($orderFieldName, $allowFields)
659 && (array_key_exists($orderFieldName, $currentOrderFields) && $orderFieldValue != $currentOrderFields[$orderFieldName]))
662 $order->setFieldNoDemand($orderFieldName, $orderFieldValue);
668 static::setDisableEvent(
true);
669 foreach(GetModuleEvents(
"sale", static::EVENT_COMPATIBILITY_ON_BEFORE_ORDER_UPDATE,
true) as $oldEvent)
671 if (ExecuteModuleEventEx($oldEvent, array($id, $orderFields)) ===
false)
674 if ($ex = $APPLICATION->GetException())
676 $error =
new Sale\ResultError($ex->GetString(), $ex->GetID());
679 return new Main\EventResult(
680 Main\EventResult::ERROR,
686 static::setDisableEvent(
false);
689 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
697 public static function onSaleBeforeCancelOrder(Main\Event $event)
699 if (static::$disableEvent ===
true)
701 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
704 $parameters = $event->getParameters();
707 $order = $parameters[
'ENTITY'];
708 if (!$order instanceof
Sale\Order)
710 return new Main\EventResult(
711 Main\EventResult::ERROR,
712 new Sale\ResultError(Main\Localization\
Loc::getMessage(
'SALE_EVENT_COMPATIBILITY_WRONG_ORDER'),
'SALE_EVENT_COMPATIBILITY_BEFORE_ORDER_DELETE_WRONG_ORDER'),
717 $id = $order->getId();
718 $value = $order->getField(
'CANCELED');;
720 static::setDisableEvent(
true);
721 foreach(GetModuleEvents(
"sale", static::EVENT_COMPATIBILITY_ON_BEFORE_ORDER_CANCELED,
true) as $oldEvent)
723 if (ExecuteModuleEventEx($oldEvent, array($id, $value)) ===
false)
725 return new Main\EventResult(
726 Main\EventResult::SUCCESS,
731 static::setDisableEvent(
false);
733 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
741 public static function onSaleCancelOrder(Main\Event $event)
743 if (static::$disableEvent ===
true)
745 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
748 $parameters = $event->getParameters();
751 $order = $parameters[
'ENTITY'];
752 if (!$order instanceof
Sale\Order)
754 return new Main\EventResult(
755 Main\EventResult::ERROR,
756 new Sale\ResultError(Main\Localization\
Loc::getMessage(
'SALE_EVENT_COMPATIBILITY_WRONG_ORDER'),
'SALE_EVENT_COMPATIBILITY_ORDER_DELETE_WRONG_ORDER'),
761 $canceled = $order->getField(
'CANCELED');
762 $id = $order->getId();
763 $description = $order->getField(
'REASON_CANCELED');
765 static::setDisableEvent(
true);
766 foreach(GetModuleEvents(
"sale", static::EVENT_COMPATIBILITY_ON_ORDER_CANCELED,
true) as $oldEvent)
768 ExecuteModuleEventEx($oldEvent, array($id, $canceled, $description));
769 $order->setField(
'REASON_CANCELED', $description);
771 static::setDisableEvent(
false);
773 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
782 public static function onBasketItemBeforeChange(Main\Event $event)
784 if (static::$disableEvent ===
true)
786 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
789 $parameters = $event->getParameters();
792 $basketItem = $parameters[
'ENTITY'];
793 $isNew = $parameters[
'IS_NEW'];
794 $oldValues = $parameters[
'VALUES'];
796 if (!$basketItem instanceof
Sale\BasketItem)
798 return new Main\EventResult(
799 Main\EventResult::ERROR,
800 new Sale\ResultError(Main\Localization\
Loc::getMessage(
'SALE_EVENT_COMPATIBILITY_WRONG_BASKET'),
'SALE_EVENT_COMPATIBILITY_BASKET_ITEM_BEFORE_CHANGE_WRONG_BASKET'),
805 $currentBasketFields = BasketCompatibility::convertBasketItemToArray($basketItem);
807 $basketFields = array();
811 $basketFields = $currentBasketFields;
815 if (!empty($oldValues) && is_array($oldValues))
817 foreach ($oldValues as $oldValueKey => $oldValueData)
819 if (array_key_exists($oldValueKey, $currentBasketFields))
821 $basketFields[$oldValueKey] = $currentBasketFields[$oldValueKey];
827 if (array_key_exists(
'QUANTITY', $oldValues) && ($currentBasketFields[
'QUANTITY'] - $oldValues[
'QUANTITY']) > 0)
829 if (empty($basketFields[
'ID']) && !empty($currentBasketFields[
'ID']))
831 $basketFields[
'ID'] = $currentBasketFields[
'ID'];
834 $basketFields[
'QUANTITY'] = $currentBasketFields[
'QUANTITY'] - $oldValues[
'QUANTITY'];
836 static::setDisableEvent(
true);
837 foreach(GetModuleEvents(
"sale", static::EVENT_COMPATIBILITY_ON_BEFORE_BASKET_ITEM_ADD,
true) as $oldEvent)
839 ExecuteModuleEventEx($oldEvent, array(&$basketFields));
841 static::setDisableEvent(
false);
843 $basketFields[
'QUANTITY'] = $oldValues[
'QUANTITY'] + $basketFields[
'QUANTITY'];
846 if (empty($basketFields) && !empty($oldValues) && is_array($oldValues))
848 foreach ($oldValues as $oldValueKey => $oldValueData)
850 if (array_key_exists($oldValueKey, $currentBasketFields))
852 $basketFields[$oldValueKey] = $currentBasketFields[$oldValueKey];
859 static::setDisableEvent(
true);
860 foreach(GetModuleEvents(
"sale", static::EVENT_COMPATIBILITY_ON_BEFORE_BASKET_ITEM_UPDATE,
true) as $oldEvent)
862 ExecuteModuleEventEx($oldEvent, array($basketItem->getId(), &$basketFields));
864 static::setDisableEvent(
false);
868 foreach ($currentBasketFields as $key => $value)
870 if (isset($basketFields[$key]) && !is_array($value) && $basketFields[$key] != $value)
872 $basketItem->setFieldNoDemand($key, $basketFields[$key]);
876 if (!empty($basketFields[
'PROPS']) && is_array($basketFields[
'PROPS']))
878 $propIndexList = array();
880 if (!$basketPropertyCollection = $basketItem->getPropertyCollection())
882 throw new Main\ObjectNotFoundException(
'Entity "BasketPropertiesCollection" not found');
885 $propDiffByName =
false;
887 if (!empty($currentBasketFields[
'PROPS']) && is_array($currentBasketFields[
'PROPS']))
889 foreach ($currentBasketFields[
'PROPS'] as $propData)
891 $propCode = $propData[
"CODE"];
892 if (empty($propData[
"CODE"]))
894 $propCode = $propData[
"NAME"];
895 $propDiffByName =
true;
898 $propIndexList[$propCode] = $propData;
902 foreach ($basketFields[
'PROPS'] as $propData)
904 $propCode = $propData[
"CODE"];
905 if (empty($propData[
"CODE"]) || $propDiffByName)
906 $propCode = $propData[
"NAME"];
908 if (isset($propIndexList[$propCode]))
910 $propOldData = $propIndexList[$propCode];
911 if ($propData[
'SORT'] != $propOldData[
'SORT'] || $propData[
'VALUE'] != $propOldData[
'VALUE'])
914 if ($basketPropertyItem = $basketPropertyCollection->getPropertyItemByValue($propIndexList[$propCode]))
916 $basketPropertyItem->setFieldsNoDemand($propData);
922 if ($basketPropertyItem = $basketPropertyCollection->createItem())
924 $basketPropertyItem->setFieldsNoDemand($propData);
933 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
941 public static function onBasketItemChange(Main\Event $event)
943 if (static::$disableEvent ===
true)
945 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
948 $parameters = $event->getParameters();
951 $basketItem = $parameters[
'ENTITY'];
952 $isNew = $parameters[
'IS_NEW'] ??
false;
953 $oldValues = $parameters[
'VALUES'];
954 if (!$basketItem instanceof
Sale\BasketItem)
956 return new Main\EventResult(
957 Main\EventResult::ERROR,
958 new Sale\ResultError(Main\Localization\
Loc::getMessage(
'SALE_EVENT_COMPATIBILITY_WRONG_BASKET'),
'SALE_EVENT_COMPATIBILITY_BASKET_ITEM_CHANGE_WRONG_BASKET'),
963 $basketFields = BasketCompatibility::convertBasketItemToArray($basketItem);
965 static::setDisableEvent(
true);
968 foreach(GetModuleEvents(
"sale", static::EVENT_COMPATIBILITY_ON_BASKET_ITEM_UPDATE,
true) as $oldEvent)
970 ExecuteModuleEventEx($oldEvent, array($basketItem->getId(), $basketFields));
974 if (array_key_exists(
'QUANTITY', $oldValues) && ($basketFields[
'QUANTITY'] - $oldValues[
'QUANTITY']) > 0)
976 foreach(GetModuleEvents(
"sale", static::EVENT_COMPATIBILITY_ON_BASKET_ITEM_ADD,
true) as $oldEvent)
978 ExecuteModuleEventEx($oldEvent, Array($basketItem->getId(), $basketFields));
982 static::setDisableEvent(
false);
984 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
993 public static function onShipmentTrackingNumberChange(Main\Event $event)
995 if (static::$disableEvent ===
true)
997 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
1000 $parameters = $event->getParameters();
1003 $shipment = $parameters[
'ENTITY'];
1004 $oldValues = $parameters[
'VALUES'];
1005 if (!$shipment instanceof
Sale\Shipment)
1007 return new Main\EventResult(
1008 Main\EventResult::ERROR,
1009 new Sale\ResultError(Main\Localization\
Loc::getMessage(
'SALE_EVENT_COMPATIBILITY_WRONG_SHIPMENT'),
'SALE_EVENT_COMPATIBILITY_SHIPMENT_TRACKING_NUMBER_CHANGE_WRONG_SHIPMENT'),
1015 if (!$shipmentCollection = $shipment->getCollection())
1017 throw new Main\ObjectNotFoundException(
'Entity "ShipmentCollection" not found');
1021 if (!$order = $shipmentCollection->getOrder())
1023 throw new Main\ObjectNotFoundException(
'Entity "Order" not found');
1026 static::setDisableEvent(
true);
1027 foreach(GetModuleEvents(
"sale", static::EVENT_COMPATIBILITY_ON_TRACKING_NUMBER_CHANGE,
true) as $oldEvent)
1029 ExecuteModuleEventEx($oldEvent, Array($order->getId(), $shipment->getField(
'TRACKING_NUMBER')));
1031 static::setDisableEvent(
false);
1033 if (array_key_exists(
'TRACKING_NUMBER', $oldValues) && strval($shipment->getField(
'TRACKING_NUMBER')) !=
''
1034 && $oldValues[
"TRACKING_NUMBER"] != $shipment->getField(
'TRACKING_NUMBER'))
1037 $registry = Sale\Registry::getInstance($shipment::getRegistryType());
1040 $notifyClassName = $registry->getNotifyClassName();
1041 $notifyClassName::sendShipmentTrackingNumberChange($shipment);
1044 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
1053 public static function onShipmentAllowDelivery(Main\Event $event)
1055 if (static::$disableEvent ===
true)
1057 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
1060 $parameters = $event->getParameters();
1063 $shipment = $parameters[
'ENTITY'];
1064 $oldValues = $parameters[
'VALUES'];
1065 if (!$shipment instanceof
Sale\Shipment)
1067 return new Main\EventResult(
1068 Main\EventResult::ERROR,
1069 new Sale\ResultError(Main\Localization\
Loc::getMessage(
'SALE_EVENT_COMPATIBILITY_WRONG_SHIPMENT'),
'SALE_EVENT_COMPATIBILITY_SHIPMENT_ALLOW_DELIVERY_WRONG_SHIPMENT'),
1075 if (!$shipmentCollection = $shipment->getCollection())
1077 throw new Main\ObjectNotFoundException(
'Entity "ShipmentCollection" not found');
1081 if (!$order = $shipmentCollection->getOrder())
1083 throw new Main\ObjectNotFoundException(
'Entity "Order" not found');
1086 if ($shipmentCollection->isAllowDelivery() && array_key_exists(
'ALLOW_DELIVERY', $oldValues) && strval($shipment->getField(
'ALLOW_DELIVERY')) !=
''
1087 && $oldValues[
"ALLOW_DELIVERY"] != $shipment->getField(
'ALLOW_DELIVERY'))
1090 $registry = Sale\Registry::getInstance($shipment::getRegistryType());
1093 $notifyClassName = $registry->getNotifyClassName();
1094 $notifyClassName::sendShipmentAllowDelivery($shipment);
1097 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
1106 public static function onSaleStatusOrderChange(Main\Event $event)
1108 if (static::$disableEvent ===
true)
1110 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
1113 $parameters = $event->getParameters();
1116 $order = $parameters[
'ENTITY'];
1117 $value = $parameters[
'VALUE'];
1118 $oldValue = $parameters[
'OLD_VALUE'];
1119 if (!$order instanceof
Sale\Order)
1121 return new Main\EventResult(
1122 Main\EventResult::ERROR,
1123 new Sale\ResultError(Main\Localization\
Loc::getMessage(
'SALE_EVENT_COMPATIBILITY_WRONG_ORDER'),
'SALE_EVENT_COMPATIBILITY_ORDER_STATUS_CHANGE_WRONG_ORDER'),
1128 static::setDisableEvent(
true);
1129 foreach(GetModuleEvents(
"sale", static::EVENT_COMPATIBILITY_ON_ORDER_STATUS_CHANGE,
true) as $oldEvent)
1131 ExecuteModuleEventEx($oldEvent, array($order->getId(), $value));
1133 static::setDisableEvent(
false);
1135 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
1144 public static function onSaleOrderStatusChangeSendEmail(Main\Event $event)
1146 if (static::$disableEvent ===
true)
1148 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
1151 $parameters = $event->getParameters();
1154 $order = $parameters[
'ENTITY'];
1155 $value = $parameters[
'VALUE'];
1156 $oldValue = $parameters[
'OLD_VALUE'];
1157 if (!$order instanceof
Sale\Order)
1159 return new Main\EventResult(
1160 Main\EventResult::ERROR,
1161 new Sale\ResultError(Main\Localization\
Loc::getMessage(
'SALE_EVENT_COMPATIBILITY_WRONG_ORDER'),
'SALE_EVENT_COMPATIBILITY_ORDER_STATUS_CHANGE_SEND_EMAIL_WRONG_ORDER'),
1166 $registry = Sale\Registry::getInstance($order::getRegistryType());
1169 $notifyClassName = $registry->getNotifyClassName();
1170 $notifyClassName::sendOrderStatusChange($order);
1172 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
1184 if (static::$disableMailSend ===
true)
1189 if (!empty(
$GLOBALS[
'SALE_NEW_ORDER_SEND'][$id]))
1206 if (static::$disableMailSend ===
true)
1211 if (!empty(
$GLOBALS[
'SALE_ORDER_CANCEL_SEND'][$id]))
1225 public static function onSaleBeforeStatusOrderChange(Main\
Event $event)
1227 if (static::$disableEvent ===
true)
1232 $parameters = $event->getParameters();
1235 $order = $parameters[
'ENTITY'];
1236 $value = $parameters[
'VALUE'];
1237 $oldValue = $parameters[
'OLD_VALUE'];
1241 Main\EventResult::ERROR,
1242 new Sale\
ResultError(Main\Localization\
Loc::getMessage(
'SALE_EVENT_COMPATIBILITY_WRONG_ORDER'),
'SALE_EVENT_COMPATIBILITY_BEFORE_ORDER_STATUS_CHANGE_WRONG_ORDER'),
1247 static::setDisableEvent(
true);
1248 foreach(GetModuleEvents(
"sale", static::EVENT_COMPATIBILITY_ON_BEFORE_ORDER_STATUS_CHANGE,
true) as $oldEvent)
1250 if (ExecuteModuleEventEx($oldEvent, array($order->getId(), $value)) ===
false)
1252 static::setDisableEvent(
false);
1257 static::setDisableEvent(
false);
1259 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
1267 public static function onBeforeBasketDelete(Main\Event $event)
1269 if (static::$disableEvent ===
true)
1271 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
1274 $parameters = $event->getParameters();
1277 $basketItem = $parameters[
'ENTITY'];
1278 if (!$basketItem instanceof
Sale\BasketItem)
1280 return new Main\EventResult(
1281 Main\EventResult::ERROR,
1282 new Sale\ResultError(Main\Localization\
Loc::getMessage(
'SALE_EVENT_COMPATIBILITY_WRONG_BASKET_ITEM'),
'SALE_EVENT_COMPATIBILITY_BEFORE_BASKET_ITEM_DELETE_WRONG_BASKET_ITEM'),
1287 $id = $basketItem->getId();
1289 static::setDisableEvent(
true);
1290 foreach(GetModuleEvents(
"sale", static::EVENT_COMPATIBILITY_ON_BEFORE_BASKET_DELETE,
true) as $oldEvent)
1292 if (ExecuteModuleEventEx($oldEvent, array($id)) ===
false)
1294 return new Main\EventResult(
1295 Main\EventResult::SUCCESS,
1300 static::setDisableEvent(
false);
1302 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
1310 public static function onBasketDelete(Main\Event $event)
1312 if (static::$disableEvent ===
true)
1314 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
1317 $parameters = $event->getParameters();
1320 $values = $parameters[
'VALUES'];
1321 if (empty($values) || !is_array($values))
1323 return new Main\EventResult(
1324 Main\EventResult::ERROR,
1325 new Sale\ResultError(Main\Localization\
Loc::getMessage(
'SALE_EVENT_COMPATIBILITY_WRONG_VALUES'),
'SALE_EVENT_COMPATIBILITY_BASKET_ITEM_DELETE_WRONG_VALUES'),
1330 if (empty($values[
'ID']))
1332 return new Main\EventResult(
1333 Main\EventResult::ERROR,
1334 new Sale\ResultError(Main\Localization\
Loc::getMessage(
'SALE_EVENT_COMPATIBILITY_WRONG_ID'),
'SALE_EVENT_COMPATIBILITY_BASKET_ITEM_DELETE_WRONG_ID'),
1339 $id = $values[
'ID'];
1341 static::setDisableEvent(
true);
1342 foreach(GetModuleEvents(
"sale", static::EVENT_COMPATIBILITY_ON_BASKET_DELETED,
true) as $oldEvent)
1344 ExecuteModuleEventEx($oldEvent, array($id));
1346 static::setDisableEvent(
false);
1348 return new Main\EventResult( Main\EventResult::SUCCESS,
null,
'sale');
1356 static::$disableMailSend = ($value ===
true || $value ==
"Y");
1364 static::$disableEvent = ($value ===
true);
1372 return static::$disableEvent;
1380 $eventManager = Main\EventManager::getInstance();
1382 $eventManager->registerEventHandler(
'sale',
'OnSaleOrderPaid',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onSalePayOrder');
1384 $eventManager->registerEventHandler(
'sale',
'OnSaleOrderBeforeSaved',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onOrderBeforeSaved');
1386 $eventManager->registerEventHandler(
'sale',
'OnSaleBeforeOrderDelete',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onBeforeOrderDelete');
1388 $eventManager->registerEventHandler(
'sale',
'OnSaleOrderDeleted',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onOrderDelete');
1390 $eventManager->registerEventHandler(
'sale',
'OnShipmentAllowDelivery',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onSaleDeliveryOrder');
1392 $eventManager->registerEventHandler(
'sale',
'OnSaleBeforeOrderCanceled',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onSaleBeforeCancelOrder');
1394 $eventManager->registerEventHandler(
'sale',
'OnSaleOrderCanceled',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onSaleCancelOrder');
1396 $eventManager->registerEventHandler(
'sale',
'OnSaleOrderPaidSendMail',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onSaleOrderPaidSendMail', 500);
1398 $eventManager->registerEventHandler(
'sale',
'OnSaleOrderCancelSendEmail',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onSaleOrderCancelSendEmail', 500);
1400 $eventManager->registerEventHandler(
'sale',
'OnSaleOrderEntitySaved',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onOrderSave');
1402 $eventManager->registerEventHandler(
'sale',
'OnSaleOrderSaved',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onOrderSaved');
1404 $eventManager->registerEventHandler(
'sale',
'OnSaleBasketItemBeforeSaved',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onBasketItemBeforeChange');
1406 $eventManager->registerEventHandler(
'sale',
'OnSaleBasketItemEntitySaved',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onBasketItemChange');
1408 $eventManager->registerEventHandler(
'sale',
'OnShipmentTrackingNumberChange',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onShipmentTrackingNumberChange');
1410 $eventManager->registerEventHandler(
'sale',
'OnSaleBeforeStatusOrderChange',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onSaleBeforeStatusOrderChange');
1412 $eventManager->registerEventHandler(
'sale',
'OnSaleStatusOrderChange',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onSaleStatusOrderChange');
1414 $eventManager->registerEventHandler(
'sale',
'OnSaleOrderStatusChangeSendEmail',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onSaleOrderStatusChangeSendEmail', 500);
1416 $eventManager->registerEventHandler(
'sale',
'OnSaleOrderSaved',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onOrderNewSendEmail', 500);
1418 RegisterModuleDependences(
"sale",
"OnOrderNewSendEmail",
"sale",
"\\Bitrix\\Sale\\Compatible\\EventCompatibility",
"onCallOrderNewSendEmail", 500);
1420 $eventManager->registerEventHandler(
'sale',
'OnBeforeSaleBasketItemEntityDeleted',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'OnBeforeBasketDelete');
1422 $eventManager->registerEventHandler(
'sale',
'OnSaleBasketItemDeleted',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'OnBasketDelete');
1424 $eventManager->registerEventHandler(
'sale',
'OnShipmentAllowDelivery',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onShipmentAllowDelivery');
1426 RegisterModuleDependences(
"sale",
"OnOrderCancelSendEmail",
"sale",
"\\Bitrix\\Sale\\Compatible\\EventCompatibility",
"onCallOrderCancelSendEmail", 500);
1428 $eventManager->registerEventHandler(
'sale',
'OnSaleOrderSaved',
'sale',
'\Bitrix\Sale\Product2ProductTable',
'onSaleOrderAddEvent');
1430 $eventManager->registerEventHandler(
'sale',
'OnSaleStatusOrderChange',
'sale',
'\Bitrix\Sale\Product2ProductTable',
'onSaleStatusOrderHandlerEvent');
1432 $eventManager->registerEventHandler(
'sale',
'OnShipmentAllowDelivery',
'sale',
'\Bitrix\Sale\Product2ProductTable',
'onSaleDeliveryOrderHandlerEvent');
1434 $eventManager->registerEventHandler(
'sale',
'OnShipmentDeducted',
'sale',
'\Bitrix\Sale\Product2ProductTable',
'onSaleDeductOrderHandlerEvent');
1436 $eventManager->registerEventHandler(
'sale',
'OnSaleOrderCanceled',
'sale',
'\Bitrix\Sale\Product2ProductTable',
'onSaleCancelOrderHandlerEvent');
1438 $eventManager->registerEventHandler(
'sale',
'OnSaleOrderPaid',
'sale',
'\Bitrix\Sale\Product2ProductTable',
'onSalePayOrderHandlerEvent');
1440 UnRegisterModuleDependences(
"sale",
"OnBasketOrder",
"sale",
"\\Bitrix\\Sale\\Product2ProductTable",
"onSaleOrderAdd", 100);
1441 UnRegisterModuleDependences(
"sale",
"OnSaleStatusOrder",
"sale",
"\\Bitrix\\Sale\\Product2ProductTable",
"onSaleStatusOrderHandler", 100);
1442 UnRegisterModuleDependences(
"sale",
"OnSaleDeliveryOrder",
"sale",
"\\Bitrix\\Sale\\Product2ProductTable",
"onSaleDeliveryOrderHandler", 100);
1443 UnRegisterModuleDependences(
"sale",
"OnSaleDeductOrder",
"sale",
"\\Bitrix\\Sale\\Product2ProductTable",
"onSaleDeductOrderHandler", 100);
1444 UnRegisterModuleDependences(
"sale",
"OnSaleCancelOrder",
"sale",
"\\Bitrix\\Sale\\Product2ProductTable",
"onSaleCancelOrderHandler", 100);
1445 UnRegisterModuleDependences(
"sale",
"OnSalePayOrder",
"sale",
"\\Bitrix\\Sale\\Product2ProductTable",
"onSalePayOrderHandler", 100);
1454 $eventManager = Main\EventManager::getInstance();
1456 $eventManager->unRegisterEventHandler(
'sale',
'OnSaleOrderPaid',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onSalePayOrder');
1458 $eventManager->unRegisterEventHandler(
'sale',
'OnSaleOrderBeforeSaved',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onOrderBeforeSaved');
1460 $eventManager->unRegisterEventHandler(
'sale',
'OnSaleBeforeOrderDelete',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onBeforeOrderDelete');
1462 $eventManager->unRegisterEventHandler(
'sale',
'OnSaleOrderDeleted',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onOrderDelete');
1464 $eventManager->unRegisterEventHandler(
'sale',
'OnShipmentAllowDelivery',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onSaleDeliveryOrder');
1466 $eventManager->unRegisterEventHandler(
'sale',
'OnSaleBeforeOrderCanceled',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onSaleBeforeCancelOrder');
1468 $eventManager->unRegisterEventHandler(
'sale',
'OnSaleOrderCanceled',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onSaleCancelOrder');
1470 $eventManager->unRegisterEventHandler(
'sale',
'OnSaleOrderPaidSendMail',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onSaleOrderPaidSendMail');
1472 $eventManager->unRegisterEventHandler(
'sale',
'OnSaleOrderCancelSendEmail',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onSaleOrderCancelSendEmail');
1474 $eventManager->unRegisterEventHandler(
'sale',
'OnSaleOrderEntitySaved',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onOrderSave');
1476 $eventManager->unRegisterEventHandler(
'sale',
'OnSaleOrderSaved',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onOrderSaved');
1478 $eventManager->unRegisterEventHandler(
'sale',
'OnSaleBasketItemBeforeSaved',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onBasketItemBeforeChange');
1480 $eventManager->unRegisterEventHandler(
'sale',
'OnSaleBasketItemEntitySaved',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onBasketItemChange');
1482 $eventManager->unRegisterEventHandler(
'sale',
'OnShipmentTrackingNumberChange',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onShipmentTrackingNumberChange');
1484 $eventManager->unRegisterEventHandler(
'sale',
'OnSaleBeforeStatusOrderChange',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onSaleBeforeStatusOrderChange');
1486 $eventManager->unRegisterEventHandler(
'sale',
'OnSaleStatusOrderChange',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onSaleStatusOrderChange');
1488 $eventManager->unRegisterEventHandler(
'sale',
'OnSaleOrderStatusChangeSendEmail',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onSaleOrderStatusChangeSendEmail');
1490 $eventManager->unRegisterEventHandler(
'sale',
'OnSaleOrderSaved',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onOrderNewSendEmail');
1492 UnRegisterModuleDependences(
"sale",
"OnOrderNewSendEmail",
"sale",
"\\Bitrix\\Sale\\Compatible\\EventCompatibility",
"onCallOrderNewSendEmail");
1494 $eventManager->unRegisterEventHandler(
'sale',
'OnBeforeSaleBasketItemEntityDeleted',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'OnBeforeBasketDelete');
1496 $eventManager->unRegisterEventHandler(
'sale',
'OnSaleBasketItemDeleted',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'OnBasketDelete');
1498 $eventManager->unRegisterEventHandler(
'sale',
'OnShipmentAllowDelivery',
'sale',
'\Bitrix\Sale\Compatible\EventCompatibility',
'onShipmentAllowDelivery');
1500 UnRegisterModuleDependences(
"sale",
"OnOrderCancelSendEmail",
"sale",
"\\Bitrix\\Sale\\Compatible\\EventCompatibility",
"onCallOrderCancelSendEmail");
1502 $eventManager->unRegisterEventHandler(
'sale',
'OnSaleOrderSaved',
'sale',
'\Bitrix\Sale\Product2ProductTable',
'onSaleOrderAddEvent');
1504 $eventManager->unRegisterEventHandler(
'sale',
'OnSaleStatusOrderChange',
'sale',
'\Bitrix\Sale\Product2ProductTable',
'onSaleStatusOrderHandlerEvent');
1506 $eventManager->unRegisterEventHandler(
'sale',
'OnShipmentAllowDelivery',
'sale',
'\Bitrix\Sale\Product2ProductTable',
'onSaleDeliveryOrderHandlerEvent');
1508 $eventManager->unRegisterEventHandler(
'sale',
'OnShipmentDeducted',
'sale',
'\Bitrix\Sale\Product2ProductTable',
'onSaleDeductOrderHandlerEvent');
1510 $eventManager->unRegisterEventHandler(
'sale',
'OnSaleOrderCanceled',
'sale',
'\Bitrix\Sale\Product2ProductTable',
'onSaleCancelOrderHandlerEvent');
1512 $eventManager->unRegisterEventHandler(
'sale',
'OnSaleOrderPaid',
'sale',
'\Bitrix\Sale\Product2ProductTable',
'onSalePayOrderHandlerEvent');
1514 RegisterModuleDependences(
"sale",
"OnBasketOrder",
"sale",
"\\Bitrix\\Sale\\Product2ProductTable",
"onSaleOrderAdd", 100);
1515 RegisterModuleDependences(
"sale",
"OnSaleStatusOrder",
"sale",
"\\Bitrix\\Sale\\Product2ProductTable",
"onSaleStatusOrderHandler", 100);
1516 RegisterModuleDependences(
"sale",
"OnSaleDeliveryOrder",
"sale",
"\\Bitrix\\Sale\\Product2ProductTable",
"onSaleDeliveryOrderHandler", 100);
1517 RegisterModuleDependences(
"sale",
"OnSaleDeductOrder",
"sale",
"\\Bitrix\\Sale\\Product2ProductTable",
"onSaleDeductOrderHandler", 100);
1518 RegisterModuleDependences(
"sale",
"OnSaleCancelOrder",
"sale",
"\\Bitrix\\Sale\\Product2ProductTable",
"onSaleCancelOrderHandler", 100);
1519 RegisterModuleDependences(
"sale",
"OnSalePayOrder",
"sale",
"\\Bitrix\\Sale\\Product2ProductTable",
"onSalePayOrderHandler", 100);