Answer the question
In order to leave comments, you need to log in
Why does Bitrix make data secure?
I turn off the activity of goods from the 1C database through processing in Bitrix init.php
Sometimes, after the import from the database is completed, Bitrix makes the php code safe and, so to speak, cuts out part of the code altogether.
here is the whole init.php code, tell me
what could be?
Put an exception in the proactive filter /bitrix/php_interface/*
<?
AddEventHandler('catalog', 'OnSuccessCatalogImport1C', 'DeleteCatalogItems');
function DeleteCatalogItems()
{
$IBLOCK_ID = 52;
if(CModule::IncludeModule("catalog") && CModule::IncludeModule("iblock")){
$arSelect = Array("ID", "IBLOCK_ID", "NAME", "AKTIVNOST_NA_SAYTE");
$arFilter = Array("IBLOCK_ID"=>IntVal($IBLOCK_ID), "ACTIVE"=>"Y", "!AKTIVNOST_NA_SAYTE"=>false);
$res = CIBlockElement::GetList(Array(), $arFilter, false, false, $arSelect);
while($ob = $res->GetNextElement()){
$arProps = $ob->GetProperties();
if ($arProps['AKTIVNOST_NA_SAYTE']['VALUE'] <> 'Да') {
$arFields = $ob->GetFields();
if(CIBlock::GetPermission($IBLOCK_ID)>='W')
{
$obEl = new CIBlockElement();
$boolResult = $obEl->Update($arFields['ID'],array('ACTIVE' => 'N'));
}
}
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question