9

Actually in my case Salable Quantity is showing zero in product grid Magento 2.3?

Due to this issue, products are not showing in frontend. If anyone has any idea please tell me.

For this re-indexing is done but even Salable Quantity is showing zero(0).

  • try to allow out of stock backorder and check if the products will be displayed. This is not a fix but at least to check wether the exact problem is the salable qty. – fmsthird Jan 8 at 3:42
  • have you fixed it? – fmsthird Jan 9 at 4:17
  • yes actually there was a permission problem in our server – Hitesh Balpande Jan 9 at 4:52
  • Hi, Have you found out the issue? – Octopus Feb 6 at 9:33
  • 1
    @Octopus,yes reindex worked always but there was permission in server then it is resolved – Hitesh Balpande Feb 6 at 9:46
15

IN DataBase There was two type 1> Tables and 2> Views The issue is possibly caused When Import/Export DataBase Views Was Not Created in magento 2.3 So Create Views and inventory_stock_1 table In DataBase.

See Attached Image enter image description here

  • 1
    Thank you so much. After spending 2 hours I got the solutions from your answer. Thanks again. – Kamlesh Solanki Jun 29 at 15:33
  • 2
    +1 For Great Answer – Sanjay Gohil Jul 19 at 10:31
  • @Savan its already created at my end. but still facing same issue – insoftservice Aug 15 at 6:50
  • @insoftservice I am facing the same issue, did you get any idea? – Hardik Visa Oct 8 at 10:07
  • @HardikVisa do you have this view at your end. If yes just try to execute it manually at my end it was given permission issue which got resolved by granting full permission. – insoftservice Oct 8 at 12:12
8

I skipped this line of query, due to Previllages error and my add to cart was not working on live server, in local server this line was not skipped and add to cart was working fine.

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`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`))) ;

Because the View was not created in the live server enter image description here

0

Please try the below steps:

Admin -> Stores -> Inventory -> Stock -> Edit Default Stock -> Sales Channels -> select Main Website

It worked fine.

OR find the below link

https://webkul.com/blog/get-salable-quantity-in-magento-2-3/

0

I just changed to STORE -> CATELOG -> INVENTORY -> PRODUCTS STOCK OPTIONS -> BACKORDERS -> Allow Qty Below 0

and the issue solved

0

I also faced the same issue while working on my magento store. I was able to get the simplest solution from this blog. Visit this link

0

i had to remove the DEFINER=root@localhost from @Thakur answer so here is what i used

CREATE ALGORITHM=UNDEFINED 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`))) ;

failure to remove it caused privilege error.

Happy Coding

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.