Magento 2: "There are no source items with the stock status" (Error) Print

  • M2
  • 0

Issue:

Attempting to purchase a configurable product by adding to the cart. One or more product options throws the following error:

There are no source items with the stock status

Cause

It could be due to a product import or inventory sync from an external custom method. The data could be invalid for some products and needs to be corrected or synced.

Possible Solution

Updating the weight, QTY or stock option can correct the values. While this may work for a few products, there may be quite a few that require updating. In this case, do the following SQL to correct the products.

1) Backup your inventory_source_item table

# mysqldump -uexample -p magento inventory_source_item | gzip > magento.inventory_source_item_backup.sql.gz

2) Run the following SQL

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;

 

If you are a Create Hosting customer utilising our MageVPS Plan, feel free to submit a support ticket and we can investigate and take care of this issue for you.


Was this answer helpful?

« Back