Log in
Interface

CartItemInterface

Magento\Quote\Api\Data\CartItemInterface

What it does

This interface defines the data structure for shopping cart items in Magento 2.

Developers use this when working with quote/cart functionality to retrieve or set item properties like SKU, quantity, price, and product type through the API layer.

It's essential for checkout flows, cart management, and any custom extensions that need to interact with cart items programmatically.

Public Methods

  • getItemId()
  • setItemId()
  • getSku()
  • setSku()
  • getQty()
  • setQty()
  • getName()
  • setName()
  • getPrice()
  • setPrice()
  • getProductType()
  • setProductType()
  • getQuoteId()
  • setQuoteId()
  • getProductOption()
  • setProductOption()
  • getExtensionAttributes()
  • setExtensionAttributes()