cancel
Showing results for 
Search instead for 
Did you mean: 

After Import product, now Product Salable Quantity is Default Stock : 0

After Import product, now Product Salable Quantity is Default Stock : 0

Hi, Hello, I am working with Magento 2.2.3 and it presents many problems of Indexing, Search, Import, Export, etc. This particular problem does so after the Item is imported. The product is in Stock and says: Salable Quantity: 0, but the Stock Quantity is 2. This makes the product invisible on the website.

 

Screenshot_2.png

This is in the Store>Catalog>Product>"Item page"

Store > Catalog > Product > Product Salable QuantityStore > Catalog > Product > Product Salable Quantity

The Inventory configuration is as follow:

Screenshot_3.png

Someone has a solution for this?

 

Best and thanks a lot for your support

10 REPLIES 10

Re: After Import product, now Product Salable Quantity is Default Stock : 0

Having the same issue after migrating website from one server to another. And none of products are displayed on website. Any solutions? 

Re: After Import product, now Product Salable Quantity is Default Stock : 0

Try the reindexing once.

php bin/magento indexer:reindex

Then flush the cache

php bin/magento cache:flush

Re: After Import product, now Product Salable Quantity is Default Stock : 0

Hi Vimal,

 

I tried this before and after you suggested as well but it did not work.  Context: I migrated this website from one server to another. From amazon to liquidweb VPS. 

Re: After Import product, now Product Salable Quantity is Default Stock : 0

Hello @eerojas64 ,

For managing the default salable qty Magento using a database view called inventory_stock_1 which will get created on installing Magento.

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.

Hope this will work for you.

If it helps you, please give us kudos and accept it as solution.

Regards.

Re: After Import product, now Product Salable Quantity is Default Stock : 0

Hello @Sarvagya Pandey ,

Can I ask you where you executed that command?

Re: After Import product, now Product Salable Quantity is Default Stock : 0

As far as I know
I did it, and it said succeeded,

 

Also because of the help of the eglobeits site.

 

Still products don't appear on front site, anyone got any clue?

Thanks Alain

Re: After Import product, now Product Salable Quantity is Default Stock : 0

Please make sure you have a view table inventory_stock_1 in your database.

 

This issue can come if you have migrated database from one to another so that time you may be missed to migrate view tables.

Re: After Import product, now Product Salable Quantity is Default Stock : 0

This SQL query works. It basically recreates the missing view table in your migrated db. Thanks for pointing that out, because I had no clue "Salable Quantity" actually uses that table

Re: After Import product, now Product Salable Quantity is Default Stock : 0

inventory_stock_1 is created but not working.

 

Please suggest any other solution.