Model

ProductCollectionStockCondition

Magento\CatalogInventory\Model\ProductCollectionStockCondition

What it does

This class modifies product collections by adding stock status filters and joining stock data to each product.

It automatically filters out products that are out of stock when the Magento configuration doesn't allow showing out-of-stock items.

Developers would use this when working with product collections that need to respect inventory visibility settings.

Public Methods

  • apply()