Y
Y
Yuri2016-04-19 22:15:57
1C-Bitrix
Yuri, 2016-04-19 22:15:57

How to display in catalog.section information that the item is in the cart?

Good evening!
It is required to change the text on the button that the product is already in the basket by pressing the button in the basket, but because of caching, the information is not updated.
And you also need to change prices depending on the user's settings, for example, hide wholesale prices, after selecting this option, also because of caching, wholesale prices are shown
. How can I influence the output of information without disabling caching?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2016-04-19
@yborschev

This is done in JS, first the page is loaded, somewhere where the small basket should display the IDs of the goods in the basket (secretly of course), the script takes these IDs and if there are goods on the page, then it changes the button

N
no_one_safe, 2016-04-22
@no_one_safe

And the user setting is passed to the component parameters - the cache depends on the parameters.
and in the template you already write the logic:

If($arParams['OPT'] == 'Y){
....
}
else{
....
}
?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question