Model

QuantityValidator

Magento\CatalogInventory\Model\Quote\Item\QuantityValidator

What it does

This class validates quote item quantities against inventory stock levels when products are added to or updated in the shopping cart.

Developers would use this to ensure customers cannot add out-of-stock products or quantities exceeding available inventory, handling both simple products and products with custom options.

It's marked as deprecated in favor of the Multi Source Inventory (MSI) system.

Public Methods

  • validate()