magento / community-features

Magento Features Development is an Initiative to Allows Community Memebers Join to Development of Magento Features
46 stars 18 forks source link

Change product status to out-of-stock when qty is less than 'Minimum Qty Allowed in Shopping Cart' #290

Open yinzheng-zhong opened 3 years ago

yinzheng-zhong commented 3 years ago

'm running Magento 2.3.5.

Some of my products have Minimum Qty Allowed in Shopping Cart set to greater than one.

For example, product A has Minimum Qty Allowed: 7. Currently, the QTY of A is: 10. Now a customer bought 7 of A and now QTY becomes: 3. At this point the status of this item is still In Stock, however, customers can't add it to the cart and the error will pop up saying the qty if greater than the stock.

This is very annoying and this affects the user experience.

So I wanted to make the product 'out of stock' programmatically when qty is less than the 'Minimum Qty Allowed in Shopping Cart'. I tried to set the out of stock threshold to 6 to achieve this, but then it only allows people to buy 4 even though I have 10. I am not sure which block(s) controls this?

Thank you!

m2-assistant[bot] commented 3 years ago

Hi @zxhaxdr. Thank you for your report. To help us process this issue please make sure that you provided sufficient information.

Please, add a comment to assign the issue: @magento I am working on this