Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
presethandler.php
1<?php
2
4
6{
20 public static function register(): bool
21 {
22 $eventManager = \Bitrix\Main\EventManager::getInstance();
23 $eventManager->registerEventHandler("main", "OnProlog", "catalog", "\Bitrix\Catalog\Component\PresetHandler", "onProlog");
24 return true;
25 }
26
31 public static function unRegister(): bool
32 {
33 $eventManager = \Bitrix\Main\EventManager::getInstance();
34 $eventManager->unRegisterEventHandler("main", "OnProlog", "catalog", "\Bitrix\Catalog\Component\PresetHandler", "OnProlog");
35 return true;
36 }
37
43 public static function onProlog(): void
44 {
45 \Bitrix\Main\UI\Extension::load(['catalog.store-use']);
46
48 {
50 }
51
52 $content = "
53 <script>
54 var controller = new BX.Catalog.StoreUse.Controller();
55
56 controller.inventoryManagementAnalyticsFromLanding();
57 </script>
58 ";
59
60 global $APPLICATION;
61 $APPLICATION->AddViewContent("inline-scripts", $content);
62 }
63}