View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0007293 | OXID eShop (all versions) | 1.03. Basket, checkout process | public | 2021-12-02 14:41 | 2024-09-11 14:46 |
Reporter | Alpha-Sys | Assigned To | |||
Priority | normal | Severity | major | Reproducibility | always |
Status | confirmed | Resolution | open | ||
Product Version | 6.3.1 | ||||
Summary | 0007293: Noticelist and wishlist items are lost with basket reservation enabled | ||||
Description | Noticelist and wishlist items gets deleted if the setting for basket reservation is active. | ||||
Steps To Reproduce | Activate basket reservation in private sales settings. Login in frontend and add an article to the wishlist or the noticelist. Wait until the basket reservation limit is reached. Your noticelist and wishlist articles disappear. | ||||
Additional Information | The problem is in the BasketReservation class. In the function discardUnusedReservations. This SQL is executed which removes the basketitems: https://github.com/OXID-eSales/oxideshop_ce/blob/master/source/Application/Model/BasketReservation.php#L316 | ||||
Tags | Product domain and basket rewrite | ||||
Theme | All | ||||
Browser | All | ||||
PHP Version | All | ||||
Database Version | All | ||||
duplicate of | 0007136 | resolved | farzam.tahmasebmirza | Shop deletes savedbasket entries from other (all) subshops |
|
Thanks for your report. First we were not able to reproduce the issue, but after some time we figured out an important condition: If you reload the page while having an empty basket and being in basket or checkout process, the behavior was reproducable. Therefore the steps to reproduce must look like this: - Enable the setting Master Settings > Core Settings > Settings Cart expiration. - For testing purpose, you should set Seconds cart expiration timeout to something small, e.g. 5 seconds. - Now add a product to your wish list and/or gift registry. - Then add a product to your basket and go to basket overview. - Wait until the cart expires. - Reload the page. - Your basket is empty. Your wish list and gift registry is still active. - Wait again the amount of time until the cart would expire again. - Reload the page. - Now your wish list and gift registry are empty. If you never call the basket/checkout page while having an empty basket, this behavior is not seen. The basket will be emptied after expiration, but the wish list and gift registry stay active. More explanation: The mentioned line of code truly deletes all entries in oxuserbasketitems, even though they are belonging to the wish list or gift registry. However, the entries in oxuserbaskets with oxtitle = savedbasket and oxtitle = reservations are deleted before. Therefore on the first reload the named method OxidEsales\EshopCommunity\Application\Model\BasketReservation::discardUnusedReservations returns soon due to the condition if ($reservation->EOF) { return; } https://github.com/OXID-eSales/oxideshop_ce/blob/4d0b7ffcec290dc784b144cdd90fc268f2b2dab1/source/Application/Model/BasketReservation.php#L290 which is true, since there's no more reservation. No wish list or gift registry items are deleted then. If you're browsing on any other page than basket or checkout, that's not an issue, but if you reload while staying in basket/checkout, a new reservation is inserted to the database. The condition above will be false and no return is called. The method continues with deleting all entries in oxuserbasketitems and therefore clears the wish list and gift registry. This leaves two questions: First of all, at the given time, I'm not sure why all entries are cleared on the mentioned line https://github.com/OXID-eSales/oxideshop_ce/blob/4d0b7ffcec290dc784b144cdd90fc268f2b2dab1/source/Application/Model/BasketReservation.php#L316 It seems obvious that there needs to be another condition like oxtitle = reservation or oxtitle = savedbasket. However, there may be a reason for the decision. More investigation from our developers is needed. The second question is, why a new reservation is inserted while the basket is empty. This may be not an issue for itself, but leads to the given behavior. I can't think of a reason to create an reservation for no items at all. Adding the second condition to the query might be an easy fix (or quick workaround), but catching and cancel the reservation on an empty cart may be the better solution. As always, the decision is with our Development Team. I acknowledge the report. [sp] |