The essence of the problem.
For example, a user visits the site and is authenticated. After gaining the items in the basket and leaves. The system remains abandoned shopping cart.
After some time the user returns, but abandoned shopping cart it has not picked up. If you look through the admin area, the cart is tied to the desired user. However, when it comes to the page of the basket he throws out the error "Your shopping cart is empty".
Having found such a feature. Because basket in Bitrix attached to the user directly, and a buyer ID(table b_sale_fuser
) there is a mess with these IDs. To obtain this ID, you have two methods:
Sale\Fuser::getId(); // D7
While the user netlogin on the website, both methods return the same value (e.g. 2). After authorization method CSaleBasket::GetBasketUserID()
continues to give fuser_id 2, but the method of Sale\Fuser::getId()
returns fuser_id 1.
If you look at the database table b_sale_fuser
, it turns out that recording from fuser_id = 1 refers to our user with the abandoned cart, and fuser_id = 2 refers to the user_id = NULL.
It turns out there are two baskets. The most unpleasant is that component of the basket in the system receives the contents of the basket, just answer method CSaleBasket::GetBasketUserID()
Is it possible for this behavior to influence? Or maybe I missed something in the settings of Bitrix?