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.
This is in the Store>Catalog>Product>"Item page"
The Inventory configuration is as follow:
Someone has a solution for this?
Best and thanks a lot for your support
Having the same issue after migrating website from one server to another. And none of products are displayed on website. Any solutions?
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.
Hello @eerojas64 ,
For managing the default salable qty Magento using a database view called inventory_stock_1 which will get created on installing Magento.
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.
Hello @Sarvagya Pandey ,
Can I ask you where you executed that command?
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
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.
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
inventory_stock_1 is created but not working.
Please suggest any other solution.