A
A
Alexander Balya2019-07-10 15:31:40
1C-Bitrix
Alexander Balya, 2019-07-10 15:31:40

How to disable saving the Bitrix cart in the database?

There is a need to use one account at the same time by several users of the online store on Bitrix. But there is a problem that the contents of the cart are saved to the database. And if two people logged in under the same account at the same time from different computers, the contents of their baskets are mixed.
For example, one user puts a product into the cart from his computer, while the other user also adds this product, because apparently the contents of the cart are not stored in the session, but in the database.
How to disable the storage of the basket in the database and configure it to be stored, for example, in cookies?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman Gritsuk, 2019-07-10
@winer

No way. The API does not provide for storing the user's basket anywhere other than the database.

S
serginhold, 2019-07-10
@serginhold

If you use the \Bitrix\Sale\Basket object, and do not do save(), but instead serialize the object back and forth (to some file, for example), then it will probably start.
well, or at least serialize basketItems, and then constantly create a new basket to work with items.
Or just store the product id in cookies and also constantly create a new basket, without saving via save().
In any case, you need to do a lot of programming, with your own models and components

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question