R
R
Rustamka Vorontsov2015-10-08 23:37:24
1C-Bitrix
Rustamka Vorontsov, 2015-10-08 23:37:24

How to display popular Bitrix elements?

$arFilter = Array("IBLOCK_ID"=>2, "ACTIVE_DATE"=>"Y", "ACTIVE"=>"Y", "PROPERTY_SALELEADER_VALUE_XML_ID"=>"YYY");
$result = CIBlockElement::GetList(Array(), $arFilter, false, Array("nTopCount"=>7), Array());

Custom property SALELEADER
kDfPE.pngkDfVK.png
Even it doesn't work =(
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Novikov, 2015-10-08
@rmfordev

however, how sure do you want to filter by value_xml_id when there is no filter by that value :)
filter by property value. and since you use Cyrillic, then follow the encoding.

<?
$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);
}
?>

getlist documentation
About sorting in Bitrix , incl. by popularity

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question