Answer the question
In order to leave comments, you need to log in
How to count the number of products per page?
There is a code that, in principle, counts the number of goods, but if you put a filter on the brand, then the number does not change in any way.
$count = 12;
if (isset($_GET['count'])) {
$count = $_GET['count'];
if ($_GET['count']==='showAll')
$count=1000000000;
}
if (isset($_GET["sort"])) {
$arParams["ELEMENT_SORT_FIELD"] = $_GET["sort"];
$arParams["ELEMENT_SORT_ORDER"]= $_GET["order"];
}
$el = CIBlockElement::GetList(array('sort'=>'asc'),
array('IBLOCK_ID'=>$arParams['IBLOCK_ID'],
'IBLOCK_SECTION_ID'=>$sec['ID']),
false, false,
array('ID', 'NAME', ));
while ($elem = $el->GetNext()){
global $elements;
$elements[] = $elem;
}
<b class="middle "> =count($elements)</b>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question