Answer the question
In order to leave comments, you need to log in
How to update the buffer in Bitrix?
Wrote a script for adding a product to the product list. They are marked with classes. Everything is well preserved, but if you use the browser buttons to go to another page and then return, the classes do not appear. I add a class from an array:
$idUser = $USER->GetID();
$rsUser = CUser::GetByID($idUser);
$arUser = $rsUser->Fetch();
$arFavorites = $arUser['UF_FAVORITES'];
<?if (in_array($arResult['ID'], $arFavorites)) {
echo "active";
}?>
Answer the question
In order to leave comments, you need to log in
If $arFavorites is obtained in the component's template code or in result_modifier.php, component caching may be triggered. Better then do these manipulations in component_epilog.php
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question