Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields
CartInterface Interface Reference
Inheritance diagram for CartInterface:
ExtensibleDataInterface Quote

Public Member Functions

 getId ()
 
 setId ($id)
 
 getCreatedAt ()
 
 setCreatedAt ($createdAt)
 
 getUpdatedAt ()
 
 setUpdatedAt ($updatedAt)
 
 getConvertedAt ()
 
 setConvertedAt ($convertedAt)
 
 getIsActive ()
 
 setIsActive ($isActive)
 
 getIsVirtual ()
 
 getItems ()
 
 setItems (array $items=null)
 
 getItemsCount ()
 
 setItemsCount ($itemsCount)
 
 getItemsQty ()
 
 setItemsQty ($itemQty)
 
 getCustomer ()
 
 setCustomer (\Magento\Customer\Api\Data\CustomerInterface $customer=null)
 
 getBillingAddress ()
 
 setBillingAddress (\Magento\Quote\Api\Data\AddressInterface $billingAddress=null)
 
 getReservedOrderId ()
 
 setReservedOrderId ($reservedOrderId)
 
 getOrigOrderId ()
 
 setOrigOrderId ($origOrderId)
 
 getCurrency ()
 
 setCurrency (\Magento\Quote\Api\Data\CurrencyInterface $currency=null)
 
 getCustomerIsGuest ()
 
 setCustomerIsGuest ($customerIsGuest)
 
 getCustomerNote ()
 
 setCustomerNote ($customerNote)
 
 getCustomerNoteNotify ()
 
 setCustomerNoteNotify ($customerNoteNotify)
 
 getCustomerTaxClassId ()
 
 setCustomerTaxClassId ($customerTaxClassId)
 
 getStoreId ()
 
 setStoreId ($storeId)
 
 getExtensionAttributes ()
 
 setExtensionAttributes (\Magento\Quote\Api\Data\CartExtensionInterface $extensionAttributes)
 

Data Fields

const KEY_ID = 'id'
 
const KEY_ENTITY_ID = 'entity_id'
 
const KEY_CREATED_AT = 'created_at'
 
const KEY_UPDATED_AT = 'updated_at'
 
const KEY_CONVERTED_AT = 'converted_at'
 
const KEY_IS_ACTIVE = 'is_active'
 
const KEY_IS_VIRTUAL = 'is_virtual'
 
const KEY_ITEMS = 'items'
 
const KEY_ITEMS_COUNT = 'items_count'
 
const KEY_ITEMS_QTY = 'items_qty'
 
const KEY_CUSTOMER = 'customer'
 
const KEY_CHECKOUT_METHOD = 'checkout_method'
 
const KEY_SHIPPING_ADDRESS = 'shipping_address'
 
const KEY_BILLING_ADDRESS = 'billing_address'
 
const KEY_RESERVED_ORDER_ID = 'reserved_order_id'
 
const KEY_ORIG_ORDER_ID = 'orig_order_id'
 
const KEY_CURRENCY = 'currency'
 
const KEY_CUSTOMER_IS_GUEST = 'customer_is_guest'
 
const KEY_CUSTOMER_NOTE = 'customer_note'
 
const KEY_CUSTOMER_NOTE_NOTIFY = 'customer_note_notify'
 
const KEY_CUSTOMER_TAX_CLASS_ID = 'customer_tax_class_id'
 
const KEY_STORE_ID = 'store_id'
 
- Data Fields inherited from ExtensibleDataInterface
const EXTENSION_ATTRIBUTES_KEY = 'extension_attributes'
 

Detailed Description

Interface CartInterface @api

Since
100.0.2

Definition at line 13 of file CartInterface.php.

Member Function Documentation

◆ getBillingAddress()

getBillingAddress ( )

Returns the cart billing address.

Returns
\Magento\Quote\Api\Data\AddressInterface|null Cart billing address. Otherwise, null.

Implemented in Quote.

◆ getConvertedAt()

getConvertedAt ( )

Returns the cart conversion date and time.

Returns
string|null Cart conversion date and time. Otherwise, null.

Implemented in Quote.

◆ getCreatedAt()

getCreatedAt ( )

Returns the cart creation date and time.

Returns
string|null Cart creation date and time. Otherwise, null.

Implemented in Quote.

◆ getCurrency()

getCurrency ( )

Returns information about quote currency, such as code, exchange rate, and so on.

Returns
\Magento\Quote\Api\Data\CurrencyInterface|null Quote currency information. Otherwise, null.

Implemented in Quote.

◆ getCustomer()

getCustomer ( )

Returns information about the customer who is assigned to the cart.

Returns
\Magento\Customer\Api\Data\CustomerInterface Information about the customer who is assigned to the cart.

Implemented in Quote.

◆ getCustomerIsGuest()

getCustomerIsGuest ( )

True for guest customers, false for logged in customers

Returns
bool|null

Implemented in Quote.

◆ getCustomerNote()

getCustomerNote ( )

Customer notice text

Returns
string|null

Implemented in Quote.

◆ getCustomerNoteNotify()

getCustomerNoteNotify ( )

Send customer notification flag

Returns
bool|null

Implemented in Quote.

◆ getCustomerTaxClassId()

getCustomerTaxClassId ( )

Get customer tax class ID.

Returns
int|null

Implemented in Quote.

◆ getExtensionAttributes()

getExtensionAttributes ( )

Retrieve existing extension attributes object or create a new one.

Returns
\Magento\Quote\Api\Data\CartExtensionInterface|null

Implemented in Quote.

◆ getId()

getId ( )

#- Returns the cart/quote ID.

Returns
int Cart/quote ID.

◆ getIsActive()

getIsActive ( )

Determines whether the cart is still active.

Returns
bool|null Active status flag value. Otherwise, null.

Implemented in Quote.

◆ getIsVirtual()

getIsVirtual ( )

Determines whether the cart is a virtual cart.

A virtual cart contains virtual items.

Returns
bool|null Virtual flag value. Otherwise, null.

Implemented in Quote.

◆ getItems()

getItems ( )

Lists items in the cart.

Returns
\Magento\Quote\Api\Data\CartItemInterface[]|null Array of items. Otherwise, null.

Implemented in Quote.

◆ getItemsCount()

getItemsCount ( )

Returns the number of different items or products in the cart.

Returns
int|null Number of different items or products in the cart. Otherwise, null.

Implemented in Quote.

◆ getItemsQty()

getItemsQty ( )

Returns the total quantity of all cart items.

Returns
float|null Total quantity of all cart items. Otherwise, null.

Implemented in Quote.

◆ getOrigOrderId()

getOrigOrderId ( )

Returns the original order ID for the cart.

Returns
int|null Original order ID. Otherwise, null.

Implemented in Quote.

◆ getReservedOrderId()

getReservedOrderId ( )

Returns the reserved order ID for the cart.

Returns
int|null Reserved order ID. Otherwise, null.

Implemented in Quote.

◆ getStoreId()

getStoreId ( )

Get store identifier

Returns
int

Implemented in Quote.

◆ getUpdatedAt()

getUpdatedAt ( )

Returns the cart last update date and time.

Returns
string|null Cart last update date and time. Otherwise, null.

Implemented in Quote.

◆ setBillingAddress()

setBillingAddress ( \Magento\Quote\Api\Data\AddressInterface  $billingAddress = null)

Sets the cart billing address.

Parameters
\Magento\Quote\Api\Data\AddressInterface$billingAddress
Returns
$this

◆ setConvertedAt()

setConvertedAt (   $convertedAt)

Sets the cart conversion date and time.

Parameters
string$convertedAt
Returns
$this

Implemented in Quote.

◆ setCreatedAt()

setCreatedAt (   $createdAt)

Sets the cart creation date and time.

Parameters
string$createdAt
Returns
$this

Implemented in Quote.

◆ setCurrency()

setCurrency ( \Magento\Quote\Api\Data\CurrencyInterface  $currency = null)

Sets information about quote currency, such as code, exchange rate, and so on.

Parameters
\Magento\Quote\Api\Data\CurrencyInterface$currency
Returns
$this

◆ setCustomer()

setCustomer ( \Magento\Customer\Api\Data\CustomerInterface  $customer = null)

Sets information about the customer who is assigned to the cart.

Parameters
\Magento\Customer\Api\Data\CustomerInterface$customer
Returns
$this

◆ setCustomerIsGuest()

setCustomerIsGuest (   $customerIsGuest)

Sets true for guest customers, false for logged in customers

Parameters
bool$customerIsGuest
Returns
$this

Implemented in Quote.

◆ setCustomerNote()

setCustomerNote (   $customerNote)

Sets Customer notice text

Parameters
string$customerNote
Returns
$this

Implemented in Quote.

◆ setCustomerNoteNotify()

setCustomerNoteNotify (   $customerNoteNotify)

Sets send customer notification flag

Parameters
bool$customerNoteNotify
Returns
$this

Implemented in Quote.

◆ setCustomerTaxClassId()

setCustomerTaxClassId (   $customerTaxClassId)

Set customer tax class ID.

Parameters
int$customerTaxClassId
Returns
$this

Implemented in Quote.

◆ setExtensionAttributes()

setExtensionAttributes ( \Magento\Quote\Api\Data\CartExtensionInterface  $extensionAttributes)

Set an extension attributes object.

Parameters
\Magento\Quote\Api\Data\CartExtensionInterface$extensionAttributes
Returns
$this

◆ setId()

setId (   $id)

Sets the cart/quote ID.

Parameters
int$id
Returns
$this

◆ setIsActive()

setIsActive (   $isActive)

Sets whether the cart is still active.

Parameters
bool$isActive
Returns
$this

Implemented in Quote.

◆ setItems()

setItems ( array  $items = null)

Sets items in the cart.

Parameters

Implemented in Quote.

◆ setItemsCount()

setItemsCount (   $itemsCount)

Sets the number of different items or products in the cart.

Parameters
int$itemsCount
Returns
$this

Implemented in Quote.

◆ setItemsQty()

setItemsQty (   $itemQty)

Sets the total quantity of all cart items.

Parameters
float$itemQty
Returns
$this

Implemented in Quote.

◆ setOrigOrderId()

setOrigOrderId (   $origOrderId)

Sets the original order ID for the cart.

Parameters
int$origOrderId
Returns
$this

Implemented in Quote.

◆ setReservedOrderId()

setReservedOrderId (   $reservedOrderId)

Sets the reserved order ID for the cart.

Parameters
int$reservedOrderId
Returns
$this

Implemented in Quote.

◆ setStoreId()

setStoreId (   $storeId)

Sets store identifier

Parameters
int$storeId
Returns
$this

Implemented in Quote.

◆ setUpdatedAt()

setUpdatedAt (   $updatedAt)

Sets the cart last update date and time.

Parameters
string$updatedAt
Returns
$this

Implemented in Quote.

Field Documentation

◆ KEY_BILLING_ADDRESS

const KEY_BILLING_ADDRESS = 'billing_address'

Definition at line 44 of file CartInterface.php.

◆ KEY_CHECKOUT_METHOD

const KEY_CHECKOUT_METHOD = 'checkout_method'

Definition at line 40 of file CartInterface.php.

◆ KEY_CONVERTED_AT

const KEY_CONVERTED_AT = 'converted_at'

Definition at line 26 of file CartInterface.php.

◆ KEY_CREATED_AT

const KEY_CREATED_AT = 'created_at'

Definition at line 22 of file CartInterface.php.

◆ KEY_CURRENCY

const KEY_CURRENCY = 'currency'

Definition at line 50 of file CartInterface.php.

◆ KEY_CUSTOMER

const KEY_CUSTOMER = 'customer'

Definition at line 38 of file CartInterface.php.

◆ KEY_CUSTOMER_IS_GUEST

const KEY_CUSTOMER_IS_GUEST = 'customer_is_guest'

Definition at line 52 of file CartInterface.php.

◆ KEY_CUSTOMER_NOTE

const KEY_CUSTOMER_NOTE = 'customer_note'

Definition at line 54 of file CartInterface.php.

◆ KEY_CUSTOMER_NOTE_NOTIFY

const KEY_CUSTOMER_NOTE_NOTIFY = 'customer_note_notify'

Definition at line 56 of file CartInterface.php.

◆ KEY_CUSTOMER_TAX_CLASS_ID

const KEY_CUSTOMER_TAX_CLASS_ID = 'customer_tax_class_id'

Definition at line 58 of file CartInterface.php.

◆ KEY_ENTITY_ID

const KEY_ENTITY_ID = 'entity_id'

Definition at line 20 of file CartInterface.php.

◆ KEY_ID

const KEY_ID = 'id'

#+ Constants defined for keys of array, makes typos less likely

Definition at line 18 of file CartInterface.php.

◆ KEY_IS_ACTIVE

const KEY_IS_ACTIVE = 'is_active'

Definition at line 28 of file CartInterface.php.

◆ KEY_IS_VIRTUAL

const KEY_IS_VIRTUAL = 'is_virtual'

Definition at line 30 of file CartInterface.php.

◆ KEY_ITEMS

const KEY_ITEMS = 'items'

Definition at line 32 of file CartInterface.php.

◆ KEY_ITEMS_COUNT

const KEY_ITEMS_COUNT = 'items_count'

Definition at line 34 of file CartInterface.php.

◆ KEY_ITEMS_QTY

const KEY_ITEMS_QTY = 'items_qty'

Definition at line 36 of file CartInterface.php.

◆ KEY_ORIG_ORDER_ID

const KEY_ORIG_ORDER_ID = 'orig_order_id'

Definition at line 48 of file CartInterface.php.

◆ KEY_RESERVED_ORDER_ID

const KEY_RESERVED_ORDER_ID = 'reserved_order_id'

Definition at line 46 of file CartInterface.php.

◆ KEY_SHIPPING_ADDRESS

const KEY_SHIPPING_ADDRESS = 'shipping_address'

Definition at line 42 of file CartInterface.php.

◆ KEY_STORE_ID

const KEY_STORE_ID = 'store_id'

Definition at line 60 of file CartInterface.php.

◆ KEY_UPDATED_AT

const KEY_UPDATED_AT = 'updated_at'

Definition at line 24 of file CartInterface.php.


The documentation for this interface was generated from the following file: