Model

Stock

Magento\CatalogInventory\Model\Source\Stock

What it does

This class serves as a source model for product stock status attributes, providing options for 'In Stock' and 'Out of Stock' statuses.

Developers use this when rendering stock status dropdowns in the admin panel or when they need to add stock-based sorting to product collections.

It's marked as deprecated and has been replaced by Magento's Multi Source Inventory (MSI) system.

Public Methods

  • getAllOptions()
  • addValueSortToCollection()