Answer the question
In order to leave comments, you need to log in
How to get the elements associated with the current element?
Hello!
How to get the elements associated with the current one?
Let's say there are 2 infoblocks: products and brands.
products have a "brand" field (type - "Binding to elements in the form of a list") in which you can select a brand.
how to display products related to it on the page of a specific brand?
Answer the question
In order to leave comments, you need to log in
$arSelect = Array("*");
$arFilter = Array("IBLOCK_ID"=>$IBLOCK_ID, "PROPERTY_BRAND"=>$BRAND_ID);
$res = CIBlockElement::GetList(Array(), $arFilter, false, Array(), $arSelect);
while($ob = $res->GetNextElement()) {
$arFields = $ob->GetFields();
print_r($arFields);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question