D
D
Dmitry Grabko2021-02-11 11:04:16
1C-Bitrix
Dmitry Grabko, 2021-02-11 11:04:16

Cancellation of the deactivation of sections missing in the unloading from 1C?

The site has separate sections for linking products. These sections are not in 1C and will not be. When you start a full unload, after the exchange, the partitions are deactivated.

The option - What to do with groups missing in the import file: nothing is enabled in the site settings.

I tried to disable it in the handler (init.php) and the exchange still disables the section.

AddEventHandler("iblock", "OnBeforeIBlockSectionUpdate","DoNotDeactivate");
function DoNotDeactivate(&$arFields)
{
   if ($_REQUEST['mode']=='import')
 {
      $arFields['ACTIVE'] == "Y";
   }
}


#Отмена отключение по свойству тип UF

AddEventHandler("iblock", "OnBeforeIBlockSectionUpdate","DoNotDeactivate");
AddEventHandler("iblock", "OnAfterIBlockSectionUpdate ","DoNotDeactivate");
function DoNotDeactivate(&$arFields)
{
   
   if ($arFields['UF_TAGS'] == 1) {
      unset($arFields['ACTIVE']);
   }
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question