Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
triggerordernew.php
1<?
2
3namespace Bitrix\Sale\Sender;
4
8
9if (!Loader::includeModule('sender'))
10{
11 return;
12}
13
14Loc::loadMessages(__FILE__);
15
17{
18
19 public function getName()
20 {
21 return Loc::getMessage('sender_trigger_order_new_name');
22 }
23
24 public function getCode()
25 {
26 return "order_new";
27 }
28
29 public function getEventModuleId()
30 {
31 return 'sale';
32 }
33
34 public function getEventType()
35 {
36 return "OnOrderAdd";
37 }
38
39 public function getConnector()
40 {
41 $connector = new \Bitrix\Sale\Sender\ConnectorOrder;
42 $connector->setModuleId('sale');
43
44 return $connector;
45 }
46
49 {
50 $eventData = $this->getParam('EVENT');
51 return array('ID' => $eventData[0], 'LID' => $this->getSiteId());
52 }
53
58 public function getPersonalizeFields()
59 {
60 $eventData = $this->getParam('EVENT');
61 $result = ['ORDER_ID' => $eventData[0]];
62 if ((int)$eventData[0] <= 0)
63 return $result;
64
65 $registry = Sale\Registry::getInstance(Sale\Registry::REGISTRY_TYPE_ORDER);
67 $orderClass = $registry->getOrderClassName();
68
69 $order = $orderClass::load($eventData[0]);
70 if ($order)
71 {
72 $result = [
73 'ORDER_ID' => $order->getField('ACCOUNT_NUMBER'),
74 'ORDER_REAL_ID' => $order->getId()
75 ];
76 }
77 return $result;
78 }
79
83 public static function getPersonalizeList()
84 {
85 return array(
86 array(
87 'CODE' => 'ORDER_ID',
88 'NAME' => Loc::getMessage('sender_trigger_order_new_pers_order_id_name'),
89 'DESC' => Loc::getMessage('sender_trigger_order_new_pers_order_id_desc')
90 )
91 );
92 }
93
94 public function getForm()
95 {
96 return '';
97 }
98
99}
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29