Answer the question
In order to leave comments, you need to log in
Why is the selection of products in catalog.section reset?
Hello. It was necessary to display sliders with a selection of goods in the article in the complex component "news in detail". To do this, I prescribed a snag that allows you to insert components when editing a news item like on a regular page. In the code for calling these components, I specify FILTER_NAME => "FILTER_X", where X is the slider's ordinal number. In the infoblock properties I create properties with the filter name "FILTER_X". In the result_modifier.php file of the news component template, I check if this property is filled in the article, and if so, then I do this:
foreach($arFilterName as $val) {
if(!empty($arResult["PROPERTIES"][$val]["VALUE"])) {
$GLOBALS[$val] = ["ID" => $arResult["PROPERTIES"][$val]["VALUE"]];
}
}
Answer the question
In order to leave comments, you need to log in
if the layout allows and DETAIL_TEXT can still be moved to component_epilog, I can suggest putting macros in the detailed description, where the carousel should be. For example:
This is my test detailed description #KARUSEL_1# This is my test detailed description #KARUSEL_2#
In the component template you find out how many carousels through preg_match_all, in a loop you write catalog.sections with your filters to variables into the buffer, and then you replay these macros, before this is exactly what they did when the image gallery had to be inserted in the middle of a detailed description.
Here in my answer is an example of such a replay for prices. It will be more difficult for you, but similarly
ob_start();
// вызов компонента
$karusel_1 = ob_get_contents();
ob_end_clean();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question