Model
Item
Magento\Quote\Model\Quote\Item
What it does
This model represents a single item in a shopping cart (quote).
Developers use this class when working with cart items - adding products to cart, updating quantities, managing item options (like custom configurations), calculating prices, and handling item-specific errors.
It's the core class for cart item operations in Magento 2.
Public Methods
- beforeSave()
- getAddress()
- setQuote()
- getQuote()
- addQty()
- setQty()
- getQtyOptions()
- setQtyOptions()
- setProduct()
- representProduct()
- compareOptions()
- compare()
- getProductType()
- getRealProductType()
- toArray()
- setOptions()
- getOptions()
- getOptionsByCode()
- addOption()
- updateQtyOption()
- removeOption()
- getOptionByCode()
- saveItemOptions()
- setIsOptionsSaved()
- isOptionsSaved()
- afterSave()
- getBuyRequest()
- setHasError()
- addErrorInfo()
- getErrorInfos()
- removeErrorInfosByParams()
- getItemId()
- setItemId()
- getSku()
- setSku()
- getQty()
- getName()
- setName()
- getPrice()
- setPrice()
- setProductType()
- getQuoteId()
- setQuoteId()
- getProductOption()
- setProductOption()
- getExtensionAttributes()
- setExtensionAttributes()