1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
subscribe.php
См. документацию.
1<?php
2namespace Bitrix\Catalog;
3
4use Bitrix\Main\Entity,
5 Bitrix\Main\Type\DateTime,
6 Bitrix\Main\Application,
7 Bitrix\Main\Event,
8 Bitrix\Main\EventManager,
9 Bitrix\Main\Localization\Loc,
10 Bitrix\Sale,
11 Bitrix\Main\Config\Option,
12 Bitrix\Main\Loader,
13 Bitrix\Landing\Connector\Iblock as IblockConnector;
14
15Loc::loadMessages(__FILE__);
16
52class SubscribeTable extends Entity\DataManager
53{
54 const EVENT_ADD_CONTACT_TYPE = 'onAddContactType';
55
57 const LIMIT_SEND = 50;
58 const AGENT_TIME_OUT = 10;
59 const AGENT_INTERVAL = 10;
60
61 private static $oldProductAvailable = array();
62 private static $agentNoticeCreated = false;
63 private static $agentRepeatedNoticeCreated = false;
64
70 public static function getTableName()
71 {
72 return 'b_catalog_subscribe';
73 }
74
80 public static function getMap()
81 {
82 return array(
83 'ID' => array(
84 'data_type' => 'integer',
85 'primary' => true,
86 'autocomplete' => true,
87 ),
88 'DATE_FROM' => array(
89 'data_type' => 'datetime',
90 'required' => true,
91 'default_value' => fn() => new DateTime(),
92 ),
93 'DATE_TO' => array(
94 'data_type' => 'datetime',
95 ),
96 'USER_CONTACT' => array(
97 'data_type' => 'string',
98 'required' => true,
99 ),
100 'CONTACT_TYPE' => array(
101 'data_type' => 'integer',
102 'required' => true,
103 ),
104 'USER_ID' => array(
105 'data_type' => 'integer',
106 ),
107 'USER' => array(
108 'data_type' => 'Bitrix\Main\UserTable',
109 'reference' => array('=this.USER_ID' => 'ref.ID'),
110 ),
111 'ITEM_ID' => array(
112 'data_type' => 'integer',
113 ),
114 'PRODUCT' => array(
115 'data_type' => 'Bitrix\Catalog\ProductTable',
116 'reference' => array('=this.ITEM_ID' => 'ref.ID'),
117 ),
118 'IBLOCK_ELEMENT' => array(
119 'data_type' => 'Bitrix\Iblock\ElementTable',
120 'reference' => array('=this.ITEM_ID' => 'ref.ID'),
121 ),
122 'NEED_SENDING' => array(
123 'data_type' => 'boolean',
124 'values' => array('N', 'Y'),
125 'default_value' => 'N',
126 'validation' => array(__CLASS__, 'validateNeedSending'),
127 ),
128 'SITE_ID' => array(
129 'data_type' => 'string',
130 'required' => true,
131 'validation' => array(__CLASS__, 'validateSiteId'),
132 ),
133 'LANDING_SITE_ID' => array(
134 'data_type' => 'integer',
135 ),
136 );
137 }
138
144 public static function validateNeedSending()
145 {
146 return array(
147 new Entity\Validator\Length(null, 1),
148 );
149 }
150
156 public static function validateSiteId()
157 {
158 return array(
159 new Entity\Validator\Length(null, 2),
160 );
161 }
162
169 public static function onUserDelete($userId): void
170 {
171 $userId = (int)$userId;
172 if ($userId <= 0)
173 {
174 return;
175 }
176
177 $connection = Application::getConnection();
178 $helper = $connection->getSqlHelper();
179 $connection->queryExecute(
180 'delete from ' . $helper->quote(static::getTableName())
181 . ' where ' . $helper->quote('USER_ID') . ' = ' . $userId
182 );
183 unset($helper, $connection);
184 }
185
192 public static function onIblockElementDelete($productId)
193 {
194 $productId = (int)$productId;
195 if ($productId <= 0)
196 return true;
197
198 $connection = Application::getConnection();
199 $helper = $connection->getSqlHelper();
200 $connection->queryExecute('delete from '.$helper->quote(static::getTableName()).' where '
201 .$helper->quote('ITEM_ID').' = '.$productId
202 );
203
204 return true;
205 }
206
214 public static function onSaleOrderSaved(Event $event)
215 {
216 if(!$event->getParameter('IS_NEW'))
217 return;
218
219 $order = $event->getParameter('ENTITY');
220
221 if($order instanceof Sale\Order)
222 {
223 $userId = $order->getUserId();
224 $siteId = $order->getSiteId();
225 $basketObject = $order->getBasket();
226 $listProductId = array();
228 foreach ($basketObject->getBasketItems() as $item)
229 $listProductId[] = $item->getProductId();
230
231 if(!$userId || empty($listProductId))
232 return;
233
234 $user = \CUser::getList('ID', 'ASC',
235 array('ID' => $userId) , array('FIELDS' => array('EMAIL'))
236 )->fetch();
237 if($user['EMAIL'])
238 {
239 $listSubscribe = static::getList(array(
240 'select' => array('ID'),
241 'filter' => array(
242 '=USER_CONTACT' => $user['EMAIL'],
243 '=SITE_ID' => $siteId,
244 'ITEM_ID' => $listProductId,
245 ),
246 ))->fetchAll();
247 $listSubscribeId = array();
248 foreach($listSubscribe as $subscribe)
249 $listSubscribeId[] = $subscribe['ID'];
250
251 static::unSubscribe($listSubscribeId);
252 }
253 }
254 }
255
263 public static function getContactTypes()
264 {
265 $contactTypes = array();
266
267 $event = new Event('catalog', static::EVENT_ADD_CONTACT_TYPE, array(&$contactTypes));
268 $event->send();
269
270 if(!is_array($contactTypes))
271 return array();
272
273 $availableFields = array('ID', 'NAME', 'RULE', 'HANDLER');
274 foreach($contactTypes as $typeId => $typeData)
275 {
276 $currentFields = array_keys($typeData);
277 $divergenceFields = array_diff($availableFields, $currentFields);
278 if(!empty($divergenceFields))
279 {
280 unset($contactTypes[$typeId]);
281 continue;
282 }
283 if(!is_string($typeData['NAME']) || !is_string($typeData['RULE']) || !is_callable($typeData['HANDLER']))
284 {
285 unset($contactTypes[$typeId]);
286 }
287 }
288
289 return $contactTypes;
290 }
291
298 public static function onAddContactType(&$contactTypes)
299 {
300 $contactTypes[static::CONTACT_TYPE_EMAIL] = array(
301 'ID' => static::CONTACT_TYPE_EMAIL,
302 'NAME' => Loc::getMessage('CONTACT_TYPE_EMAIL_NAME'),
303 'RULE' => '/@/i',
304 'HANDLER' => function(Event $event)
305 {
306 $eventData = $event->getParameters();
307 $eventObject = new \CEvent;
308 foreach($eventData as $userContact => $dataList)
309 {
310 foreach($dataList as $data)
311 {
312 $eventObject->send($data['EVENT_NAME'], $data['SITE_ID'], $data);
313 }
314 }
315 return true;
316 }
317 );
318 }
319
328 public static function onProductUpdate($productId, $fields)
329 {
330 return static::checkOldProductAvailable($productId, $fields);
331 }
332
340 public static function onProductSetAvailableUpdate($productId, $fields)
341 {
342 return static::checkOldProductAvailable($productId, $fields);
343 }
344
351 public static function runAgentToSendNotice($productId)
352 {
353 $productId = (int)$productId;
354 if ($productId <= 0)
355 return false;
356
357 $connection = Application::getConnection();
358 $helper = $connection->getSqlHelper();
359 $connection->queryExecute('update '.$helper->quote(static::getTableName()).' set '
360 .$helper->quote('NEED_SENDING').' = \'Y\' where '.$helper->quote('ITEM_ID').' = '.$productId
361 .' and ('.$helper->quote('DATE_TO').' is null or '.$helper->quote('DATE_TO').' > '
362 .$helper->getCurrentDateTimeFunction().')'
363 );
364
365 if (!static::$agentNoticeCreated)
366 {
367 $t = DateTime::createFromTimestamp(time() + static::AGENT_TIME_OUT);
368 static::$agentNoticeCreated = true;
369 \CAgent::AddAgent(
370 '\Bitrix\Catalog\SubscribeTable::sendNotice();',
371 'catalog',
372 'N',
373 static::AGENT_INTERVAL,
374 '',
375 'Y',
376 $t->toString(),
377 100,
378 false,
379 false
380 );
381 }
382
383 return true;
384 }
385
392 public static function runAgentToSendRepeatedNotice($productId)
393 {
394 $productId = (int)$productId;
395 if ($productId <= 0 || (string)Option::get('catalog', 'subscribe_repeated_notify') != 'Y')
396 return false;
397
398 $connection = Application::getConnection();
399 $helper = $connection->getSqlHelper();
400 $connection->queryExecute('update '.$helper->quote(static::getTableName()).' set '
401 .$helper->quote('NEED_SENDING').' = \'Y\' where '.$helper->quote('ITEM_ID').' = '.$productId
402 .' and ('.$helper->quote('DATE_TO').' is null or '.$helper->quote('DATE_TO').' > '
403 .$helper->getCurrentDateTimeFunction().')'
404 );
405
406 if (!static::$agentRepeatedNoticeCreated)
407 {
408 $t = DateTime::createFromTimestamp(time() + static::AGENT_TIME_OUT);
409 static::$agentRepeatedNoticeCreated = true;
410 \CAgent::AddAgent(
411 'Bitrix\Catalog\SubscribeTable::sendRepeatedNotice();',
412 'catalog',
413 'N',
414 static::AGENT_INTERVAL,
415 '',
416 'Y',
417 $t->toString(),
418 100,
419 false,
420 false
421 );
422 }
423
424 return true;
425 }
426
434 public static function checkPermissionSubscribe($subscribe)
435 {
436 return $subscribe == 'Y' || ($subscribe == 'D' && (string)Option::get('catalog', 'default_subscribe') == 'Y');
437 }
438
446 public static function setOldProductAvailable($productId, $available)
447 {
448 if(!$productId || !$available)
449 {
450 return false;
451 }
452
453 static::$oldProductAvailable[$productId]['AVAILABLE'] = $available;
454
455 return true;
456 }
457
463 public static function sendNotice()
464 {
465 if(static::checkLastUpdate())
466 return '\Bitrix\Catalog\SubscribeTable::sendNotice();';
467
468 list($listSubscribe, $totalCount) = static::getSubscriptionsData();
469
470 if(empty($listSubscribe))
471 {
472 static::$agentNoticeCreated = false;
473 return '';
474 }
475
476 $anotherStep = (int)$totalCount['CNT'] > static::LIMIT_SEND;
477
478 list($dataSendToNotice, $listNotifiedSubscribeId) =
479 static::prepareDataForNotice($listSubscribe, 'CATALOG_PRODUCT_SUBSCRIBE_NOTIFY');
480
481 static::startEventNotification($dataSendToNotice);
482
483 if($listNotifiedSubscribeId)
484 static::setNeedSending($listNotifiedSubscribeId);
485
486 if($anotherStep)
487 {
488 return '\Bitrix\Catalog\SubscribeTable::sendNotice();';
489 }
490 else
491 {
492 static::$agentNoticeCreated = false;
493 return '';
494 }
495 }
496
502 public static function sendRepeatedNotice()
503 {
504 if(static::checkLastUpdate())
505 return 'Bitrix\Catalog\SubscribeTable::sendRepeatedNotice();';
506
507 list($listSubscribe, $totalCount) = static::getSubscriptionsData();
508
509 if(empty($listSubscribe))
510 {
511 static::$agentRepeatedNoticeCreated = false;
512 return '';
513 }
514
515 $anotherStep = (int)$totalCount['CNT'] > static::LIMIT_SEND;
516
517 list($dataSendToNotice, $listNotifiedSubscribeId) =
518 static::prepareDataForNotice($listSubscribe, 'CATALOG_PRODUCT_SUBSCRIBE_NOTIFY_REPEATED');
519
520 static::startEventNotification($dataSendToNotice);
521
522 if($listNotifiedSubscribeId)
523 static::setNeedSending($listNotifiedSubscribeId);
524
525 if($anotherStep)
526 {
527 return 'Bitrix\Catalog\SubscribeTable::sendRepeatedNotice();';
528 }
529 else
530 {
531 static::$agentRepeatedNoticeCreated = false;
532 return '';
533 }
534 }
535
543 protected static function checkOldProductAvailable($productId, $fields)
544 {
545 $productId = (int)$productId;
546 if ($productId <= 0 || (empty(static::$oldProductAvailable[$productId]))
547 || !static::checkPermissionSubscribe($fields['SUBSCRIBE']))
548 {
549 return false;
550 }
551
552 if(static::$oldProductAvailable[$productId]['AVAILABLE'] == ProductTable::STATUS_NO
553 && $fields['AVAILABLE'] == ProductTable::STATUS_YES)
554 {
555 static::runAgentToSendNotice($productId);
556 }
557 elseif(static::$oldProductAvailable[$productId]['AVAILABLE'] == ProductTable::STATUS_YES
558 && $fields['AVAILABLE'] == ProductTable::STATUS_NO)
559 {
560 static::runAgentToSendRepeatedNotice($productId);
561 }
562
563 unset(static::$oldProductAvailable[$productId]);
564
565 return true;
566 }
567
573 protected static function checkLastUpdate()
574 {
575 $lastUpdate = ProductTable::getList(
576 array(
577 'select' => array('TIMESTAMP_X'),
578 'order' => array('TIMESTAMP_X' => 'DESC'),
579 'limit' => 1
580 )
581 )->fetch();
582 if (empty($lastUpdate) || !($lastUpdate['TIMESTAMP_X'] instanceof DateTime))
583 return true;
584
585 return (time() - $lastUpdate['TIMESTAMP_X']->getTimestamp() < static::AGENT_TIME_OUT);
586 }
587
588 protected static function getSubscriptionsData()
589 {
590 global $DB;
591
592 $filter = array(
593 '=NEED_SENDING' => 'Y',
594 '!=PRODUCT.SUBSCRIBE' => 'N',
595 array(
596 'LOGIC' => 'OR',
597 array('=DATE_TO' => false),
598 array('>DATE_TO' => date($DB->dateFormatToPHP(\CLang::getDateFormat('FULL')), time()))
599 )
600 );
601
602 /* Compatibility with the sale subscribe option */
603 $notifyOption = Option::get('sale', 'subscribe_prod');
604 $notify = array();
605 if($notifyOption <> '')
606 $notify = unserialize($notifyOption, ['allowed_classes' => false]);
607 if(is_array($notify))
608 {
609 $listSiteId = array();
610 foreach($notify as $siteId => $data)
611 {
612 if (($data['use'] ?? 'N') !== 'Y')
613 {
614 $listSiteId[] = $siteId;
615 }
616 }
617 if($listSiteId)
618 $filter['!=SITE_ID'] = $listSiteId;
619 }
620
621 $listSubscribe = static::getList(array(
622 'select'=>array(
623 'ID',
624 'USER_CONTACT',
625 'CONTACT_TYPE',
626 'DATE_TO',
627 'PRODUCT_NAME' => 'IBLOCK_ELEMENT.NAME',
628 'DETAIL_PAGE_URL' => 'IBLOCK_ELEMENT.IBLOCK.DETAIL_PAGE_URL',
629 'IBLOCK_ID' => 'IBLOCK_ELEMENT.IBLOCK_ID',
630 'TYPE' => 'PRODUCT.TYPE',
631 'ITEM_ID',
632 'SITE_ID',
633 'LANDING_SITE_ID',
634 'USER_NAME' => 'USER.NAME',
635 'USER_LAST_NAME' => 'USER.LAST_NAME',
636 ),
637 'filter' => $filter,
638 'limit' => static::LIMIT_SEND,
639 ))->fetchAll();
640
641 $totalCount = static::getList(array(
642 'select' => array('CNT'),
643 'filter' => $filter,
644 'runtime' => array(new Entity\ExpressionField('CNT', 'COUNT(*)'))
645 ))->fetch();
646
647 return array($listSubscribe, $totalCount);
648 }
649
650 protected static function prepareDataForNotice(array $listSubscribe, $eventName)
651 {
652 /* Preparation of data for the mail template */
653 $itemIdGroupByIblock = array();
654 foreach($listSubscribe as $key => $subscribeData)
655 $itemIdGroupByIblock[$subscribeData['IBLOCK_ID']][$subscribeData['ITEM_ID']] = $subscribeData['ITEM_ID'];
656
657 $detailPageUrlGroupByItemId = array();
658 if(!empty($itemIdGroupByIblock))
659 {
660 foreach($itemIdGroupByIblock as $iblockId => $listItemId)
661 {
662 $queryObject = \CIBlockElement::getList(array('ID'=>'ASC'),
663 array('IBLOCK_ID' => $iblockId, 'ID' => $listItemId), false, false, array('DETAIL_PAGE_URL'));
664 while($result = $queryObject->getNext())
665 $detailPageUrlGroupByItemId[$result['ID']] = $result['DETAIL_PAGE_URL'];
666 }
667 }
668
669 $dataSendToNotice = array();
670 $listNotifiedSubscribeId = array();
671 foreach($listSubscribe as $key => $subscribeData)
672 {
673 $pageUrl = self::getPageUrl($subscribeData, $detailPageUrlGroupByItemId);
674 if ($pageUrl == '')
675 {
676 continue;
677 }
678
679 $listNotifiedSubscribeId[] = $subscribeData['ID'];
680
681 $subscribeData['EVENT_NAME'] = $eventName;
682 $subscribeData['USER_NAME'] = $subscribeData['USER_NAME'] ?
683 $subscribeData['USER_NAME'] : Loc::getMessage('EMAIL_TEMPLATE_USER_NAME');
684 $subscribeData['EMAIL_TO'] = $subscribeData['USER_CONTACT'];
685 $subscribeData['NAME'] = $subscribeData['PRODUCT_NAME'];
686 $subscribeData['PAGE_URL'] = $pageUrl;
687 $subscribeData['PRODUCT_ID'] = $subscribeData['ITEM_ID'];
688 $subscribeData['CHECKOUT_URL'] = \CHTTP::urlAddParams($pageUrl, array(
689 'action' => 'BUY', 'id' => $subscribeData['PRODUCT_ID']));
690 $subscribeData['CHECKOUT_URL_PARAMETERS'] = \CHTTP::urlAddParams('', array(
691 'action' => 'BUY', 'id' => $subscribeData['PRODUCT_ID']));
692 $subscribeData['UNSUBSCRIBE_URL'] = \CHTTP::urlAddParams(
693 self::getUnsubscribeUrl($subscribeData),
694 array('unSubscribe' => 'Y', 'subscribeId' => $subscribeData['ID'],
695 'userContact' => $subscribeData['USER_CONTACT'], 'productId' => $subscribeData['PRODUCT_ID']));
696 $subscribeData['UNSUBSCRIBE_URL_PARAMETERS'] = \CHTTP::urlAddParams('',
697 array('unSubscribe' => 'Y', 'subscribeId' => $subscribeData['ID'],
698 'userContact' => $subscribeData['USER_CONTACT'], 'productId' => $subscribeData['PRODUCT_ID']));
699
700 $dataSendToNotice[$subscribeData['CONTACT_TYPE']][$subscribeData['USER_CONTACT']][$key] = $subscribeData;
701 }
702
703 return array($dataSendToNotice, $listNotifiedSubscribeId);
704 }
705
706 private static function getPageUrl(array $subscribeData, array $detailPageUrlGroupByItemId)
707 {
708 $pageUrl = "";
709
710 if (!empty($subscribeData['LANDING_SITE_ID']))
711 {
712 $pageUrl = Loader::includeModule('landing') ?
713 IblockConnector::getElementUrl($subscribeData['LANDING_SITE_ID'], $subscribeData['ITEM_ID']) : "";
714 }
715 elseif (!empty($detailPageUrlGroupByItemId[$subscribeData['ITEM_ID']]))
716 {
717 $pageUrl = self::getProtocol().self::getServerName($subscribeData['SITE_ID']).
718 $detailPageUrlGroupByItemId[$subscribeData['ITEM_ID']];
719 }
720
721 return $pageUrl;
722 }
723
724 private static function getUnsubscribeUrl(array $subscribeData)
725 {
726 if (!empty($subscribeData['LANDING_SITE_ID']))
727 {
728 $unsubscribeUrl = '';
729 if (Loader::includeModule('landing'))
730 {
731 $unsubscribeUrl = \Bitrix\Landing\Syspage::getSpecialPage(
732 $subscribeData['LANDING_SITE_ID'],
733 'personal',
734 ['SECTION' => 'subscribe']
735 );
736 }
737 }
738 else
739 {
740 $unsubscribeUrl = self::getProtocol().self::getServerName(
741 $subscribeData['SITE_ID']).'/personal/subscribe/';
742 }
743
744 return $unsubscribeUrl;
745 }
746
747 private static function getProtocol()
748 {
749 $currentApplication = Application::getInstance();
750 $context = $currentApplication->getContext();
751
752 if ($protocol = Option::get('main', 'mail_link_protocol'))
753 {
754 if (mb_strrpos($protocol, '://') === false)
755 $protocol .= '://';
756 }
757 else
758 {
759 if ($context->getServer()->getServerName())
760 {
761 $protocol = ($context->getRequest()->isHttps() ? 'https://' : 'http://');
762 }
763 else
764 {
765 $protocol = 'https://';
766 }
767 }
768
769 unset($currentApplication);
770 unset($context);
771
772 return $protocol;
773 }
774
775 private static function getServerName($siteId)
776 {
777 $serverName = '';
778 $iterator = \CSite::GetByID($siteId);
779 $site = $iterator->fetch();
780 unset($iterator);
781 if (!empty($site))
782 $serverName = (string)$site['SERVER_NAME'];
783 unset($site);
784 if ($serverName == '')
785 {
786 $serverName = (defined('SITE_SERVER_NAME') && SITE_SERVER_NAME != '' ?
787 SITE_SERVER_NAME : (string)Option::get('main', 'server_name', '', $siteId)
788 );
789 if ($serverName == '')
790 {
791 $currentApplication = Application::getInstance();
792 $context = $currentApplication->getContext();
793 $serverName = $context->getServer()->getServerName();
794 unset($currentApplication);
795 unset($context);
796 }
797 }
798
799 return $serverName;
800 }
801
802 protected static function startEventNotification(array $dataSendToNotice)
803 {
804 $contactTypes = static::getContactTypes();
805 foreach($contactTypes as $typeId => $typeData)
806 {
807 if (empty($dataSendToNotice[$typeId]))
808 {
809 continue;
810 }
811
812 $eventKey = EventManager::getInstance()
813 ->addEventHandler('catalog', 'OnSubscribeSubmit', $typeData['HANDLER']);
814
815 $event = new Event('catalog', 'OnSubscribeSubmit', $dataSendToNotice[$typeId]);
816 $event->send();
817
818 EventManager::getInstance()->removeEventHandler('catalog', 'OnSubscribeSubmit', $eventKey);
819 }
820 }
821
822 private static function setNeedSending(array $listSubscribeId, $needSending = 'N')
823 {
824 if(empty($listSubscribeId))
825 return;
826
827 $connection = Application::getConnection();
828 $helper = $connection->getSqlHelper();
829 $connection->queryExecute('update '.$helper->quote(static::getTableName()).' set '
830 .$helper->quote('NEED_SENDING').' = \''.$needSending.'\' where '
831 .$helper->quote('ID').' in ('.implode(',', $listSubscribeId).')'
832 );
833 }
834
835 private static function unSubscribe(array $listSubscribeId)
836 {
837 if(empty($listSubscribeId))
838 return;
839
840 $connection = Application::getConnection();
841 $helper = $connection->getSqlHelper();
842 $connection->queryExecute('update '.$helper->quote(static::getTableName()).' set '
843 .$helper->quote('NEED_SENDING').' = \'N\', '.$helper->quote('DATE_TO').' ='
844 .$helper->getCurrentDateTimeFunction().' where '
845 .$helper->quote('ID').' in ('.implode(',', $listSubscribeId).')'
846 );
847 }
848}
$connection
Определения actionsdefinitions.php:38
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения check_mail.php:18
const STATUS_YES
Определения product.php:66
const STATUS_NO
Определения product.php:67
static onProductUpdate($productId, $fields)
Определения subscribe.php:328
static checkOldProductAvailable($productId, $fields)
Определения subscribe.php:543
static prepareDataForNotice(array $listSubscribe, $eventName)
Определения subscribe.php:650
const LIMIT_SEND
Определения subscribe.php:57
static getMap()
Определения subscribe.php:80
static validateSiteId()
Определения subscribe.php:156
const AGENT_TIME_OUT
Определения subscribe.php:58
static onProductSetAvailableUpdate($productId, $fields)
Определения subscribe.php:340
const CONTACT_TYPE_EMAIL
Определения subscribe.php:56
static sendNotice()
Определения subscribe.php:463
static validateNeedSending()
Определения subscribe.php:144
static checkPermissionSubscribe($subscribe)
Определения subscribe.php:434
static getSubscriptionsData()
Определения subscribe.php:588
static sendRepeatedNotice()
Определения subscribe.php:502
static setOldProductAvailable($productId, $available)
Определения subscribe.php:446
static onUserDelete($userId)
Определения subscribe.php:169
static checkLastUpdate()
Определения subscribe.php:573
static onAddContactType(&$contactTypes)
Определения subscribe.php:298
const AGENT_INTERVAL
Определения subscribe.php:59
static getContactTypes()
Определения subscribe.php:263
const EVENT_ADD_CONTACT_TYPE
Определения subscribe.php:54
static runAgentToSendRepeatedNotice($productId)
Определения subscribe.php:392
static startEventNotification(array $dataSendToNotice)
Определения subscribe.php:802
static runAgentToSendNotice($productId)
Определения subscribe.php:351
static getTableName()
Определения subscribe.php:70
static onIblockElementDelete($productId)
Определения subscribe.php:192
static getList(array $parameters=array())
Определения datamanager.php:431
static urlAddParams($url, $add_params, $options=[])
Определения http.php:521
$data['IS_AVAILABLE']
Определения .description.php:13
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14
$protocol
Определения .description.php:9
$iblockId
Определения iblock_catalog_edit.php:30
$filter
Определения iblock_catalog_list.php:54
global $DB
Определения cron_frame.php:29
$context
Определения csv_new_setup.php:223
$siteId
Определения ajax.php:8
Определения ufield.php:9
$user
Определения mysql_to_pgsql.php:33
Определения buffer.php:3
$order
Определения payment.php:8
$event
Определения prolog_after.php:141
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
if(empty($signedUserToken)) $key
Определения quickway.php:257
$totalCount
Определения subscription_card_product.php:51
$iterator
Определения yandex_run.php:610
$site
Определения yandex_run.php:614
$fields
Определения yandex_run.php:501