Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
triggerorderpaid.php
1
<?
2
3
namespace
Bitrix\Sale\Sender
;
4
5
use
Bitrix\Main\Localization\Loc
;
6
use
Bitrix\Main\Loader
;
7
use
Bitrix\Sale
;
8
9
if
(!Loader::includeModule(
'sender'
))
10
{
11
return
;
12
}
13
14
Loc::loadMessages
(__FILE__);
15
16
class
TriggerOrderPaid
extends
\Bitrix\Sender\TriggerConnector
17
{
18
public
function
getName
()
19
{
20
return
Loc::getMessage
(
'sender_trigger_order_paid_name'
);
21
}
22
23
public
function
getCode
()
24
{
25
return
"order_paid"
;
26
}
27
28
public
function
getEventModuleId
()
29
{
30
return
'sale'
;
31
}
32
33
public
function
getEventType
()
34
{
35
return
"OnSalePayOrder"
;
36
}
37
38
public
function
filter
()
39
{
40
$eventData = $this->getParam(
'EVENT'
);
41
42
if
($eventData[1] !=
'Y'
)
43
return
false
;
44
else
45
return
$this->
filterConnectorData
();
46
}
47
48
public
function
getConnector
()
49
{
50
$connector
= new \Bitrix\Sale\Sender\ConnectorOrder;
51
$connector
->setModuleId(
'sale'
);
52
53
return
$connector
;
54
}
55
57
public
function
getProxyFieldsFromEventToConnector
()
58
{
59
$eventData = $this->getParam(
'EVENT'
);
60
return
array(
'ID'
=> $eventData[0],
'LID'
=> $this->getSiteId());
61
}
62
64
public
function
getMailEventToPrevent
()
65
{
66
$eventData = $this->getParam(
'EVENT'
);
67
return
array(
68
'EVENT_NAME'
=>
'SALE_ORDER_PAID'
,
69
'FILTER'
=> array(
'ORDER_ID'
=> $eventData[0])
70
);
71
}
72
77
public
function
getPersonalizeFields()
78
{
79
$eventData = $this->getParam(
'EVENT'
);
80
$result = [
'ORDER_ID'
=> $eventData[0]];
81
if
((
int
)$eventData[0] <= 0)
82
return
$result;
83
84
$registry = Sale\Registry::getInstance(
Sale
\
Registry::REGISTRY_TYPE_ORDER
);
86
$orderClass = $registry->getOrderClassName();
87
88
$order = $orderClass::load($eventData[0]);
89
if
($order)
90
{
91
$result = [
92
'ORDER_ID'
=> $order->getField(
'ACCOUNT_NUMBER'
),
93
'ORDER_REAL_ID'
=> $order->getId()
94
];
95
}
96
return
$result;
97
}
98
102
public
static
function
getPersonalizeList
()
103
{
104
return
array(
105
array(
106
'CODE'
=>
'ORDER_ID'
,
107
'NAME'
=>
Loc::getMessage
(
'sender_trigger_order_paid_pers_order_id_name'
),
108
'DESC'
=>
Loc::getMessage
(
'sender_trigger_order_paid_pers_order_id_desc'
)
109
)
110
);
111
}
112
113
}
Bitrix\Main\Loader
Definition
loader.php:12
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Sale\Registry\REGISTRY_TYPE_ORDER
const REGISTRY_TYPE_ORDER
Definition
registry.php:16
Bitrix\Sale\Sender\TriggerOrderPaid
Definition
triggerorderpaid.php:17
Bitrix\Sale\Sender\TriggerOrderPaid\getEventModuleId
getEventModuleId()
Definition
triggerorderpaid.php:28
Bitrix\Sale\Sender\TriggerOrderPaid\getName
getName()
Definition
triggerorderpaid.php:18
Bitrix\Sale\Sender\TriggerOrderPaid\getEventType
getEventType()
Definition
triggerorderpaid.php:33
Bitrix\Sale\Sender\TriggerOrderPaid\filter
filter()
Definition
triggerorderpaid.php:38
Bitrix\Sale\Sender\TriggerOrderPaid\getConnector
getConnector()
Definition
triggerorderpaid.php:48
Bitrix\Sale\Sender\TriggerOrderPaid\getProxyFieldsFromEventToConnector
getProxyFieldsFromEventToConnector()
Definition
triggerorderpaid.php:57
Bitrix\Sale\Sender\TriggerOrderPaid\getCode
getCode()
Definition
triggerorderpaid.php:23
Bitrix\Sale\Sender\TriggerOrderPaid\getPersonalizeList
static getPersonalizeList()
Definition
triggerorderpaid.php:102
Bitrix\Sale\Sender\TriggerOrderPaid\getMailEventToPrevent
getMailEventToPrevent()
Definition
triggerorderpaid.php:64
Bitrix\Sender\Trigger\TriggerConnector
Definition
triggerconnector.php:13
Bitrix\Sender\Trigger\TriggerConnector\$connector
$connector
Definition
triggerconnector.php:15
Bitrix\Sender\Trigger\TriggerConnector\filterConnectorData
filterConnectorData()
Definition
triggerconnector.php:43
Bitrix\Sale\Sender
Definition
connectororder.php:3
Bitrix\Sale
Sale
modules
sale
lib
sender
triggerorderpaid.php
Создано системой
1.10.0