-
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
Still shows Add to cart even if salable quantity is 0 #33819
Comments
Hi @chequille. 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:
For more details, please, review the Magento Contributor Assistant documentation. Please, add a comment to assign the issue:
🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
@magento give me 2.4-develop instance |
Hi @chequille. Thank you for your request. I'm working on Magento instance for you. |
Hi @chequille, here is your Magento Instance: https://5101128433fb0b25d09163620dddf00d-2-4-develop.instances.magento-community.engineering |
Hi @engcom-Echo. Thank you for working on this issue.
|
Unbelievable, products where salable qty is 0 are still showing ADD TO CART button. What are you going to do on this? |
@magento give me 2.4-develop instance |
Hi @engcom-Echo. Thank you for your request. I'm working on Magento instance for you. |
Hi @engcom-Echo, here is your Magento Instance: https://5101128433fb0b25d09163620dddf00d-2-4-develop.instances.magento-community.engineering |
Hi @chequille
So kindly recheck this issue on Magento 2.4-develop branch and if the issue is still reproducible, please provide more details or additional/missing steps regarding the same. |
Hi @engcom-Echo, now I found the problem. As I mentioned before, you changed the inventory from 100 to 1 which I did not. I bought the 100 pieces. I tried now to first edit the prodcut and save it and than making an order for 100 pieces. When I do so, add to cart button is not shown anymore. But this means, that the saving of a product does change something somewhere in the database. I will try this now and will report my results. Regards, |
Hi @engcom-Echo but something must be wrong in any case, Try not to change the product and place an order with the quantity which is in the database of a fresh magento instance (I think they are all set to 100) and you will see, that Add to cart is shown. What else could it be? As I said already in Magento 2.3.x everything worked fine. Therefore, I do not think that some of my extensions causes this behaviour. Does somebody have any idea? |
@magento give me 2.4-develop instance |
Hi @engcom-Echo. Thank you for your request. I'm working on Magento instance for you. |
Hi @engcom-Echo, here is your Magento Instance: https://5101128433fb0b25d09163620dddf00d-2-4-develop.instances.magento-community.engineering |
I have a magento 2.4.2 now updated to Magento 2.4.3 affected by the same issue. Got a simple product with Add to cart button still showing after reindex, cache. All salabe check functions report the product is salable and in stock which is not correct. |
Oh, somebody else also has this problem. In some point of view I am very happy about this :-) I am not the only one. In the meantime I disabled all third party modules which I am using in my setup, but still wrong!!!! |
@chequille Did you do a data migration from m1 ? This issue does not happen with all of the products for me. |
@kemexyz This works pretty good, but maybe not regarding this issue. So, no idea whats happening here. In the meantime, I made my own block class which is using GetSalableQuantityDataBySku $getSalableQuantityDataBySku class to check if salable quantity is 0 or not. |
@kemexyz |
After code review, storefront product Out of Stock status depends on 2 database columns when using Default Stock.
Number 2 defines the storefront behavior, so whenever this value is set to 0, the storefront will show the product as out of stock. So consider the following situation: When the last item of the product is sold, MQ consumer process the message in queue "inventory.reservations.updateSalabilityStatus" and set Number 2 to 0, thus storefront of the product will show Out of Stock. (This should be expected scenario in the development team so far.) But, when Stock indexer is triggered and Number 1 should be 1, Stock indexer will sync the 1 value in Number 1 to Number 2, thus the storefront Out of Stock status will be removed and the product page will show Add to cart icon. The source code where Stock indexer determines the stock status can be found here. The Stock indexer can be triggered by Schedule or by a Save action. When the indexer is set to be triggered on Save, there are numerous possibilities that it will roll back the Out of Stock status done by the queue consumer, including a CMS user modifying the product, an extension observer modifying custom attributes...... So basically, the Default Stock indexer ruined the MSI Out of Stock mechanism in a real production Magento setup. |
@chequille we're experiencing exactly the same issue on a Magento 2.4.3 instance which is originally migrated from a Magento 1.9.4.3 instance. |
Hi @tgreeve thank you for your time describing problem. I have same problem and see at least 5+ duplicate tickets closed without solution. Thanks, N |
Hi @nkajic |
Hi @chequille I have managed to get it working on 2.3.4-p1 by properly configuring consumers. #35105 But on earlier version there was definetly some other problem involved. Upgrading to 2.4.3-p1 and configuring consumers solved my problem. I hope it hepls. Thanks, |
Hi @nkajic, But if this is the only solution, somebody who does not have ssh acces to the server will never get it working, right? As well I have a question regaring the consumers. You mentioned "properly configuring consumers", but what does it mean properly configured? Which consumers I have to run? Do I have to configure something else somewhere? Do you have a description of everything you did? If yes, can you share it here? Would be great. |
Hi @tgreeve |
@magento I am working on this. |
@magento give me 2.4-develop instance |
Hi @shomiadarshlt. Thank you for your request. I'm working on Magento instance for you. |
Hi @shomiadarshlt, here is your Magento Instance: https://02f01d2fce71fbd22108a321e03258c9.instances-prod.magento-community.engineering |
Hi @chequille , I tried replicating the issue in magento 2.4 develop instance but could not replicate .
Are there any steps that have been missed in replicating the issue ? Thanks |
I do want to say we added this patch |
Hi @chequille, Thanks for your reporting and collaboration. We have verified the issue in Latest 2.4-develop instance and the issue is no more reproducible.Kindly refer the screenshots. There is no Add to Cart button for the products having salable quantity 0. Hence we are closing this issue. Thanks. |
Preconditions (*)
Steps to reproduce (*)
Expected result (*)
Actual result (*)
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
The text was updated successfully, but these errors were encountered: