I
I
iberk2017-02-16 16:06:17
1C-Bitrix
iberk, 2017-02-16 16:06:17

Pagination not showing. How to enable it?

Hello! Help solve the problem - in the "search" component, pagination is not displayed at all under any circumstances. Where can you look for a solution?


<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
$APPLICATION->SetTitle("Поиск");
?>
<?$arElements = $APPLICATION->IncludeComponent(
"bitrix:search.page",
"my_search",
array(
"AJAX_MODE" => "N",
"RESTART" => "Y",
"CHECK_DATES" => "N",
"USE_TITLE_RANK" => "N",
"DEFAULT_SORT" => "rank",
"arrWHERE" => "",
"arrFILTER" => array(
0 => "iblock_catalog",
),
"SHOW_WHERE" => "N",
"PAGE_RESULT_COUNT" => "50",
"CACHE_TYPE" => "N",
"CACHE_TIME" => "36000000",
"PAGER_TITLE" => "Результаты поиска",
"PAGER_SHOW_ALWAYS" => "Y",
"PAGER_TEMPLATE" => "",
"AJAX_OPTION_SHADOW" => "Y",
"AJAX_OPTION_JUMP" => "N",
"AJAX_OPTION_STYLE" => "Y",
"AJAX_OPTION_HISTORY" => "N",
"COMPONENT_TEMPLATE" => "my_search",
"NO_WORD_LOGIC" => "Y",
"FILTER_NAME" => "",
"SHOW_WHEN" => "N",
"AJAX_OPTION_ADDITIONAL" => "",
"USE_LANGUAGE_GUESS" => "N",
"USE_SUGGEST" => "N",
"DISPLAY_TOP_PAGER" => "Y",
"DISPLAY_BOTTOM_PAGER" => "Y",
"arrFILTER_iblock_catalog" => array(
0 => "3",
)
),
false
);?>
<?
if (true)
{
global $searchFilter;
if (!empty($arElements) && is_array($arElements))
{
$searchFilter['ID'] = $arElements;
}
elseif (!empty($_REQUEST['q']))
{
$searchFilter['PROPERTY_CML2_ARTICLE'] = '%'.$_REQUEST['q'].'%';
}
///print_r($searchFilter);
if(empty($searchFilter)) $searchFilter['ID'] = -1;
$APPLICATION->IncludeComponent(
"bitrix:catalog.section",
"catalog_items",
array(
"IBLOCK_TYPE" => "catalog",
"IBLOCK_ID" => "3",
"PAGE_ELEMENT_COUNT" => "12",
"LINE_ELEMENT_COUNT" => "4",
"ELEMENT_SORT_FIELD" => "sort",
"ELEMENT_SORT_ORDER" => "asc",
"ELEMENT_SORT_FIELD2" => "id",
"ELEMENT_SORT_ORDER2" => "desc",
"PROPERTY_CODE" => array(
0 => "DAY_SPECIAL",
1 => "NOVELTY",
2 => "SALE",
3 => "HIT",
4 => "CML2_ARTICLE",
5 => "STYLE",
6 => "TYPE",
7 => "BRAND",
8 => "IN_STORE",
9 => "",
),
"OFFERS_CART_PROPERTIES" => "",
"OFFERS_FIELD_CODE" => "",
"OFFERS_PROPERTY_CODE" => "",
"OFFERS_SORT_FIELD" => "",
"OFFERS_SORT_ORDER" => "",
"OFFERS_SORT_FIELD2" => "",
"OFFERS_SORT_ORDER2" => "",
"OFFERS_LIMIT" => 0,
"SECTION_URL" => "",
"DETAIL_URL" => "",
"BASKET_URL" => "",
"ACTION_VARIABLE" => "",
"PRODUCT_ID_VARIABLE" => "",
"PRODUCT_QUANTITY_VARIABLE" => "",
"PRODUCT_PROPS_VARIABLE" => "",
"SECTION_ID_VARIABLE" => "",
"CACHE_TYPE" => "A",
"CACHE_TIME" => 360,
"DISPLAY_COMPARE" => "N",
"PRICE_CODE" => array('BASE'),
"USE_PRICE_COUNT" => "N",
"SHOW_PRICE_COUNT" => "1",
"PRICE_VAT_INCLUDE" => "N",
"PRODUCT_PROPERTIES" => "",
"USE_PRODUCT_QUANTITY" => "N",
"ADD_PROPERTIES_TO_BASKET" => (isset($arParams["ADD_PROPERTIES_TO_BASKET"]) ? $arParams["ADD_PROPERTIES_TO_BASKET"] : ''),
"PARTIAL_PRODUCT_PROPERTIES" => (isset($arParams["PARTIAL_PRODUCT_PROPERTIES"]) ? $arParams["PARTIAL_PRODUCT_PROPERTIES"] : ''),
"CONVERT_CURRENCY" => "N",
"CURRENCY_ID" => "RUB",
"HIDE_NOT_AVAILABLE" => "N",
"DISPLAY_TOP_PAGER" => "N",
"DISPLAY_BOTTOM_PAGER" => "Y",
"PAGER_TITLE" => "Товары",
"PAGER_SHOW_ALWAYS" => "N",
"PAGER_TEMPLATE" => "modern",
"PAGER_DESC_NUMBERING" => "N",
"PAGER_DESC_NUMBERING_CACHE_TIME" => 3600,
"PAGER_SHOW_ALL" => "N",
"FILTER_NAME" => "searchFilter",
"SECTION_ID" => "",
"SECTION_CODE" => "",
"SECTION_USER_FIELDS" => array(),
"INCLUDE_SUBSECTIONS" => "Y",
"SHOW_ALL_WO_SECTION" => "Y",
"META_KEYWORDS" => "",
"META_DESCRIPTION" => "",
"BROWSER_TITLE" => "",
"ADD_SECTIONS_CHAIN" => "N",
"SET_TITLE" => "N",
"SET_STATUS_404" => "N",
"CACHE_FILTER" => "N",
"CACHE_GROUPS" => "N",
'LABEL_PROP' => $arParams['LABEL_PROP'],
'ADD_PICT_PROP' => $arParams['ADD_PICT_PROP'],
'PRODUCT_DISPLAY_MODE' => $arParams['PRODUCT_DISPLAY_MODE'],
'OFFER_ADD_PICT_PROP' => $arParams['OFFER_ADD_PICT_PROP'],
'OFFER_TREE_PROPS' => $arParams['OFFER_TREE_PROPS'],
'PRODUCT_SUBSCRIPTION' => $arParams['PRODUCT_SUBSCRIPTION'],
'SHOW_DISCOUNT_PERCENT' => $arParams['SHOW_DISCOUNT_PERCENT'],
'SHOW_OLD_PRICE' => $arParams['SHOW_OLD_PRICE'],
'MESS_BTN_BUY' => $arParams['MESS_BTN_BUY'],
'MESS_BTN_ADD_TO_BASKET' => $arParams['MESS_BTN_ADD_TO_BASKET'],
'MESS_BTN_SUBSCRIBE' => $arParams['MESS_BTN_SUBSCRIBE'],
'MESS_BTN_DETAIL' => $arParams['MESS_BTN_DETAIL'],
'MESS_NOT_AVAILABLE' => $arParams['MESS_NOT_AVAILABLE'],
'TEMPLATE_THEME' => $arParams['TEMPLATE_THEME'],
'ADD_TO_BASKET_ACTION' => (isset($arParams['ADD_TO_BASKET_ACTION']) ? $arParams['ADD_TO_BASKET_ACTION'] : ''),
'SHOW_CLOSE_POPUP' => (isset($arParams['SHOW_CLOSE_POPUP']) ? $arParams['SHOW_CLOSE_POPUP'] : ''),
'COMPARE_PATH' => $arParams['COMPARE_PATH']
),
$arResult["THEME_COMPONENT"]
);
}
else
{
echo GetMessage("CT_BCSE_NOT_FOUND");
}
?>
<?/**/?><?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");?>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Burlaka, 2017-02-16
@AlexeyGfi

When navigation is enabled, the bitrix:system.pagenavigation component is processed .
1. You have in one place PAGER_TEMPLATE empty == the .default template should be included . Copy (customize) the component's .default template into your namespace and see if it gets called at all and what is passed to it. So leave it .default - the system will simply redirect from the built-in component to yours.
2. In the second place you have PAGER_TEMPLATE => modern . The same actions, only instead of .default - modern .

I
iberk, 2017-02-17
@iberk

Thank you! The problem was not even PAGER_TEMPLATE, but in the component template my_search. People who at one time refined the functionality of this site were smart ... If I return the default (from Bitrix) content of the template.php file, 2 blocks appear in the search results, the first block with pagination, but in the form of search strings (and since this is the Internet -shop, you need to issue exactly products with photos and a buy button) and below is the same block but with photos and without pagination - to be honest, I'm already confused, I want to figure it out of course ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question