1
0
Fork 0
mirror of synced 2025-04-04 06:13:32 +03:00

correct unregister event

This commit is contained in:
anton 2024-10-23 14:38:05 +03:00
parent 95dbf4120d
commit 81ca21634b

View file

@ -16,7 +16,6 @@ use Bitrix\Main\UserConsent\Internals\AgreementTable;
use Bitrix\Sale\Internals\OrderPropsGroupTable;
use Bitrix\Sale\Internals\OrderPropsTable;
use Bitrix\Sale\Internals\PersonTypeTable;
use Intaro\RetailCrm\Component\Advanced\LoyaltyInstaller;
/**
* Class ToModuleTable
@ -1180,13 +1179,14 @@ function update()
{
Loader::includeModule('sale');
Loader::includeModule('highloadblock');
$loyaltyEventClass = 'Intaro\RetailCrm\Component\Handlers\EventsHandlers';
COption::SetOptionString('intaro.retailcrm', 'api_version', 'v5');
RegisterModuleDependences('sale', 'OnSaleOrderSaved', 'intaro.retailcrm', 'RetailCrmEvent', 'orderSave', 99);
if (Option::get('intaro.retailcrm', 'loyalty_program_toggle') !== 'Y') {
$loyalty = new LoyaltyInstaller();
$loyalty->deleteLPEvents();
UnRegisterModuleDependences('sale', 'OnSaleOrderSaved', 'intaro.retailcrm', $loyaltyEventClass, 'OnSaleOrderSavedHandler');
UnRegisterModuleDependences('sale', 'OnSaleComponentOrderResultPrepared', 'intaro.retailcrm', $loyaltyEventClass, 'OnSaleComponentOrderResultPreparedHandler');
}
}