Magento – Out of stock products still appear in the frontend, search and others – Magento 2.1.0

magento2out-of-stock

I see that my installation of Magento 2.1.0 has a problem! Refuses to hide out of stock products from search and category pages! I cleared the cache, I reindexed, but no luck!

Can you give me any advice?

My products are with stock 0, but in front, they appear in stock, and when you order them it gives you this error:

We don't have as many "Item's name" as you requested.

Thanks

Later edit :

I also know this information :

Set in admin > Stores > configuration > Catalog > Inventory > Stock Options > Display Out of Stock Products to NO

This is actually a feature of Magento.
Setting Display out-of-stock products to No only hides them from the category list pages and the search results page.
The product page is actually still available.
Starting with CE 1.9.1 there is even a message under the config setting Display out of stock products saying Products will still be shown by direct product URLs.
And this is actually a good thing.
This way search engines don't register a lot of 404 pages when your products get out of stock.
I don't see the harm in leaving it like that. The customer cannot order them anyway.
If you want a product not to be available at all in your store you have to mark it as disabled or set its visibility to Not visible individually or remove its association to the websites from the websites tab on the admin product edit page.
Source: Out of stock products still appear in the frontend

Best Answer

Go to admin > Stores > configuration > Catalog > Inventory > Stock Options

Set Display Out of Stock Products to NO

enter image description here

Related Topic