0

We have imported products to our website. For most of products salable quantity shows 0.

https://prnt.sc/tosm8b

We try run reindex but still salable quantity shows 0.

Any solution?

1 Answer 1

0

I suggest first take backup of your Database. After try this query:

CREATE ALGORITHM=UNDEFINED SQL SECURITY INVOKER VIEW `inventory_stock_1`  AS
select distinct `legacy_stock_status`.`product_id` AS `product_id`,
`legacy_stock_status`.`website_id` AS `website_id`,
`legacy_stock_status`.`stock_id` AS `stock_id`,
`legacy_stock_status`.`qty` AS `quantity`,
`legacy_stock_status`.`stock_status` AS `is_salable`,
`product`.`sku` AS `sku`
from (`cataloginventory_stock_status` `legacy_stock_status`
join `catalog_product_entity` `product`
on((`legacy_stock_status`.`product_id` = `product`.`entity_id`))) ;

After exceution of query just reindex and flush chahe

2
  • I had this table already created earlier and for half products salable quanity shows correct number. But for some products still shown 0 and for many products it shows a negative quantity
    – Sylvester
    Jul 26, 2020 at 15:42
  • Run this query: Take backup of inventory_source_item table. 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))) Jul 26, 2020 at 15:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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