Answer the question
In order to leave comments, you need to log in
How to overcome 404 error when filtering at the root of a directory?
Please help me solve the problem, filtering in sections by ajax works without any problems, and at the root it gives a 404 error in the
GET console https://site.ru/catalog/filter/min_price-to-31/apply/ 404
And if you go to this page, everything works fine.
catalog.smart.filter:
$APPLICATION->IncludeComponent("bitrix:catalog.smart.filter", "bootstrap_v4", array(
"IBLOCK_TYPE" => $arParams["IBLOCK_TYPE"],
"IBLOCK_ID" => $arParams["IBLOCK_ID"],
"SECTION_ID" => 0,
"FILTER_NAME" => $arParams["FILTER_NAME"],
"PRICE_CODE" => [], // т.к. фильтруем по мин цене как св-ву
"CACHE_TYPE" => $arParams["CACHE_TYPE"],
"CACHE_TIME" => $arParams["CACHE_TIME"],
"CACHE_GROUPS" => $arParams["CACHE_GROUPS"],
"SAVE_IN_SESSION" => "N",
"FILTER_VIEW_MODE" => $arParams["FILTER_VIEW_MODE"],
"XML_EXPORT" => "N",
"SECTION_TITLE" => "NAME",
"SECTION_DESCRIPTION" => "DESCRIPTION",
'HIDE_NOT_AVAILABLE' => $arParams["HIDE_NOT_AVAILABLE"],
"TEMPLATE_THEME" => $arParams["TEMPLATE_THEME"],
'CONVERT_CURRENCY' => $arParams['CONVERT_CURRENCY'],
'CURRENCY_ID' => $arParams['CURRENCY_ID'],
"SEF_MODE" => $arParams["SEF_MODE"],
"SEF_RULE" => '/catalog/filter/#SMART_FILTER_PATH#/apply/',
"SMART_FILTER_PATH" => $_REQUEST["SMART_FILTER_PATH"],
'SHOW_ALL_WO_SECTION'=>'Y',
'SHOW_ALL_WO_SECTION'=> $SHOW_ALL_WO_SECTION,
"PAGER_PARAMS_NAME" => $arParams["PAGER_PARAMS_NAME"],
"INSTANT_RELOAD" => $arParams["INSTANT_RELOAD"],
),
$component,
array('HIDE_ICONS' => 'Y')
);
12 =>
array (
'CONDITION' => '#^/catalog/#',
'RULE' => '',
'ID' => 'bitrix:catalog',
'PATH' => '/catalog/index.php',
'SORT' => 100,
),
11 =>
array (
'CONDITION' => '#^/catalog/filter/(.+?)/apply/#',
'RULE' => 'SMART_FILTER_PATH=$1&',
'ID' => '',
'PATH' => '/catalog/index.php',
'SORT' => 99,
),
//if (modef.style.display === 'none')
//{
modef.style.display = 'inline-block';
//}
$.get(
BX.util.htmlspecialcharsback(result.FILTER_AJAX_URL),
function (data) {
$('.col.ff').html($(data).find('.col.ff').html());
}
);
Answer the question
In order to leave comments, you need to log in
Turned off the CNC everything works.
Answer from bitrix support:
Please try to disable the CNC. Is the filtering correct?
The fact is that now the CNC in the smart filter will really not work if the section is not transferred there.
We have a request for this revision, but we would like to make sure that your reason is in the CNC.
How not to be clear now, the strangest thing is that the url works when accessing it, but not using ajax.
I found a solution on my own https://ftask.ru/2020/04/24/bitrix-if-smart-filt...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question