I
I
IgorBorys2021-02-10 13:21:09
1C-Bitrix
IgorBorys, 2021-02-10 13:21:09

Incorrect URL is displayed in the product catalog. How to fix?

Good afternoon.

Help me deal with the CNC catalog on the second site in the subfolder.

On the main page in the product catalog section, everything is displayed normally.
https://isolon-west.com/ua/

Problems start in the catalog itself https://isolon-west.com/ua/catalog/

It's impossible to remove extra nesting from the url in the form /catalog/

Now the menu items in the catalog go https://isolon-west.com/ua/catalog/avtomobilnye-lyuki/ and accordingly give a 404 error

Since they are available at https://isolon-west.com/ua/avtomobilnye-lyuki/

I am attaching screenshots of the CNC settings. But I think that the error is hidden somewhere else, since everything works with such parameters, except for sections in the directory and, accordingly, breadcrumbs.

6023b29aeeecc955397190.png
6023b2a56a6bc470212946.png

I created a separate template for the site in the subfolder so as not to damage the settings of the main site.

Here is the code of the file that is responsible for the output on the catalog page

sections.php
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die();

$this->setFrameMode(true);

global $arSettings;
$isWideScreenMode = $arSettings["WIDESCREEN_MODE"]["VALUE"] == "Y" ? true : false;

if($isWideScreenMode)
$APPLICATION->SetPageProperty("wideScreenMode", "-ws");

$GLOBALS[$arParams["FILTER_NAME"]] = array("UF_HIDDEN" => false);
$APPLICATION->IncludeComponent("bitrix:catalog.section.list", "catalog",
array(
"IBLOCK_TYPE" => $arParams["IBLOCK_TYPE"],
"IBLOCK_ID" => $arParams["IBLOCK_ID"],
"FILTER_NAME" => $arParams["FILTER_NAME"],
"CACHE_TYPE" => $arParams["CACHE_TYPE"],
"CACHE_TIME" => $arParams["CACHE_TIME"],
"CACHE_GROUPS" => $arParams["CACHE_GROUPS"],
"CACHE_FILTER" => $arParams["CACHE_FILTER"],
"COUNT_ELEMENTS" => $arParams["SECTION_COUNT_ELEMENTS"],
"COUNT_ELEMENTS_FILTER" => $arParams["HIDE_NOT_AVAILABLE"] == "Y" ? "CNT_AVAILABLE" : "CNT_ACTIVE",
"TOP_DEPTH" => "1",
"SECTION_FIELDS" => array(),
"SECTION_USER_FIELDS" => array(
0 => "UF_ICON"
),
"SECTION_URL" => $arResult["URL_TEMPLATES"]["section"],
"HIDE_SECTION_NAME" => (isset($arParams["SECTIONS_HIDE_SECTION_NAME"]) ? $arParams["SECTIONS_HIDE_SECTION_NAME"] : "N"),
"ADD_SECTIONS_CHAIN" => (isset($arParams["ADD_SECTIONS_CHAIN"]) ? $arParams["ADD_SECTIONS_CHAIN"] : ""),
"ADD_SECTION_TARGET" => "Y"
),
$component,
array("HIDE_ICONS" => "Y")
);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
IgorBorys, 2021-02-10
@IgorBorys

In general, I made a crutch, but the main thing is that it works.
In the sections.php file, I replaced the bitrix:catalog.section.list component with bitrix:main.include through which I displayed the catalog section, as on the main page.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question