<?
$arSelect = Array("ID", "NAME", "DETAIL_PAGE_URL", "IBLOCK_ID");
$arFilter = Array("IBLOCK_ID"=>2, "ACTIVE_DATE"=>"Y", "ACTIVE"=>"Y", "PROPERTY_SALELEADER_VALUE"=>"да");
$res = CIBlockElement::GetList(Array(), $arFilter, false, Array("nPageSize"=>50), $arSelect);
while($ob = $res->GetNextElement())
{
$arFields = $ob->GetFields();
print_r($arFields);
}
?>
//Пользовательские поля из POST-запроса
//допустим у вас есть имя и телефон и есть в заказе 2 свойства
// Устанавливаем свойства
$propertyCollection = $order->getPropertyCollection();
$phoneProp = $propertyCollection->getPhone();
$phoneProp->setValue($_POST'phone']);
$nameProp = $propertyCollection->getPayerName();
$nameProp->setValue($_POST'[name']);
while($elem = $basket->getNext()){
$el = CIBlockElement::GetList( [], ["ID"=>$elem['PRODUCT_ID']], false, false, ["ID","DETAIL_PICTURE"])->fetch();
if($el['DETAIL_PICTURE']>0) $file = CFile::ResizeImageGet($el['DETAIL_PICTURE'], array('width'=>150, 'height'=>150), BX_RESIZE_IMAGE_PROPORTIONAL, true);
}
$elements = [];
CModule::IncludeModule("catalog");
$my_slider = CIBlockElement::GetList (
Array("NAME" => "ASC"),
Array("IBLOCK_ID" => 1),
false,
false,
Array(
'ID',
'NAME',
)
);
while($ar_fields = $my_slider->GetNext())
{
$elements[] = $ar_fields;
}
$productID = array_column($elements, 'ID');
$arSKU = CCatalogSKU::getOffersList(
$productID,
0,
array('ACTIVE' => 'Y'),
array('ID', 'NAME', 'CODE'),
array()
);
foreach ($elements as $element) {
echo $element['NAME'] . '</br>';
if ($arSKU[$element['ID']]) {
foreach ($arSKU[$element['ID']] as $offer) {
echo $offer['CODE'] . '<br>';
}
}
}
$elementId = 123; // замените 123 на нужный вам ID элемента
$res = CIBlockElement::GetByID($elementId);
if($ar_res = $res->GetNext()) {
$sectionId = $ar_res['IBLOCK_SECTION_ID'];
$arSection = CIBlockSection::GetByID($sectionId)->GetNext();
$rootSectionId = $arSection['IBLOCK_SECTION_ID'];
// Получение информации о корневом разделе
$arRootSection = CIBlockSection::GetByID($rootSectionId)->GetNext();
echo $arRootSection['NAME'];
}