-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Product showing out of stock but In stock in backend #39889
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
Comments
Hi @januszd17. Thank you for your report.
Join Magento Community Engineering Slack and ask your questions in #github channel. |
Hi @engcom-November. Thank you for working on this issue.
|
Hello @januszd17 , Thank you for your report and collaboration. We attempted to reproduce the issue in our latest version 2.4 develop but were unable to reproduce it. Please find the attached screenshot for reference. Steps to Reproduce
We followed these steps and did not encounter any issues. Could you please recheck in the latest version of Magento and let us know if we are missing any steps to reproduce this issue? Therefore, we are marking this ticket as "Issue: Needs Update". Thank you! |
How did you try reproducing it? Did you follow the steps? This seems to be a problem when updating products using the API there are others with the same problem: -- Check stock item table -- Check stock status table -- Check relationship tables -- If using MSI, check source items Most were returning the correct status with stock showing as 1. Except this one: |
I have the same issue on some of my SKU's not all. I noticed if I change the sku to all lower case letters it solves the problem of showing in stock. |
Hello @januszd17 , Thank you for your report and collaboration. We attempted to reproduce the issue in the latest 2.4-develop instances. We are able to reproduce the issue. Please refer to the attached screenshot for details. Steps to Reproduce:
We followed the preconditions and steps as provided and encountered the issue. Therefore, we are marking this ticket as "Issue: Confirmed." Thank you! |
✅ Jira issue https://jira.corp.adobe.com/browse/AC-14639 is successfully created for this GitHub issue. |
✅ Confirmed by @engcom-November. Thank you for verifying the issue. |
Preconditions and environment
2.4.7-p3
Stock status mismatch: product shows as in-stock in backend, out-of-stock in frontend (cataloginventory_stock_status vs. cataloginventory_stock_item)
We are encountering a recurring issue where Magento products display as out of stock on the frontend even though they are marked in stock in the admin backend.
This mismatch appears to be caused by desynchronization between the cataloginventory_stock_item and cataloginventory_stock_status tables.
Steps to reproduce
Import or update products (via integration, API, or backend)
Check Magento admin → product shows is_in_stock = 1
Check Magento frontend → product displays as out of stock
Expected result
Frontend and backend stock statuses should match.
If cataloginventory_stock_item.is_in_stock = 1, the product should display as in stock on the frontend.
Actual result
cataloginventory_stock_item.is_in_stock = 1 (correct)
cataloginventory_stock_status.stock_status = 0 (incorrect)
Frontend shows product as out of stock.
Additional information
Example SQL to identify issue:
SELECT cpe.entity_id,
cpe.sku,
csi.is_in_stock AS stock_item_status,
css.stock_status AS stock_status_valueFROM catalog_product_entity cpeJOIN cataloginventory_stock_item csi ON cpe.entity_id = csi.product_idJOIN cataloginventory_stock_status css ON cpe.entity_id = css.product_idWHERE csi.is_in_stock != css.stock_status;
Temporary workaround:
UPDATE cataloginventory_stock_status cssJOIN cataloginventory_stock_item csi ON css.product_id = csi.product_idSET css.stock_status = csi.is_in_stockWHERE css.stock_status != csi.is_in_stock;
Followed by:
php bin/magento indexer:reindex
php bin/magento cache:flush
Release note
No response
Triage and priority
The text was updated successfully, but these errors were encountered: