S
S
sk8er_boi2018-05-31 14:57:56
1C-Bitrix
sk8er_boi, 2018-05-31 14:57:56

Displaying the number of products in the Bitrix section?

In the settings of the complex infoblock (/catalog/index.php) is

<?php

$APPLICATION->IncludeComponent(
  "bitrix:catalog", 
  "название_шаблона", 
  array(
    ...,
    "PAGE_ELEMENT_COUNT" => "32",
    ...
  ),
  false
);

?>

In settings /site_template/components/bitrix/catalog/template_name/section.php
<?php

$page_element_count = isset($_GET['count']) ? $_GET['count'] : $arParams["PAGE_ELEMENT_COUNT"];

$APPLICATION->IncludeComponent(
  "bitrix:catalog.section",
  "",
  array(
    ...,
    "PAGE_ELEMENT_COUNT" => $page_element_count,
    ...
  ),
  $component
);

?>

In the /site_template/components/bitrix/catalog/template_name/catelog.section/.default/ component, not a single file affects the $arParams['PAGE_ELEMENT_COUNT'] parameter and there is no number "20" (sorry, I was and will be a noob in the bitr =).
In the admin panel Files and folders > /catalog/ > Component settings, of course, the number "32" is displayed.
Dropped cache.
I test, of course, without a get request, although everything works with it according to the desired scenario.
20 pieces are displayed in the front. Invariably. Without a get.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
sk8er_boi, 2018-05-31
@sk8er_boi

The cant was found in an overly meticulous check of the $_GET value for cipher, as a result of which null was returned in $page_element_count if the get was not set. In short, not all the code posted. [email protected] Alexander Filippenko for help!

A
Alexander Filippenko, 2018-05-31
@alexfilus

Since the standard template works correctly, then the parameters are set correctly, the point is in the code of the template itself.
Is there something in result_modifier.php?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question