Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
product2product.php
1<?php
3
4use \Bitrix\Main;
5use \Bitrix\Main\Config;
6use \Bitrix\Sale;
8
9Loc::loadMessages(__FILE__);
10
27class Product2ProductTable extends Main\Entity\DataManager
28{
29 public static function getTableName()
30 {
31 return "b_sale_product2product";
32 }
33
34 public static function getMap()
35 {
36 return array(
37 'ID' => array(
38 'data_type' => 'integer',
39 'primary' => true,
40 'autocomplete' => true,
41 ),
42 'PRODUCT_ID' => array(
43 'data_type' => 'integer'
44 ),
45 'PARENT_PRODUCT_ID' => array(
46 'data_type' => 'integer'
47 ),
48 'CNT' => array(
49 'data_type' => 'integer'
50 )
51 );
52 }
53
63 public static function deleteOldProducts($liveTime = 10)
64 {
65 $liveTime = (int)$liveTime;
66 $connection = Main\Application::getConnection();
67 $type = $connection->getType();
68 $helper = $connection->getSqlHelper();
69 $liveTo = $helper->addSecondsToDateTime($liveTime * 24 * 3600, "o.DATE_INSERT");
70 $now = $helper->getCurrentDateTimeFunction();
71
72 // Update existing
73 switch ($type)
74 {
75 case 'mysql':
76 if ($connection->isTableExists('b_sale_order_product_stat'))
77 {
78 $liveTo = $helper->addSecondsToDateTime($liveTime * 24 * 3600, "ORDER_DATE");
79 $sqlDelete = "DELETE FROM b_sale_order_product_stat WHERE $now > $liveTo";
80 $connection->query($sqlDelete);
81 $connection->query("TRUNCATE TABLE b_sale_product2product");
82 $sqlUpdate = "INSERT INTO b_sale_product2product(PRODUCT_ID, PARENT_PRODUCT_ID, CNT)
83 SELECT ops.PRODUCT_ID, ops.RELATED_PRODUCT_ID, SUM(ops.CNT)
84 FROM b_sale_order_product_stat ops
85 GROUP BY PRODUCT_ID, RELATED_PRODUCT_ID
86 ORDER BY NULL";
87 $connection->query($sqlUpdate);
88 unset($sqlUpdate);
89 }
90 break;
91 case 'mssql':
92 $sqlUpdate = "UPDATE b_sale_product2product
93 SET CNT = CNT - 1
94 FROM b_sale_product2product p2p, b_sale_basket b, b_sale_basket b1, b_sale_order o, b_sale_order_processing op
95 WHERE b.ORDER_ID = b1.ORDER_ID AND
96 b.ID <> b1.ID AND
97 $now > $liveTo AND
98 o.ID = b.ORDER_ID AND
99 o.ID = op.ORDER_ID AND
100 op.PRODUCTS_REMOVED = 'N' AND
101 p2p.PRODUCT_ID = b.PRODUCT_ID AND
102 p2p.PARENT_PRODUCT_ID = b1.PRODUCT_ID";
103 $connection->query($sqlUpdate);
104 unset($sqlUpdate);
105 break;
106 case 'oracle':
107 $sqlUpdate = "UPDATE b_sale_product2product
108 SET CNT = CNT - 1
109 WHERE ID IN (
110 SELECT p2p.ID FROM b_sale_product2product p2p, b_sale_basket b, b_sale_basket b1, b_sale_order o, b_sale_order_processing op
111 WHERE b.ORDER_ID = b1.ORDER_ID AND
112 b.ID <> b1.ID AND
113 $now > $liveTo AND
114 o.ID = b.ORDER_ID AND
115 o.ID = op.ORDER_ID AND
116 op.PRODUCTS_REMOVED = 'N' AND
117 p2p.PRODUCT_ID = b.PRODUCT_ID AND
118 p2p.PARENT_PRODUCT_ID = b1.PRODUCT_ID
119 )";
120 $connection->query($sqlUpdate);
121 unset($sqlUpdate);
122 break;
123 default:
124 break;
125 }
126
127 // @deprecated update status, stayed for compatibility
128 $updateRemStatusSql = "UPDATE b_sale_order_processing SET PRODUCTS_REMOVED = 'Y'";
129 $connection->query($updateRemStatusSql);
130
131 if ($type !== "mysql")
132 {
133 // Delete
134 $deleteSql = "DELETE FROM b_sale_product2product WHERE CNT <= 0";
135 $connection->query($deleteSql);
136 }
137
138 return "\\Bitrix\\Sale\\Product2ProductTable::deleteOldProducts(".$liveTime.");";
139 }
140
148 public static function refreshProductStatistic($liveTime = 10)
149 {
150 $liveTime = (int)$liveTime;
151 $connection = Main\Application::getConnection();
152
153 if (!$connection->isTableExists('b_sale_order_product_stat'))
154 return;
155
156 $sqlDelete = "TRUNCATE TABLE b_sale_order_product_stat";
157 $connection->query($sqlDelete);
158 $dateLimit = "";
159 if ($liveTime > 0)
160 {
161 $helper = $connection->getSqlHelper();
162 $liveTo = $helper->addSecondsToDateTime($liveTime * 24 * 3600, "b.DATE_INSERT");
163 $dateLimit = " AND NOW() < $liveTo";
164 }
165 $sqlUpdate = "
166 INSERT INTO b_sale_order_product_stat (PRODUCT_ID, RELATED_PRODUCT_ID, ORDER_DATE, CNT)
167 SELECT b.PRODUCT_ID as PRODUCT_ID, b1.PRODUCT_ID as RELATED_PRODUCT_ID, DATE(b.DATE_INSERT) as ORDER_DATE, COUNT(b.PRODUCT_ID)
168 FROM b_sale_basket b, b_sale_basket b1
169 WHERE b.ORDER_ID = b1.ORDER_ID
170 AND b.ID <> b1.ID
171 $dateLimit
172 GROUP BY b.PRODUCT_ID, b1.PRODUCT_ID, ORDER_DATE
173 ORDER BY NULL";
174 $connection->query($sqlUpdate);
175
176 $sqlDelete = "TRUNCATE TABLE b_sale_product2product";
177 $connection->query($sqlDelete);
178 $sqlUpdate = "
179 INSERT INTO b_sale_product2product (PRODUCT_ID, PARENT_PRODUCT_ID, CNT)
180 SELECT ops.PRODUCT_ID, ops.RELATED_PRODUCT_ID, SUM(ops.CNT)
181 FROM b_sale_order_product_stat ops
182 GROUP BY PRODUCT_ID, RELATED_PRODUCT_ID
183 ORDER BY NULL
184 ";
185
186 return $connection->query($sqlUpdate);
187 }
188
196 public static function addProductsFromOrder($orderId = 0)
197 {
198 $orderId = (int)$orderId;
199
201 return;
202
203 $connection = Main\Application::getConnection();
204 $type = $connection->getType();
205
206 // Update existing
207 if ($type == "mysql" && $connection->isTableExists('b_sale_order_product_stat'))
208 {
209 $sqlUpdate = "
210 INSERT INTO b_sale_order_product_stat (PRODUCT_ID, RELATED_PRODUCT_ID, ORDER_DATE)
211 SELECT b.PRODUCT_ID, b1.PRODUCT_ID, DATE(b.DATE_INSERT)
212 FROM b_sale_basket b, b_sale_basket b1
213 WHERE b.ORDER_ID = b1.ORDER_ID AND
214 b.ORDER_ID = $orderId AND
215 b.ID <> b1.ID
216 ON DUPLICATE KEY UPDATE CNT = CNT + 1;
217 ";
218 $connection->query($sqlUpdate);
219
220 $sqlUpdate = "UPDATE b_sale_product2product p2p, b_sale_basket b, b_sale_basket b1
221 SET p2p.CNT = p2p.CNT + 1
222 WHERE b.ORDER_ID = b1.ORDER_ID AND
223 b.ID <> b1.ID AND
224 b.ORDER_ID = $orderId AND
225 p2p.PRODUCT_ID = b.PRODUCT_ID AND
226 p2p.PARENT_PRODUCT_ID = b1.PRODUCT_ID";
227 }
228 elseif ($type == "mssql")
229 {
230 $sqlUpdate = "UPDATE b_sale_product2product
231 SET CNT = CNT + 1
232 FROM b_sale_product2product p2p, b_sale_basket b, b_sale_basket b1
233 WHERE b.ORDER_ID = b1.ORDER_ID AND
234 b.ID <> b1.ID AND
235 b.ORDER_ID = $orderId AND
236 p2p.PRODUCT_ID = b.PRODUCT_ID AND
237 p2p.PARENT_PRODUCT_ID = b1.PRODUCT_ID";
238 }
239 else // Oracle
240 {
241 $sqlUpdate = "UPDATE b_sale_product2product
242 SET CNT = CNT + 1
243 WHERE ID IN (
244 SELECT p2p.ID FROM b_sale_product2product p2p, b_sale_basket b, b_sale_basket b1
245 WHERE b.ORDER_ID = b1.ORDER_ID AND
246 b.ID <> b1.ID AND
247 b.ORDER_ID = $orderId AND
248 p2p.PRODUCT_ID = b.PRODUCT_ID AND
249 p2p.PARENT_PRODUCT_ID = b1.PRODUCT_ID
250 )";
251 }
252
253 $connection->query($sqlUpdate);
254
255 // Insert new
256 $sqlInsert = "INSERT INTO b_sale_product2product (PRODUCT_ID, PARENT_PRODUCT_ID, CNT)
257 SELECT b.PRODUCT_ID, b1.PRODUCT_ID, 1
258 FROM b_sale_basket b, b_sale_basket b1
259 WHERE b.ORDER_ID = b1.ORDER_ID AND
260 b.ORDER_ID = $orderId AND
261 b.ID <> b1.ID AND
262 NOT EXISTS (SELECT 1 FROM b_sale_product2product d WHERE d.PRODUCT_ID = b.PRODUCT_ID AND d.PARENT_PRODUCT_ID = b1.PRODUCT_ID)";
263
264 $connection->query($sqlInsert);
265
266 Sale\OrderProcessingTable::markProductsAdded($orderId);
267
268 if (defined("BX_COMP_MANAGED_CACHE"))
269 {
270 $app = Main\Application::getInstance();
271 $app->getTaggedCache()->clearByTag('sale_product_buy');
272 }
273 }
274
281 public static function addProductsByAgent($limit = 100)
282 {
283 $limit = (int)$limit;
284 $connection = Main\Application::getConnection();
285 $type = $connection->getType();
286 $isTableExists = $connection->isTableExists('b_sale_order_product_stat');
287 if ($type == "mysql" && $isTableExists)
288 {
289 $params = array(
290 "filter" => array("PRODUCTS_ADDED" => 'N'),
291 "select" => array("ORDER_ID")
292 );
293
294 if ($limit > 0)
295 {
296 $params['limit'] = $limit;
297 }
298
299 $orderIds = array();
300 $processingData = Sale\OrderProcessingTable::getList($params);
301 while ($processingOrder = $processingData->fetch())
302 {
303 $orderIds[] = (int)$processingOrder['ORDER_ID'];
304 }
305
306 if (!empty($orderIds))
307 {
308 $sqlOrderIds = implode(',', $orderIds);
309 Sale\OrderProcessingTable::markProductsAddedByList($orderIds);
310
311 $sqlInsert = "
312 INSERT INTO b_sale_order_product_stat (CNT, PRODUCT_ID, RELATED_PRODUCT_ID, ORDER_DATE)
313 SELECT SUMM, PRODUCT_ID, PARENT_PRODUCT_ID, TODAY
314 FROM (
315 SELECT COUNT(1) as SUMM,
316 b.PRODUCT_ID as PRODUCT_ID,
317 b1.PRODUCT_ID as PARENT_PRODUCT_ID,
318 CURDATE() as TODAY
319 FROM b_sale_basket b, b_sale_basket b1
320 WHERE
321 b1.ORDER_ID = b.ORDER_ID
322 AND b1.ID <> b.ID
323 AND b.ORDER_ID IN ($sqlOrderIds)
324 GROUP BY b.PRODUCT_ID, b1.PRODUCT_ID
325 ORDER BY NULL
326 ) cacl
327 ON DUPLICATE KEY UPDATE CNT = CNT + cacl.SUMM;";
328 $connection->query($sqlInsert);
329
330 $sqlUpdate = "
331 UPDATE b_sale_product2product p2p,
332 (
333 SELECT COUNT(1) as CNT,
334 b.PRODUCT_ID as PRODUCT_ID,
335 b1.PRODUCT_ID as PARENT_PRODUCT_ID
336 FROM b_sale_basket b, b_sale_basket b1
337 WHERE
338 b1.ORDER_ID = b.ORDER_ID
339 AND b1.ID <> b.ID
340 AND b.ORDER_ID IN ($sqlOrderIds)
341 GROUP BY b.PRODUCT_ID, b1.PRODUCT_ID
342 ORDER BY NULL
343 ) calc
344 SET p2p.CNT = p2p.CNT + calc.CNT
345 WHERE p2p.PRODUCT_ID = calc.PRODUCT_ID AND p2p.PARENT_PRODUCT_ID = calc.PARENT_PRODUCT_ID";
346
347 $connection->query($sqlUpdate);
348
349 $sqlInsert = "
350 INSERT INTO b_sale_product2product (PRODUCT_ID, PARENT_PRODUCT_ID, CNT)
351 SELECT b.PRODUCT_ID, b1.PRODUCT_ID, 1
352 FROM b_sale_basket b, b_sale_basket b1
353 WHERE b.ORDER_ID = b1.ORDER_ID AND
354 b.ORDER_ID IN ($sqlOrderIds) AND
355 b.ID <> b1.ID AND
356 NOT EXISTS (SELECT 1 FROM b_sale_product2product d WHERE d.PRODUCT_ID = b.PRODUCT_ID AND d.PARENT_PRODUCT_ID = b1.PRODUCT_ID)";
357 $connection->query($sqlInsert);
358
359 if (defined("BX_COMP_MANAGED_CACHE"))
360 {
361 $app = Main\Application::getInstance();
362 $app->getTaggedCache()->clearByTag('sale_product_buy');
363 }
364 }
365 }
366
367 $agentName = "\\Bitrix\\Sale\\Product2ProductTable::addProductsByAgent($limit);";
368 $agentData = \CAgent::GetList(array(), array("NAME" => $agentName, "MODULE_ID" => "sale"));
369 $agent = $agentData->Fetch();
370
371 $processingData = Sale\OrderProcessingTable::getList(
372 array(
373 "filter" => array("PRODUCTS_ADDED" => 'N')
374 )
375 );
376
377 if ($processingData->fetch())
378 {
379 if ($isTableExists && $agent['ID'] && $agent['ID'] > 60)
380 {
381 \CAgent::Delete($agent["ID"]);
382 \CAgent::AddAgent("Bitrix\\Sale\\Product2ProductTable::addProductsByAgent($limit);", "sale", "N", 60, "", "Y");
383 }
384 }
385 else
386 {
387 if ($agent['ID'])
388 {
389 \CAgent::Update($agent["ID"], array("AGENT_INTERVAL" => 60*60*24));
390 }
391 }
392
393 return $agentName;
394 }
395
401 public static function onSaleOrderAddEvent(Main\Event $event)
402 {
403 $order = $event->getParameter('ENTITY');
404 $isNew = $event->getParameter('IS_NEW');
405 if ((!$order instanceof Sale\Order))
406 {
407 return new Main\EventResult(
408 Main\EventResult::ERROR,
409 new Sale\ResultError(Main\Localization\Loc::getMessage('SALE_EVENT_PRODUCT2PRODUCT_WRONG_ORDER'), 'SALE_EVENT_PRODUCT2PRODUCT_ON_SALE_ORDER_ADD_WRONG_ORDER'),
410 'sale'
411 );
412 }
413
414 $basket = $order->getBasket();
415
416 if ($isNew && ($basket && count($basket) > 0))
417 {
418 static::onSaleOrderAdd($order->getId());
419 }
420
421 return new Main\EventResult( Main\EventResult::SUCCESS, null, 'sale');
422 }
423
429 public static function onSaleStatusOrderHandlerEvent(Main\Event $event)
430 {
431 $order = $event->getParameter('ENTITY');
432 $value = $event->getParameter('VALUE');
433 if ((!$order instanceof Sale\Order))
434 {
435 return new Main\EventResult(
436 Main\EventResult::ERROR,
437 new Sale\ResultError(Main\Localization\Loc::getMessage('SALE_EVENT_PRODUCT2PRODUCT_WRONG_ORDER'), 'SALE_EVENT_PRODUCT2PRODUCT_ON_SALE_ORDER_STATUS_WRONG_ORDER'),
438 'sale'
439 );
440 }
441
442 static::onSaleStatusOrderHandler($order->getId(), $value);
443
444 return new Main\EventResult( Main\EventResult::SUCCESS, null, 'sale');
445 }
446
452 public static function onSaleDeliveryOrderHandlerEvent(Main\Event $event)
453 {
454 $shipment = $event->getParameter('ENTITY');
455 if ((!$shipment instanceof Sale\Shipment))
456 {
457 return new Main\EventResult(
458 Main\EventResult::ERROR,
459 new Sale\ResultError(Main\Localization\Loc::getMessage('SALE_EVENT_PRODUCT2PRODUCT_WRONG_SHIPMENT'), 'SALE_EVENT_PRODUCT2PRODUCT_ON_SALE_DELIVERY_ORDER_WRONG_SHIPMENT'),
460 'sale'
461 );
462 }
463
464 if (!$shipmentCollection = $shipment->getCollection())
465 {
466 return new Main\EventResult(
467 Main\EventResult::ERROR,
468 new Sale\ResultError(Main\Localization\Loc::getMessage('SALE_EVENT_PRODUCT2PRODUCT_WRONG_SHIPMENTCOLLECTION'), 'SALE_EVENT_PRODUCT2PRODUCT_ON_SALE_DELIVERY_ORDER_WRONG_SHIPMENTCOLLECTION'),
469 'sale'
470 );
471
472 }
473
474 if (!$order = $shipmentCollection->getOrder())
475 {
476 return new Main\EventResult(
477 Main\EventResult::ERROR,
478 new Sale\ResultError(Main\Localization\Loc::getMessage('SALE_EVENT_PRODUCT2PRODUCT_WRONG_ORDER'), 'SALE_EVENT_PRODUCT2PRODUCT_ON_SALE_DELIVERY_ORDER_WRONG_ORDER'),
479 'sale'
480 );
481
482 }
483
484 static::onSaleDeliveryOrderHandler($order->getId(), $order->isAllowDelivery() ? 'Y' : 'N');
485
486 return new Main\EventResult( Main\EventResult::SUCCESS, null, 'sale');
487 }
488
494 public static function onSaleDeductOrderHandlerEvent(Main\Event $event)
495 {
496 $shipment = $event->getParameter('ENTITY');
497 if ((!$shipment instanceof Sale\Shipment))
498 {
499 return new Main\EventResult(
500 Main\EventResult::ERROR,
501 new Sale\ResultError(Main\Localization\Loc::getMessage('SALE_EVENT_PRODUCT2PRODUCT_WRONG_SHIPMENT'), 'SALE_EVENT_PRODUCT2PRODUCT_ON_SALE_DEDUCT_ORDER_WRONG_SHIPMENT'),
502 'sale'
503 );
504 }
505
506 if (!$shipmentCollection = $shipment->getCollection())
507 {
508 return new Main\EventResult(
509 Main\EventResult::ERROR,
510 new Sale\ResultError(Main\Localization\Loc::getMessage('SALE_EVENT_PRODUCT2PRODUCT_WRONG_SHIPMENTCOLLECTION'), 'SALE_EVENT_PRODUCT2PRODUCT_ON_SALE_DEDUCT_ORDER_WRONG_SHIPMENTCOLLECTION'),
511 'sale'
512 );
513
514 }
515
516 if (!$order = $shipmentCollection->getOrder())
517 {
518 return new Main\EventResult(
519 Main\EventResult::ERROR,
520 new Sale\ResultError(Main\Localization\Loc::getMessage('SALE_EVENT_PRODUCT2PRODUCT_WRONG_ORDER'), 'SALE_EVENT_PRODUCT2PRODUCT_ON_SALE_DEDUCT_ORDER_WRONG_ORDER'),
521 'sale'
522 );
523
524 }
525
526
527 static::onSaleDeductOrderHandler($order->getId(), $order->isShipped() ? 'Y' : 'N');
528
529 return new Main\EventResult( Main\EventResult::SUCCESS, null, 'sale');
530 }
531
537 public static function onSaleCancelOrderHandlerEvent(Main\Event $event)
538 {
539 $order = $event->getParameter('ENTITY');
540 if ((!$order instanceof Sale\Order))
541 {
542 return new Main\EventResult(
543 Main\EventResult::ERROR,
544 new Sale\ResultError(Main\Localization\Loc::getMessage('SALE_EVENT_PRODUCT2PRODUCT_WRONG_ORDER'), 'SALE_EVENT_PRODUCT2PRODUCT_ON_SALE_CANCELED_ORDER_WRONG_ORDER'),
545 'sale'
546 );
547 }
548
549 static::onSaleCancelOrderHandler($order->getId(), $order->isCanceled() ? 'Y' : 'N');
550
551 return new Main\EventResult( Main\EventResult::SUCCESS, null, 'sale');
552 }
553
559 public static function onSalePayOrderHandlerEvent(Main\Event $event)
560 {
561 $order = $event->getParameter('ENTITY');
562 if ((!$order instanceof Sale\Order))
563 {
564 return new Main\EventResult(
565 Main\EventResult::ERROR,
566 new Sale\ResultError(Main\Localization\Loc::getMessage('SALE_EVENT_PRODUCT2PRODUCT_WRONG_ORDER'), 'SALE_EVENT_PRODUCT2PRODUCT_ON_SALE_PAID_ORDER_WRONG_ORDER'),
567 'sale'
568 );
569 }
570
571 static::onSaleCancelOrderHandler($order->getId(), $order->isPaid() ? 'Y' : 'N');
572
573 return new Main\EventResult( Main\EventResult::SUCCESS, null, 'sale');
574 }
575
582 public static function onSaleOrderAdd($orderId)
583 {
584 $statusName = "N";
585 static::addOrderProcessing($orderId, $statusName);
586 }
587
595 public static function onSaleStatusOrderHandler($orderId, $status)
596 {
597 static::addOrderProcessing($orderId, $status);
598 }
599
607 public static function onSaleDeliveryOrderHandler($orderId, $status)
608 {
609 if ($status == 'Y')
610 {
611 $statusName = "F_DELIVERY";
612 static::addOrderProcessing($orderId, $statusName);
613 }
614 }
615
623 public static function onSaleDeductOrderHandler($orderId, $status)
624 {
625 if ($status == 'Y')
626 {
627 $statusName = "F_OUT";
628 static::addOrderProcessing($orderId, $statusName);
629 }
630 }
631
639 public static function onSaleCancelOrderHandler($orderId, $status)
640 {
641 if ($status == 'Y')
642 {
643 $statusName = "F_CANCELED";
644 static::addOrderProcessing($orderId, $statusName);
645 }
646 }
647
655 public static function onSalePayOrderHandler($orderId, $status)
656 {
657 if ($status == 'Y')
658 {
659 $statusName = "F_PAY";
660 static::addOrderProcessing($orderId, $statusName);
661 }
662 }
663
671 protected static function addOrderProcessing($orderId, $statusName)
672 {
673 $allowStatuses = Config\Option::get("sale", "p2p_status_list", "");
674 $allowCollecting = Config\Option::get("sale", "p2p_allow_collect_data");
675 if ($allowStatuses != '')
676 $allowStatuses = unserialize($allowStatuses, ['allowed_classes' => false]);
677 else
678 $allowStatuses = array();
679
680 if ($allowCollecting == "Y" && !empty($allowStatuses) && is_array($allowStatuses) && in_array($statusName, $allowStatuses))
681 {
682 $orderInformation = Sale\OrderProcessingTable::getList(
683 array(
684 "filter" => array("ORDER_ID" => (int)$orderId),
685 "limit" => 1
686 )
687 );
688 $result = $orderInformation->fetch();
689 if (!$result)
690 Sale\OrderProcessingTable::add(array("ORDER_ID" => (int)$orderId));
691 }
692 }
693}
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29
static onSaleStatusOrderHandler($orderId, $status)
static onSaleDeductOrderHandlerEvent(Main\Event $event)
static onSaleDeductOrderHandler($orderId, $status)
static onSaleStatusOrderHandlerEvent(Main\Event $event)
static onSaleCancelOrderHandlerEvent(Main\Event $event)
static addOrderProcessing($orderId, $statusName)
static onSaleDeliveryOrderHandler($orderId, $status)
static onSaleDeliveryOrderHandlerEvent(Main\Event $event)
static onSaleCancelOrderHandler($orderId, $status)
static onSalePayOrderHandlerEvent(Main\Event $event)
static onSalePayOrderHandler($orderId, $status)