#1642 - Shopping Cart does not update stock correctly when cleared.
| Identifier | #1642 |
|---|---|
| Issue type | Minor issue (breaks specific functionality) |
| Title | Shopping Cart does not update stock correctly when cleared. |
| Status | Completed |
| Handling member | PDStig |
| Addon | shopping |
| Description | Any one that adds, then deletes a product from their shopping cart, puts that product into an awaiting transaction status, preventing others from purchasing it. The product is stuck there, until I go and cancel non-completed orders. The same thing happens when a user goes to Paypal, then abandons the purchase. |
| Steps to reproduce | Add a product to your shopping cart. Then clear your cart, then do it again. Do it as many times as you have product stock, and it will lock out new purchases, without any users ever even trying to actually buy anything.
You can defeat this problem by setting stock to "maintained", but now you are selling items you may not have on hand and that may have a long lead time. |
| Funded? | No |
| Commits |
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".


Comments
The shopping cart does not do a good job of clearing out orders that are never completed. This includes intermediate orders when managing the shopping cart.
This locks up stock control.
This is a bit complex to clean up as we have to also avoid over-sales, and the potential for clearing out orders that are currently being purchased if the user accidentally refreshes their cart in another tab.
We will have to assume that payment signals (IPNs) are truly instant or that customers won't come in and create a new cart while waiting for a prior order's IPN to come through. This assumption is better than locking up the stock unnecessarily.