cancel
Showing results for 
Search instead for 
Did you mean: 

How does 'salable quantity' work?

Highlighted

How does 'salable quantity' work?

Hi,

Using CE 2.3.2

I have products in my inventory with zero 'salable quantity' but that are still showing 'in stock'  and selectable with the dropdown menu on the product pages. Does Magento use 'salable quantity' as the variable by which to define in stock and out of stock products? If so, then why could mine be incorrect? I should add that these products have a 'quantity' of more than zero - i.e. I've sold them, but they haven't shipped yet.

 

Any help to make things clearer would be appreciated. Thank you.

6 REPLIES 6
Highlighted

Re: How does 'salable quantity' work?

Hi @andrew_moss,

 

Saleable qty is introduced in magento 2.3 with MSI.

 

Saleable qty is available qty for sell, ordered qty saved in reservation table.

 

For more info:

https://devdocs.magento.com/guides/v2.3/inventory/reservations.html

 

I hope it will help you!

----
Problem solved? Click Accept as Solution!
Highlighted

Re: How does 'salable quantity' work?

Thanks for that, but if I have a 'salable quantity' of zero on a product, then that means I have zero to sell, so why could my products still be showing 'in stock'? Thanks.

Highlighted

Re: How does 'salable quantity' work?

Try once reindexing

 

php bin/magento indexer:reindex

 

Also make sure that you have disabled back order. 

----
Problem solved? Click Accept as Solution!
Highlighted

Re: How does 'salable quantity' work?

Hi @andrew_moss 

 

If you have imported products then you can try below solution as well.

 

AwesomeScreenshot-localhost-phpmyadmin-index.php-2019-08-18_1_28.png

When you import database from your local or different server, the view won’t be there with your SQL dump and hence Magento won’t be able to calculate the salable qty.

As a result, the entire products will get disappeared from the shop front end after a re-index or cache flush.

To solve this issue, you will need to manually create the view in your new database by executing the below SQL.

CREATE ALGORITHM=UNDEFINED DEFINER=`{database_user}`@`localhost` 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`)) ) ; 

Note : Replace {database_user} with your actual database user with enough privileges.

Once you executed the query in your database, you may need to flush Magento Cache to update the salable qty in the products grid and on frontend.

 

I hope it will help you!

----
Problem solved? Click Accept as Solution!
Highlighted

Re: How does 'salable quantity' work?

Thank you Vimal, I have reindexed a dozen times, and my back-orders are off.

 

Is Magento supposed to use 'saleable quantity' or 'quantity' to define when a product is out of stock?

 

One of my products went out of stock when all of them were shipped, and 'quantity' went to zero, but it seems ridiculous that Magento would use 'quantity' rather than 'salable quantity' to define whether a product is out of stock.

Highlighted

Re: How does 'salable quantity' work?

Thanks Vimal, I do already have the 'inventory_stock_1' table view. But, again that seems to use 'quantity' as the guide to whether 'is_salable' = 1, which seems odd.