magento / magento/community-features
Change product status to out-of-stock when qty is less than 'Minimum Qty Allowed in Shopping Cart'
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 46
- Forks
- 14
- PR merge metrics
- No merged PRs in 30d
Description
'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!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue provides no files, tests, or entry points to follow. Start by reproducing the Magento 2.3.5 scenario with a minimum quantity of 7 and stock of 10, then trace the stock-status and cart-quantity validation paths. Done means products become out of stock, or otherwise cannot be purchased, when available quantity is below the configured minimum without reducing the purchasable quantity incorrectly.
Written by the indexing model from the issue text.
Assessment
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100