New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Product can be added to cart even if the availability limit was reached #651
Comments
Is there a ETA on the 5.1.0 milestone? |
Thank you for reporting. A negative value for stock seems ok to me because that might be needed in special cases. There is no ETA for 5.1.0 yet. |
Negative value for a limited quantity product also can be very unwelcome. As for the bug itself, I didn't look into bundled items yet, but I think the same problem exists there. |
And why did you close it, @mgesing ? The bug is still there. |
What bug do you mean? The bug described on top of this issue was fixed by 4f1070d. |
Also the one when the cart is set to single items? |
Describe the bug
A product with a quantity of 1 and with stock limitation can be put 2 times into the shopping cart.
To Reproduce
Steps to reproduce the behavior:
In the backend:
Create a product
Set 'Manage inventory method' to 'Track Inventory'
Set Stock Quantity to 1
Set 'low stock activity' to 'Unpublish'
Set Minimum cart quantity and Maximum cart quantity to 1
Set Backorders to 'No Backorders'
In the Frontend:
Add the product to the cart
Add the product to the cart again.
Expected behavior
The product shouldn't be added a second time.
Desktop (please complete the following information):
Additional context
The problem lies in the call to the cart validator in ShoppingCartService.cs line 197.
There the new quantity isn't sent to the validator since the existingCartItem's quantity wasn't updated to the new value.
This should be fixed if we move
up a few lines so the validator gets the right values.
Also when you enable "Add products to cart in single positions" then you can add the product until you reach the cart item limit.
The validator seems to need some love :)
The text was updated successfully, but these errors were encountered: