Log in
Model

AddProductsToCartError

Magento\Quote\Model\Cart\AddProductsToCartError

What it does

This class creates error objects when products cannot be added to a shopping cart, particularly for insufficient stock scenarios.

It maps error messages to standardized error codes and encapsulates error details like cart item position and available stock quantity.

Developers use this when handling add-to-cart failures to provide consistent, structured error information to customers.

Public Methods

  • create()