S
S
sickgang2020-09-23 09:59:55
1C-Bitrix
sickgang, 2020-09-23 09:59:55

How to synchronize the quantity of goods in the cart and on the category page?

Hello!
There is such a problem:
When adding a product to the cart, the quantity changes, everything is fine, but on the page from where the product was added, the quantity costs 1, that is, if there are 10 products in the basket, there is also one on the page, how can this be fixed?
On the first screen, the input is highlighted in blue from all, as if the product is in the cart, but the quantity is 1
5f6af2525ce56588960899.png
And here in the cart the quantity is 3
5f6af2623bdd6316090956.png
Thank you in advance for your help!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Vorobyov, 2020-09-23
@BXVoral

Modify the component template. Since you have goods placed in the basket somehow stand out (if I understand correctly), then you need to refine this functionality and substitute this value. How to do it exactly: it all depends on your implementation specifically.
In the general case, either an ajax request is made for the cart state, or the same thing but simply in component_epilog.php Further, the data received by any of these methods using js is substituted into the input.
In my opinion, when choosing ajax vs component_epilog.php, it is better to request with ajax.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question