2

inventory_source_item and cataloginventory_stock_item data is not same? which table to used for stock now. Please explain. Thanks so much

1 Answer 1

3

The answer is 'yes and no' :)

YES:
If you are using the enabled MSI functionalities with the default stock and default source only, then, when you update a product's qty, the same qty will be displayed on both inventory_source_item and cataloginventory_stock_item tables.

NO:
However, when you have different stocks with sources assigned to your product (out of which one is the default source from the default stock), the inventory_source_item stores an entry for each of the sources and cataloginventory_stock_item stores only the value on the 'default source' from Magento OOTB, any other custom source will be ignored here.

This means that if you have a product which is not assigned on Magento OOTB default stock with its default source, then qty in cataloginventory_stock_item for that product will be 0.

2
  • Thanks for the answer. So what happens if we add custom sources? stock checks customer sources or only default?
    – Guru
    Commented Mar 12, 2021 at 3:27
  • 1
    you're most welcome :) yes, the stock will check the custom sources (and include the default source also if it's assigned to your product) and aggregate the total quantities as 'salable quantity'. but this information will be as mentioned above available in the inventory_source_item table with a row for each source where the product has a quantity assigned.
    – Diana
    Commented Mar 12, 2021 at 6:36

Your Answer

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

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