3

If I try to buy a product, then I get "There are no source items with the in stock status" and "This product is out of stock."

enter image description here

So I opened the product and noticed that the Quantity is set to 0 and grayed out.

enter image description here

If I click on the link text "Advanced Inventory" and enter a value to Qty e.g. 1000 and press on Done and then on save, then it is 0 again after it saves.

What is going on?

10 Answers 10

7

DO NOT WORRY IF YOU HAVE PRODUCTS OR ORDERS IN YOUR DB, THIS IS SAFE and TESTED.

Whenever we will upgrade magento 2.3.X version to magento 2.4.3 at that time Multi Source Inventory Issue happens. To solve that issue need to follow below steps.

Step #1 First Disable all MSI extension

php bin/magento module:disable Magento_Inventory Magento_InventoryAdminUi Magento_InventoryApi Magento_InventoryBundleProduct Magento_InventoryBundleProductAdminUi Magento_InventoryCatalog Magento_InventorySales Magento_InventoryCatalogAdminUi Magento_InventoryCatalogApi Magento_InventoryCatalogSearch Magento_InventoryConfigurableProduct Magento_InventoryConfigurableProductIndexer Magento_InventoryConfiguration Magento_InventoryConfigurationApi Magento_InventoryDistanceBasedSourceSelectionAdminUi Magento_InventoryDistanceBasedSourceSelectionApi Magento_InventoryElasticsearch Magento_InventoryExportStockApi Magento_InventoryIndexer Magento_InventorySalesApi Magento_InventoryGroupedProduct Magento_InventoryGroupedProductAdminUi Magento_InventoryGroupedProductIndexer Magento_InventoryImportExport Magento_InventorySourceSelectionApi Magento_InventoryCache Magento_InventoryLowQuantityNotification Magento_InventoryLowQuantityNotificationApi Magento_InventoryMultiDimensionalIndexerApi Magento_InventoryProductAlert Magento_InventoryReservations Magento_InventoryReservationCli Magento_InventoryReservationsApi Magento_InventoryExportStock Magento_InventorySalesAdminUi Magento_CatalogInventoryGraphQl Magento_InventorySalesFrontendUi Magento_InventorySetupFixtureGenerator Magento_InventoryShipping Magento_InventoryShippingAdminUi Magento_InventorySourceDeductionApi Magento_InventorySourceSelection Magento_InventoryConfigurableProductAdminUi Magento_InventoryLowQuantityNotificationAdminUi Magento_InventoryBundleProductIndexer Magento_InventoryCatalogSearchBundleProduct Magento_InventoryCatalogSearchConfigurableProduct Magento_InventoryInStorePickupAdminUi Magento_InventoryInStorePickup Magento_InventoryInStorePickupQuote Magento_InventoryQuoteGraphQl Magento_InventoryVisualMerchandiser Magento_InventoryInStorePickupSalesAdminUi Magento_InventoryGraphQl Magento_InventoryAdvancedCheckout Magento_InventoryCatalogFrontendUi Magento_InventoryDistanceBasedSourceSelection Magento_InventoryInStorePickupApi Magento_InventoryInStorePickupGraphQl Magento_InventoryInStorePickupSales Magento_InventoryInStorePickupShipping Magento_InventoryRequisitionList Magento_InventoryInStorePickupFrontend Magento_InventoryConfigurableProductFrontendUi Magento_InventoryBundleImportExport

Step #2 Run magento s:up and magento s:s:d -f command

Step #3: Check will inventory_source_item and inventory_source_stock_link table removed

Step #4: Enable all MSI extension

php bin/magento module:enable Magento_Inventory Magento_InventoryAdminUi Magento_InventoryApi Magento_InventoryBundleProduct Magento_InventoryBundleProductAdminUi Magento_InventoryCatalog Magento_InventorySales Magento_InventoryCatalogAdminUi Magento_InventoryCatalogApi Magento_InventoryCatalogSearch Magento_InventoryConfigurableProduct Magento_InventoryConfigurableProductIndexer Magento_InventoryConfiguration Magento_InventoryConfigurationApi Magento_InventoryDistanceBasedSourceSelectionAdminUi Magento_InventoryDistanceBasedSourceSelectionApi Magento_InventoryElasticsearch Magento_InventoryExportStockApi Magento_InventoryIndexer Magento_InventorySalesApi Magento_InventoryGroupedProduct Magento_InventoryGroupedProductAdminUi Magento_InventoryGroupedProductIndexer Magento_InventoryImportExport Magento_InventorySourceSelectionApi Magento_InventoryCache Magento_InventoryLowQuantityNotification Magento_InventoryLowQuantityNotificationApi Magento_InventoryMultiDimensionalIndexerApi Magento_InventoryProductAlert Magento_InventoryReservations Magento_InventoryReservationCli Magento_InventoryReservationsApi Magento_InventoryExportStock Magento_InventorySalesAdminUi Magento_CatalogInventoryGraphQl Magento_InventorySalesFrontendUi Magento_InventorySetupFixtureGenerator Magento_InventoryShipping Magento_InventoryShippingAdminUi Magento_InventorySourceDeductionApi Magento_InventorySourceSelection Magento_InventoryConfigurableProductAdminUi Magento_InventoryLowQuantityNotificationAdminUi Magento_InventoryBundleProductIndexer Magento_InventoryCatalogSearchBundleProduct Magento_InventoryCatalogSearchConfigurableProduct Magento_InventoryInStorePickupAdminUi Magento_InventoryInStorePickup Magento_InventoryInStorePickupQuote Magento_InventoryQuoteGraphQl Magento_InventoryVisualMerchandiser Magento_InventoryInStorePickupSalesAdminUi Magento_InventoryGraphQl Magento_InventoryAdvancedCheckout Magento_InventoryCatalogFrontendUi Magento_InventoryDistanceBasedSourceSelection Magento_InventoryInStorePickupApi Magento_InventoryInStorePickupGraphQl Magento_InventoryInStorePickupSales Magento_InventoryInStorePickupShipping Magento_InventoryRequisitionList Magento_InventoryInStorePickupFrontend Magento_InventoryConfigurableProductFrontendUi Magento_InventoryBundleImportExport

After enable run magento s:up command.

Step #5: Now you need to create Source. Go to admin side Store >> Inventory >> Source and create "default" source.

Step #6: Now you need to create Stocks. Go to admin side Store >> Inventory >> Stock and create "Default Stock". After assigning source if source will not assign then you need to assign it using SQL query that is provided on Step #8.

Step #7: Run below query

INSERT IGNORE INTO `inventory_source_item` (source_code, sku, quantity, status) select 'default', sku, qty, stock_status from (`cataloginventory_stock_status` as `lg` join `catalog_product_entity` as `prd` on((`lg`.`product_id` = `prd`.`entity_id`)))

Step #8: Run below query to link source to stock

INSERT INTO `inventory_source_stock_link` (`link_id`, `stock_id`, `source_code`, `priority`) VALUES ('1', '1', 'default', '1');

Step #9: Run reindex command php bin/magento indexer:reset && php bin/magento indexer:reindex

2
  • 2
    Most of us may have done the first 6 steps before bumping into this comment. The key to solve the issue are steps 7 and 8. Thanks, @Darshan modi!
    – Radu
    Apr 19 at 13:15
  • 1
    The solution does work, thanks a ton! And indeed as Radu said, most of the steps in my case are already there, the only missing one is Step#7
    – Duc To
    May 7 at 19:37
4

I figured it out, I have to open all simple products which are connected to the configurable product, then go to "Advanced Inventory" and check the checkbox 'Use Config Settings' under "Manage Stock"

0
2

I also got the "There are no source items with the in stock status" and "This product is out of stock" messages but in my case it was because the simple product was set to "this product has weight" but no weight was specified. Since I don't know the weight yet, I just entered 99 so it will be easy to find later.

1
  • Thanks for your contribution. They should change the error message to make it obvious.
    – Black
    Sep 21, 2020 at 8:00
2

We observed a similar issue when we sync the inventory from external custom methods. There are some instances the data is invalid only for some products. If this is external inventory import an ad-hoc incident, then we may use below SQL query to fix it.

INSERT IGNORE INTO inventory_source_item (source_code, sku, quantity, status)
select 'default', cpe.sku, csi.qty, csi.is_in_stock from catalog_product_entity as cpe,  cataloginventory_stock_item as csi
where cpe.type_id ='simple' and cpe.entity_id = csi.product_id;
1

Our site (Magento 2.3) had this issue with a configured item where all the children had spaces in their SKU names. Updated all of them and the item could be purchased just fine.

1
  • Looking at all of the answers, I think it's actually simpler than the three of us think. We had this error displaying because a third-party product management tool was saving products in an incomplete or incompatible way. Literally all we had to do was open up the products and re-save them using the Magento admin product view. No changes were required; a "re-save" just wrote them the way Magento expects it. All three of our answers seem like unlikely causes but share the common factor of re-saving the products.
    – S Adamson
    Sep 28, 2020 at 18:04
1

If none of the other solutions are working, check your database table inventory_source_item. If all the products have a status of 0 then update them to 1 and see if that helps.

UPDATE `inventory_source_item` SET `status` = '1' WHERE `inventory_source_item`.`status` = 0;
1

I would like to add to this by saying whether you re-saved the products ( either manually or via script) or you did it via the DB, you still need to check and make sure your source link was created properly in the INVENTORY_SOURCE_STOCK_LINK table. If that table is empty Magento will still not know where your inventory source is and keep giving you this error when adding items to the cart.

The sql looks something like this for default stock:

INSERT INTO `inventory_source_stock_link` (`link_id`, `stock_id`, `source_code`, `priority`) VALUES
(1, 1, 'default', 1);

Good luck to you!

0

I found that reviewing the inventory_source_item for stock status 0 as mentioned by other users helped resolve this.

-1

I have faced similar issue but I have sorted out by setting the Manage Stock "No" in the Admin->Configuration->Catalog->Inventory Tab Product Stock Options->Manage Stock

-1

Try to check the weight of the product, I think you are leaving it blank or the weight value of the product is 0. Hope this can help you to solve the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.