您的问题与我的类似。
我在安装 Magento 2 时删除了 MSI - 然后在购买 ebay 插件后我们需要 MSI - 所以我重新安装了它 - 和你一样 - 我的“可销售数量”是空白的 - 不是 0 - 空白。
My product with blank saleable quantity
经过大量的谷歌搜索和查看其他帖子 - 我发现我已经搞砸了 db。
我的“inventory_source_item”是空的 - 为了解决这个问题,我在这里找到了一个帖子:
https://magento.stackexchange.com/questions/294286/after-migration-inventory-source-item-table-is-empty-magneto-2
提供的 SQL 修复了“inventory_source_item”表。
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`)))
^ 重要提示:这里的 'default' 是你的股票来源的 source_code - 如果你的和我的一样,那么 SQL 应该按原样工作,否则将 'default' 更改为 'yourstocksourcecode' ^
My stock sources
但我的“可销售数量”仍然是空白的。
然后我注意到“inventory_source_item_link”表是空的。我只是插入了 1 行:
INSERT INTO `inventory_source_stock_link` (`link_id`, `stock_id`, `source_code`, `priority`) VALUES ('1', '1', 'default', '1');
现在我的可销售数量在那里? 1 行没有它,因为它只是分组产品...
My products showing saleable quantity
还值得指出 - 在最终的 SQL 之后,我重新索引以确保它会在那里:
php bin/magento indexer:reset && php bin/magento indexer:reindex