Answer the question
In order to leave comments, you need to log in
How to eliminate duplicates and calculate the total number of elements?
Here is the code that displays the element IDs.
How to exclude duplicates from it and calculate the total number of elements?
<?
$arSelect = Array('ID',"PROPERTY_OTHER_COLORS");
$arFilter = Array("IBLOCK_ID"=>8, 'SECTION_ID'=>2208,"ACTIVE_DATE"=>"Y", "ACTIVE"=>"Y", '>=CATALOG_QUANTITY' => 1);
$res_count = CIBlockElement::GetList(Array(), $arFilter, Array(), Array("nPageSize"=>50), $arSelect);
$res = CIBlockElement::GetList(Array(), $arFilter, false, Array("nPageSize"=>900), $arSelect);
while($ob = $res->GetNextElement()){
$arFields = $ob->GetFields();
print_r ($arFields[ID]);
echo "</br>";
}
?>
40413
40413
40414
40414
40420
40422
40422
40422
Answer the question
In order to leave comments, you need to log in
Well, there is no such element, so there is nowhere to get the text from. Make a check
let textr = '';
if (runRo && runRo.length > 0) {
textr = runRo.innerHTML;
}
$arSelect = Array('ID');
$arFilter = Array("IBLOCK_ID"=>8, 'SECTION_ID'=>2208,"ACTIVE_DATE"=>"Y", "ACTIVE"=>"Y", '>=CATALOG_QUANTITY' => 1);
$res = CIBlockElement::GetList(Array(), $arFilter, false, Array("nPageSize"=>900), $arSelect);
while($ob = $res->GetNextElement()){
$arFields = $ob->GetFields();
print_r ($arFields[ID]);
echo "</br>";
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question