Answer the question
In order to leave comments, you need to log in
How to display a list of products by property in bitrix?
Tell me how to display a list of products by the value of one of the properties
here is an example
$arSelect = Array("ID", "IBLOCK_ID", "NAME", "DATE_ACTIVE_FROM","PROPERTY_*");
$arFilter = Array(
"IBLOCK_ID" => 1,
"ACTIVE_DATE" => "Y",
"ACTIVE" => "Y",
"PROPERTY_ATT_AGE" => '23',
);
$res = CIBlockElement::GetList( [] , $arFilter , false , [ "nPageSize" => 6 ] , $arSelect );
array(4) {
["ID"]=>
string(2) "22"
["IBLOCK_ID"]=>
string(1) "1"
["NAME"]=>
string(41) "Какой то продукт"
["DATE_ACTIVE_FROM"]=>
NULL
}
Answer the question
In order to leave comments, you need to log in
In the $arSelect array, specify which fields and properties you need. To get the id of the images in your example, replace $arSelect with this
$arSelect = Array(
"ID",
"IBLOCK_ID",
"NAME",
"DATE_ACTIVE_FROM",
"DETAIL_PICTURE",
"PREVIEW_PICTURE",
"PROPERTY_*",
);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question