How to Get Source Information Assigned to Stock by Priority in Magento 2

Merchants were only able to have one inventory source for their store before Magento introduced the new multi-source inventory (MSI) feature in Magento 2.3 version.

MSI is a considerable improvement to the Magento core, which connects multiple inventory sources to your e-commerce website.

Single source inventory means the business operates only one source location managing on-hand Magento inventory and merchants ship products from one place to every customer worldwide. Therefore, it is easy to deduct the product quantity or add the same in the single-source inventory.

However, while working with multi-source inventory, it is critical to decide which product has to be deducted from which source, especially when a credit memo gets generated and the admin sets “No” in the “Decrease Stock When Order is Placed” option from Stores -> Settings -> Configuration -> Catalog -> Inventory.

For instance, salable quantity is deducted when an order gets placed. Now, what if a credit memo gets generated before generating shipment? When a credit memo is generated directly without shipment generation, it deducts the quantity of any one source from multiple sources. How can you identify that it decreased the quantity of which source?

In that case, Magento assigns priority in the multi-source inventory. The whole system manages the addition and deduction of stock based on priority.

Now, what if you want to keep track of the source information assigned to stock in your Magento 2 store? What if you’re going to identify stock changes in the particular source in ascending or descending order?

In that scenario, you need to get source information assigned to stock by priority in Magento 2 using the below solution:

Method to Get Source Information Assigned to Stock by Priority in Magento 2

You can get stock information as shown below:

That’s it.

If you have queries, feel free to ask in the Comment section below.

I would like to solve your problem.

Don’t forget to share this post with Magento Community via social media.

Thank you.

(based on 10 Reviews)
How to Get Source Information Assigned to Stock by Priority in Magento 2Author Magento Badge

Sanjay Jethva

Sanjay is a co-founder at Meetanshi. He is a Certified Magento Developer who loves creating Magento E-commerce solutions. Owing to his contributions in Magento Forums and posting solutions, he is among the top 50 contributors of the Magento community in 2019. When he is not engrossed with anything related to Magento, he loves to play cricket.

Leave a Reply

Your email address will not be published. Required fields are marked *