This answer is not helpful,by default this option already set to "No" and in this case product is still showing on the product listing page and only after clicking on "Add To Cart" user knows that this product is "Out Of Stock".
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.
KINDLY LEAVE KUDO.
@Wakar wrote:This answer is not helpful,by default this option already set to "No" and in this case product is still showing on the product listing page and only after clicking on "Add To Cart" user knows that this product is "Out Of Stock".
USe this sql and change DATABASE_NAME AND USER
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `DATABASE_NAME`
--
-- --------------------------------------------------------
--
-- Structure for view `inventory_stock_1`
--
CREATE ALGORITHM=UNDEFINED DEFINER=`USER_NAME`@`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`))) ;
--
-- VIEW `inventory_stock_1`
-- Data: None
--
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
Just reindex using SSH:
php domains/domain/public_html/bin/magento indexer:reindex
It works by me. After reindex and flush cache the salable quantity appears.
Hello this is still happening in Magento 2.3.4.
When salable quantity is 0 non logged in users see the items in stock and logged in users see them as out of stock.
Anyone has found a solution yet?
Already set no , its doesn't help me
Thanks! My affected products were all showing as In Stock, but I changed them to Out of Stock and then back to In Stock and it worked.