M
M
Muvka2019-02-10 13:06:59
1C-Bitrix
Muvka, 2019-02-10 13:06:59

How to display all store products in a specific category?

I'm trying to display products with the tag sale in the same category. Filter out the categories you need

if($arResult["VARIABLES"]["SECTION_CODE"] === "rasprodazha") {
  global $arrFilter;
  $arrFilter = Array('PROPERTY_RASPRODASA_VALUE' => 'да');
}

But how can I make the script receive all the goods from the store? bitrix:catalog.section component. $arResult['ITEMS'] is empty.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya, 2019-02-10
@jasper-blondin

The section.php file (or section_horizontal.php, or section_vertical.php) has a component that lists the sections: catalog.section. Which section to display this component understands by parameters

"SECTION_ID" => $arResult["VARIABLES"]["SECTION_ID"],
"SECTION_CODE" => $arResult["VARIABLES"]["SECTION_CODE"],

Your task is to:
1. Check which section you are in.
2. If you are in the Sale section, clear the above parameters (pass an empty string "").
3. Now that you have displayed absolutely all products, you can apply your filter.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question