1С-Битрикс
25
Вклад в тег
AddEventHandler("iblock", "OnBeforeIBlockElementUpdate", "DoNotUpdate");
function DoNotUpdate(&$arFields)
{
if ($_REQUEST['mode'] == 'import') {
if (isset($_GET['type'], $_GET['mode']) && $_GET['type'] === 'catalog' && $_GET['mode'] === 'import') {
unset($arFields['PREVIEW_PICTURE']);
unset($arFields['DETAIL_PICTURE']);
}
}
}
AddEventHandler("iblock", "OnBeforeIBlockElementUpdate", "DoNotUpdate");
function DoNotUpdate(&$arFields)
{
if ($_REQUEST['mode'] == 'import') {
if (isset($_GET['type'], $_GET['mode']) && $_GET['type'] === 'catalog' && $_GET['mode'] === 'import') {
unset($arFields['PREVIEW_PICTURE']);
unset($arFields['DETAIL_PICTURE']);
}
}
}
$arSelect = Array("ID", "IBLOCK_ID", "NAME", "DATE_ACTIVE_FROM","PROPERTY_*");//IBLOCK_ID и ID обязательно должны быть указаны, см. описание arSelectFields выше
$arFilter = Array("IBLOCK_ID"=>IntVal($yvalue), "ACTIVE_DATE"=>"Y", "ACTIVE"=>"Y");
$res = CIBlockElement::GetList(Array(), $arFilter, false, Array("nPageSize"=>50), $arSelect);
while($ob = $res->GetNextElement()){
$arFields = $ob->GetFields();
print_r($arFields);
$arProps = $ob->GetProperties();
print_r($arProps);
}