Question

After migration all product showing out of stock

Was it helpful?

Solution

Try backup the inventory_source_item table and use the below query:

    insert 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`)))

Please take backup before running this query in your Database.

OTHER TIPS

Dude, you really helped us with this. Had same problem, we were searching all day and this helped a lot.

Our problem was that Amasty Custom stock status was not always showing the correct custom stock status rules. So sometimes it did, sometimes not. So if things were in stock it said out of stock, and for products out of stock it showed in stock.

We had to truncate the table first and ran the query.

Thanks for sharing, hope other will help.

It was after a migration from magento 1 to magento 2.

So hope this will help others !!!

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top