-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Set maximum Qty Allowed in Shopping Cart is 0 still allow adding to cart #18477
Comments
Hi @duongdiep212. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
where @duongdiep212 do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?
|
I checked core and found the function below : The problem is when I set max qty = 0, so $stockItem->getMaxSaleQty() return false in this condition , that means it will pass through this function and allow you adding to cart with no limit. |
Out of curiosity, what's the use case for having a value of 0 for max sale quantity? |
Yes. We can fix it by Maximum Qty Allowed in Shopping Cart is greater than 0. Let me try it |
Hi @gelanivishal. Thank you for working on this issue.
|
probably using product in some "catalog" mode without purchasing. but still holding some stock for admin orders etc |
Hi @duongdiep212. Thank you for your report. The fix will be available with the upcoming 2.3.1 release. |
Hi @duongdiep212. Thank you for your report. The fix will be available with the upcoming 2.2.8 release. |
Team, In addition to #23319 , the use case for 0 in the world of Magento is a value for infinite. Now instead of setting 0, we have to set some artificial number that’s quite high. There’s no such thing as 0 allowed in cart. If there’s a use case for not allowed, the product should be out of stock. Please advise. |
I vote on reverting this commit. If we are not going to revert, please provide solution for not restricting the max amount in the cart |
Preconditions
Steps to reproduce
Expected result
Show message can not add qty to cart : The most you may purchase is 0.
Actual result
Still adding qty to cart with no limit.
The text was updated successfully, but these errors were encountered: