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

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.

Get Weekly Updates

Never miss Magento tips, tricks, tutorials, and news.

Thank you for subscribing.

Something went wrong.

(based on 10 Reviews)

Yash is a Magento Developer at Meetanshi. He loves playing computer games and watching action movies. For brain exercise, he likes to play Chess.

Leave a reply:

Your email address will not be published.