<?
$arSelect = Array(
'IBLOCK_ID',
'ID',
'NAME',
'CODE'
);
$arFilter = Array(
'ID' => $arResult['PROPERTIES']['CML2_COLLECTION']['VALUE']
);
$db_res = CIBlockElement::GetList(Array(), $arFilter, false, false, $arSelect);
if($arElement = $db_res->GetNext()) {
$CODE = $arElement['CODE'];
$NAME = $arElement['NAME'];
}
?>
<?
$arSelect = Array(
'ID',
'CODE', 'NAME'
);
$arFilter = Array(
'IBLOCK_ID'=> $arResult['IBLOCK_ID'],
'ID' => $arResult['IBLOCK_SECTION_ID']
);
$db_res = CIBlockSection::GetList(
Array(),
$arFilter,
true,
$arSelect
);
if ($ar_result = $db_res->GetNext()) {
$CODE = $ar_result['CODE'];
$NAME = $ar_result['NAME'];
}
?>
print('<pre>'.print_r((array)$arResult,true).'</pre>');
die('<pre>'.print_r((array)$ar_result,true).'</pre>');