Mage_Sales_Model_Quote
extends Mage_Core_Model_Abstract
in package
Quote model
Supported events: sales_quote_load_after sales_quote_save_before sales_quote_save_after sales_quote_delete_before sales_quote_delete_after
Table of Contents
Properties
- $_addresses : Mage_Sales_Model_Resource_Order_Address_Collection|null
- Quote addresses collection
- $_cacheTag : string|bool|array<string|int, mixed>
- Model cache tag for clear cache in after save and after delete
- $_customer : Mage_Customer_Model_Customer|null
- Quote customer model object
- $_data : array<string|int, mixed>|null
- Object attributes
- $_dataSaveAllowed : bool
- Flag which can stop data saving after before save Can be used for next sequence: we check data in _beforeSave, if data are not valid - we can set this flag to false value and save process will be stopped
- $_dirty : array<string|int, mixed>
- $_errorInfoGroups : array<string|int, mixed>
- Different groups of error infos
- $_eventObject : string
- Parameter name in event
- $_eventPrefix : string
- Prefix of model events names
- $_hasDataChanges : bool
- Data changes flag (true after setData|unsetData call)
- $_idFieldName : string
- Name of object id field
- $_isDeleted : bool
- Object delete flag
- $_isObjectNew : bool|null
- Flag which allow detect object state: is it new object (without id) or existing one (with id)
- $_items : Mage_Sales_Model_Resource_Quote_Item_Collection|null
- Quote items collection
- $_oldFieldsMap : array<string|int, mixed>
- Map short fields names to its full names
- $_origData : array<string|int, mixed>|null
- Original data that was loaded
- $_payments : Mage_Sales_Model_Resource_Quote_Payment_Collection|null
- Quote payments
- $_preventSaving : bool
- Whether quote should not be saved
- $_resource : Mage_Core_Model_Resource_Db_Abstract
- Resource model instance
- $_resourceCollectionName : string
- Name of the resource collection model
- $_resourceName : string
- Name of the resource model
- $_syncFieldsMap : mixed
- Map of fields to sync to other fields upon changing their data
- $_underscoreCache : array<string|int, mixed>
- Setter/Getter underscore transformation cache
Methods
- __call() : mixed
- Set/Get attribute wrapper
- __construct() : mixed
- Constructor
- __get() : mixed
- Attribute getter (deprecated)
- __set() : mixed
- Attribute setter (deprecated)
- __toArray() : array<string|int, mixed>
- Convert object attributes to array
- _getResource() : Mage_Sales_Model_Resource_Quote
- Get resource instance
- addAddress() : $this
- addData() : $this
- Add data to the object.
- addErrorInfo() : $this
- Adds error information to the quote.
- addItem() : $this
- Adding new item to quote
- addMessage() : $this
- addPayment() : $this
- addProduct() : Mage_Sales_Model_Quote_Item|string
- Add product to quote
- addProductAdvanced() : Mage_Sales_Model_Quote_Item|string
- Advanced func to add product to quote - processing mode can be specified there.
- addShippingAddress() : $this
- afterCommitCallback() : $this
- Callback function which called after transaction commit in resource model
- afterLoad() : $this
- Object after load processing. Implemented as public interface for supporting objects after load in collections
- assignCustomer() : $this
- Assign customer model object data to quote
- assignCustomerWithAddressChange() : $this
- Assign customer model to quote with billing and shipping address change
- cleanModelCache() : $this
- Remove model object related cache
- clearInstance() : $this
- Clearing object for correct deleting by garbage collector
- collectTotals() : $this
- Collect totals
- dataHasChangedFor() : bool
- Compare object data with original data
- debug() : string|array<string|int, mixed>
- Present object data as string in debug mode
- delete() : $this
- Delete object from database
- deleteItem() : $this
- Delete quote item. If it does not have identifier then it will be only removed from collection
- flagDirty() : $this
- getAddressByCustomerAddressId() : Mage_Sales_Model_Quote_Address|false
- getAddressById() : Mage_Sales_Model_Quote_Address|false
- getAddressesCollection() : Mage_Sales_Model_Resource_Order_Address_Collection
- Retrieve quote address collection
- getAllAddresses() : array<string|int, Mage_Sales_Model_Quote_Address>
- getAllItems() : array<string|int, Mage_Sales_Model_Quote_Item>
- Retrieve quote items array
- getAllShippingAddresses() : array<string|int, Mage_Sales_Model_Quote_Address>
- getAllVisibleItems() : array<string|int, Mage_Sales_Model_Quote_Item>
- Get array of all items what can be display directly
- getAppliedRuleIds() : string|null
- getBaseCurrencyCode() : string|null
- getBaseGrandTotal() : float|null
- getBaseSubtotal() : float|null
- getBaseSubtotalWithDiscount() : float|null
- getBaseToGlobalRate() : float|null
- getBaseToQuoteRate() : float|null
- getBillingAddress() : Mage_Sales_Model_Quote_Address
- Retrieve quote billing address
- getCacheIdTags() : array<string|int, mixed>|false
- Get cache tags associated with object id
- getCacheTags() : array<string|int, mixed>|false
- Get list of cache tags applied to model object.
- getCanApplyMsrp() : bool|null
- getChangedFlag() : bool|null
- getCheckoutMethod() : string
- Return quote checkout method code
- getCollection() : Mage_Core_Model_Resource_Db_Collection_Abstract|false
- getConvertedAt() : string|null
- getCouponCode() : string
- getCreatedAt() : string|null
- getCustomer() : Mage_Customer_Model_Customer
- Retrieve customer model object
- getCustomerDob() : string|null
- getCustomerEmail() : string|null
- getCustomerFirstname() : string|null
- getCustomerGender() : int|null
- getCustomerGroupId() : int
- getCustomerId() : int|null
- getCustomerIsGuest() : bool|null
- getCustomerIsNew() : bool|null
- getCustomerLastname() : string|null
- getCustomerMiddlename() : string|null
- getCustomerNote() : string|null
- getCustomerNoteNotify() : bool|null
- getCustomerPrefix() : string|null
- getCustomerSuffix() : string|null
- getCustomerTaxClassId() : mixed
- getCustomerTaxvat() : string|null
- getData() : mixed
- Object data getter
- getDataByKey() : mixed
- Get object data by particular key
- getDataByPath() : mixed
- Get object data by path
- getDataSetDefault() : mixed
- Fast get data or set default if value is not available
- getDataUsingMethod() : mixed
- Get object data by key with calling getter method
- getEntityId() : int
- getErrors() : array<string|int, mixed>
- Retrieve current quote errors
- getExtShippingInfo() : string|null
- getForcedCurrency() : Mage_Directory_Model_Currency|null
- getGiftMessageId() : int|null
- getGlobalCurrencyCode() : string|null
- getGrandTotal() : float|null
- getHasError() : bool|null
- getId() : int|string|null
- Retrieve model object identifier
- getIdFieldName() : string
- Retrieve identifier field name for model
- getIgnoreOldQty() : bool|null
- getInventoryProcessed() : bool|null
- getIsActive() : bool|null
- getIsChanged() : bool|null
- getIsCheckoutCart() : bool|null
- getIsMultiPayment() : bool|null
- getIsSuperMode() : bool|null
- getIsVirtual() : bool
- Check quote for virtual product only
- getItemById() : Mage_Sales_Model_Quote_Item
- Retrieve item model object by item identifier
- getItemByProduct() : Mage_Sales_Model_Quote_Item|false
- Retrieve quote item by product id
- getItemsCollection() : Mage_Sales_Model_Resource_Quote_Item_Collection
- Retrieve quote items collection
- getItemsCount() : int|null
- getItemsQty() : float|null
- getItemsSummaryQty() : float|int|mixed
- getItemVirtualQty() : int|mixed
- getMessages() : array<string|int, Mage_Core_Model_Message_Abstract>
- Retrieve current quote messages
- getMethod() : string|null
- getOrigData() : mixed
- Get object loaded data (original data)
- getOrigOrderId() : int|null
- getPasswordHash() : string|null
- getPayment() : Mage_Sales_Model_Quote_Payment
- getPaymentById() : false|Mage_Sales_Model_Quote_Payment
- getPaymentsCollection() : Mage_Sales_Model_Resource_Quote_Payment_Collection
- getQuoteCurrencyCode() : string|null
- getRemoteIp() : string|null
- getReservedOrderId() : string|null
- getResource() : Mage_Sales_Model_Resource_Quote
- Retrieve model resource
- getResourceCollection() : Mage_Core_Model_Resource_Db_Collection_Abstract
- Get collection instance
- getResourceName() : string
- Retrieve model resource name
- getSharedStoreIds() : array<string|int, mixed>
- Get all available store ids for quote
- getShippingAddress() : Mage_Sales_Model_Quote_Address
- Retrieve quote shipping address
- getShippingAddressByCustomerAddressId() : Mage_Sales_Model_Quote_Address|false
- getStore() : Mage_Core_Model_Store
- Get quote store model object
- getStoreCurrencyCode() : string|null
- getStoreId() : int
- Get quote store identifier
- getStoreToBaseRate() : float|null
- getStoreToQuoteRate() : float|null
- getSubtotal() : float|null
- getSubtotalWithDiscount() : float|null
- getTaxesForItems() : array<string|int, mixed>|null
- getTotals() : array<string|int, mixed>
- Get all quote totals (sorted by priority) Method process quote states isVirtual
- getTotalsCollectedFlag() : bool|null
- getTriggerRecollect() : bool|null
- getUpdatedAt() : string|null
- getVirtualItemsQty() : float|null
- getWebsite() : Mage_Core_Model_Website|null
- hasCanApplyMsrp() : bool
- hasChangedFlag() : bool
- hasData() : bool
- If $key is empty, checks whether there's any data in the object Otherwise checks if the specified attribute is set.
- hasDataChanges() : bool
- Get data change status
- hasErrors() : bool
- hasForcedCurrency() : bool
- hasItems() : bool
- Checking items availability
- hasItemsCollection() : bool
- hasItemsWithDecimalQty() : bool
- Checking availability of items with decimal qty
- hasNominalItems() : bool
- Getter whether quote has nominal items Can bypass treating virtual items as nominal
- hasProductId() : bool
- Checking product exist in Quote
- hasRecurringItems() : bool
- Whether there are recurring items
- hasStoreId() : bool
- hasVirtualItems() : bool
- Has a virtual products on quote
- isAllowedGuestCheckout() : bool
- Check is allow Guest Checkout
- isDeleted() : bool
- Set _isDeleted flag value (if $isDeleted param is defined) and return current flag value
- isDirty() : bool
- isEmpty() : bool
- checks whether the object is empty
- isModuleEnabled() : bool
- isNominal() : bool
- Whether quote has nominal items only
- isObjectNew() : bool
- Check object state (true - if it is object without id on object just created) This method can help detect if object just created in _afterSave method problem is what in after save object has id and we can't detect what object was created in this transaction
- isVirtual() : bool
- Check quote for virtual product only
- jsonSerialize() : array<string|int, mixed>
- Implementation of JsonSerializable::jsonSerialize()
- load() : $this
- Load object data
- loadActive() : $this
- Loading only active quote
- loadByCustomer() : $this
- Loading quote data by customer
- loadByIdWithoutStore() : $this
- Loading quote by identifier
- merge() : $this
- Merge quotes
- offsetExists() : bool
- Implementation of ArrayAccess::offsetExists()
- offsetGet() : mixed
- Implementation of ArrayAccess::offsetGet()
- offsetSet() : void
- Implementation of ArrayAccess::offsetSet()
- offsetUnset() : void
- Implementation of ArrayAccess::offsetUnset()
- prepareRecurringPaymentProfiles() : array<string|int, Mage_Payment_Model_Recurring_Profile>
- Create recurring payment profiles basing on the current items
- preventSaving() : $this
- Prevent quote from saving
- refreshCurrencyStamp() : static
- Restate which currency this quote's amounts are in, from the store as it is right now. Shared with placement, which needs these fields refreshed without saving, so the two can never drift apart.
- removeAddress() : $this
- removeAllAddresses() : $this
- Leave no more than one billing and one shipping address, fill them with default data
- removeAllItems() : $this
- Mark all quote items as deleted (empty quote)
- removeErrorInfosByParams() : $this
- Removes error infos, that have parameters equal to passed in $params.
- removeItem() : $this
- Remove quote item by item identifier
- removeMessageByText() : $this
- Removes message by text
- removePayment() : $this
- reserveOrderId() : $this
- Generate new increment order id and associate it with current quote
- save() : $this
- Save quote with prevention checking
- serialize() : string
- serialize object attributes
- setAppliedRuleIds() : static
- setAttribute() : $this
- setBaseCurrencyCode() : static
- setBaseGrandTotal() : static
- setBaseSubtotal() : static
- setBaseSubtotalWithDiscount() : static
- setBaseToGlobalRate() : static
- setBaseToQuoteRate() : static
- setBillingAddress() : $this
- setCheckoutMethod() : static
- setConvertedAt() : static
- setCouponCode() : $this
- setCreatedAt() : static
- setCustomer() : $this
- Define customer object
- setCustomerDob() : static
- setCustomerEmail() : static
- setCustomerFirstname() : static
- setCustomerGender() : static
- setCustomerGroupId() : static
- setCustomerId() : static
- setCustomerIsGuest() : static
- setCustomerIsNew() : static
- setCustomerLastname() : static
- setCustomerMiddlename() : static
- setCustomerNote() : static
- setCustomerNoteNotify() : static
- setCustomerPrefix() : static
- setCustomerSuffix() : static
- setCustomerTaxClassId() : static
- setCustomerTaxvat() : static
- setData() : $this
- Overwrite data in the object.
- setDataChanges() : $this
- Clears data changes status
- setDataUsingMethod() : $this
- Set object data with calling setter method
- setExtShippingInfo() : static
- setForcedCurrency() : static
- Price this quote in a currency other than the store's, refusing one with no rate from base.
- setGiftMessage() : static
- setGiftMessageId() : static
- setGlobalCurrencyCode() : static
- setGrandTotal() : static
- setHasError() : $this
- Sets flag, whether this quote has some error associated with it.
- setId() : $this
- Declare model object identifier value
- setIdFieldName() : $this
- set name of object id field
- setIgnoreOldQty() : static
- setInventoryProcessed() : static
- setIsActive() : static
- setIsChanged() : static
- setIsCheckoutCart() : static
- setIsSuperMode() : static
- setIsVirtual() : static
- setItemsCount() : static
- setItemsQty() : static
- setOrderId() : static
- setOrigData() : $this
- Initialize object original data
- setOrigOrderId() : static
- setPasswordHash() : static
- setPayment() : Mage_Sales_Model_Quote_Payment
- setQuoteCurrencyCode() : static
- setRemoteIp() : static
- setReservedOrderId() : static
- setSharedStoreIds() : static
- setShippingAddress() : $this
- setStore() : $this
- Declare quote store model
- setStoreCurrencyCode() : static
- setStoreId() : static
- setStoreToBaseRate() : static
- setStoreToQuoteRate() : static
- setSubtotal() : static
- setSubtotalWithDiscount() : static
- setTaxesForItems() : static
- setTotalsCollectedFlag() : static
- setTriggerRecollect() : static
- setUpdatedAt() : static
- setVirtualItemsQty() : static
- setWebsite() : static
- setXForwardedFor() : static
- toArray() : array<string|int, mixed>
- Public wrapper for __toArray
- toJson() : string
- Public wrapper for __toJson
- toString() : string
- Public wrapper for __toString
- toXml() : string
- Public wrapper for __toXml
- unsetData() : $this
- Unset data from the object.
- unsetOldData() : $this
- Unset old fields data from the object.
- updateItem() : Mage_Sales_Model_Quote_Item
- Updates quote item with new configuration
- validateMinimumAmount() : bool
- __toJson() : string
- Convert object attributes to JSON
- __toXml() : string
- Convert object attributes to XML
- _addCatalogProduct() : Mage_Sales_Model_Quote_Item
- Adding catalog product object data to quote
- _addFullNames() : mixed
- _afterDelete() : $this
- Processing object after delete data
- _afterDeleteCommit() : $this
- Processing manipulation after main transaction commit
- _afterLoad() : $this
- Trigger collect totals after loading, if required
- _afterSave() : $this
- Save related items
- _beforeDelete() : $this
- Delete custom option files before deleting quote
- _beforeLoad() : $this
- Processing object before load data
- _beforeSave() : $this
- Processing object before save data
- _camelize() : string
- _clearData() : $this
- Clearing object's data
- _clearErrorInfo() : $this
- Clears list of errors, associated with this quote.
- _clearReferences() : $this
- Clearing cyclic references
- _construct() : void
- Init resource model
- _getAddressByType() : Mage_Sales_Model_Quote_Address
- Retrieve quote address by type
- _getData() : mixed
- Get value from _data array without parse key
- _getEventData() : array<string|int, mixed>
- Get array of objects transferred to default events processing
- _hasModelChanged() : bool
- Check whether model has changed data.
- _init() : mixed
- Standard model initialization
- _initOldFieldsMap() : DataObject
- Init mapping array of short fields to its full names
- _prepareArray() : array<string|int, mixed>
- Set required array elements
- _prepareSyncFieldsMap() : $this
- Called after old fields are inited. Forms synchronization map to sync old fields and new fields between each other.
- _protectFromNonAdmin() : mixed
- Safeguard func that will check, if we are in admin area
- _setHasError() : $this
- Sets flag, whether this quote has some error associated with it.
- _setResourceModel() : mixed
- Set resource names
- _underscore() : string
- Converts field names for setters and getters
- _validateCouponCode() : $this
Properties
$_addresses
Quote addresses collection
protected
Mage_Sales_Model_Resource_Order_Address_Collection|null
$_addresses
= \null
$_cacheTag
Model cache tag for clear cache in after save and after delete
protected
string|bool|array<string|int, mixed>
$_cacheTag
= 'quote'
When you use true - all cache will be clean
Attributes
- #[Override]
$_customer
Quote customer model object
protected
Mage_Customer_Model_Customer|null
$_customer
$_data
Object attributes
protected
array<string|int, mixed>|null
$_data
= []
$_dataSaveAllowed
Flag which can stop data saving after before save Can be used for next sequence: we check data in _beforeSave, if data are not valid - we can set this flag to false value and save process will be stopped
protected
bool
$_dataSaveAllowed
= \true
$_dirty
protected
array<string|int, mixed>
$_dirty
$_errorInfoGroups
Different groups of error infos
protected
array<string|int, mixed>
$_errorInfoGroups
= []
$_eventObject
Parameter name in event
protected
string
$_eventObject
= 'quote'
In observe method you can use $observer->getEvent()->getObject() in this case
Attributes
- #[Override]
$_eventPrefix
Prefix of model events names
protected
string
$_eventPrefix
= 'sales_quote'
Attributes
- #[Override]
$_hasDataChanges
Data changes flag (true after setData|unsetData call)
protected
bool
$_hasDataChanges
= false
$_idFieldName
Name of object id field
protected
string
$_idFieldName
= null
$_isDeleted
Object delete flag
protected
bool
$_isDeleted
= false
$_isObjectNew
Flag which allow detect object state: is it new object (without id) or existing one (with id)
protected
bool|null
$_isObjectNew
= \null
$_items
Quote items collection
protected
Mage_Sales_Model_Resource_Quote_Item_Collection|null
$_items
= \null
$_oldFieldsMap
Map short fields names to its full names
protected
array<string|int, mixed>
$_oldFieldsMap
= []
$_origData
Original data that was loaded
protected
array<string|int, mixed>|null
$_origData
$_payments
Quote payments
protected
Mage_Sales_Model_Resource_Quote_Payment_Collection|null
$_payments
= \null
$_preventSaving
Whether quote should not be saved
protected
bool
$_preventSaving
= \false
$_resource
Resource model instance
protected
Mage_Core_Model_Resource_Db_Abstract
$_resource
$_resourceCollectionName
Name of the resource collection model
protected
string
$_resourceCollectionName
$_resourceName
Name of the resource model
protected
string
$_resourceName
$_syncFieldsMap
Map of fields to sync to other fields upon changing their data
protected
mixed
$_syncFieldsMap
= []
$_underscoreCache
Setter/Getter underscore transformation cache
protected
static array<string|int, mixed>
$_underscoreCache
= []
Methods
__call()
Set/Get attribute wrapper
public
__call(string $method, array<string|int, mixed> $args) : mixed
Parameters
- $method : string
- $args : array<string|int, mixed>
__construct()
Constructor
public
__construct() : mixed
By default, is looking for first argument as array and assigns it as object attributes This behaviour may change in child classes
__get()
Attribute getter (deprecated)
public
__get(string $var) : mixed
Parameters
- $var : string
__set()
Attribute setter (deprecated)
public
__set(string $var, mixed $value) : mixed
Parameters
- $var : string
- $value : mixed
__toArray()
Convert object attributes to array
public
__toArray([array<string|int, mixed> $arrAttributes = [] ]) : array<string|int, mixed>
Parameters
- $arrAttributes : array<string|int, mixed> = []
-
array of required attributes
Return values
array<string|int, mixed>_getResource()
Get resource instance
public
_getResource() : Mage_Sales_Model_Resource_Quote
Return values
Mage_Sales_Model_Resource_QuoteaddAddress()
public
addAddress(Mage_Sales_Model_Quote_Address $address) : $this
Parameters
- $address : Mage_Sales_Model_Quote_Address
Tags
Return values
$thisaddData()
Add data to the object.
public
addData(array<string|int, mixed> $arr) : $this
Retains previous data in the object.
Parameters
- $arr : array<string|int, mixed>
Return values
$thisaddErrorInfo()
Adds error information to the quote.
public
addErrorInfo([string $type = 'error' ][, string|null $origin = null ][, int|null $code = null ][, string|null $message = null ][, DataObject|null $additionalData = null ]) : $this
Automatically sets error flag.
Parameters
- $type : string = 'error'
-
An internal error type ('error', 'qty', etc.), passed then to adding messages routine
- $origin : string|null = null
-
Usually a name of module, that embeds error
- $code : int|null = null
-
Error code, unique for origin, that sets it
- $message : string|null = null
-
Error message
- $additionalData : DataObject|null = null
-
Any additional data, that caller would like to store
Return values
$thisaddItem()
Adding new item to quote
public
addItem(Mage_Sales_Model_Quote_Item $item) : $this
Parameters
- $item : Mage_Sales_Model_Quote_Item
Return values
$thisaddMessage()
public
addMessage(string $message[, string $index = 'error' ]) : $this
Parameters
- $message : string
- $index : string = 'error'
Return values
$thisaddPayment()
public
addPayment(Mage_Sales_Model_Quote_Payment $payment) : $this
Parameters
- $payment : Mage_Sales_Model_Quote_Payment
Tags
Return values
$thisaddProduct()
Add product to quote
public
addProduct(Mage_Catalog_Model_Product $product[, null|float|DataObject $request = null ]) : Mage_Sales_Model_Quote_Item|string
return error message if product type instance can't prepare product
Parameters
- $product : Mage_Catalog_Model_Product
- $request : null|float|DataObject = null
Return values
Mage_Sales_Model_Quote_Item|stringaddProductAdvanced()
Advanced func to add product to quote - processing mode can be specified there.
public
addProductAdvanced(Mage_Catalog_Model_Product $product[, null|float|DataObject $request = null ][, null|string $processMode = null ]) : Mage_Sales_Model_Quote_Item|string
Returns error message if product type instance can't prepare product.
Parameters
- $product : Mage_Catalog_Model_Product
- $request : null|float|DataObject = null
- $processMode : null|string = null
Return values
Mage_Sales_Model_Quote_Item|stringaddShippingAddress()
public
addShippingAddress(Mage_Sales_Model_Quote_Address $address) : $this
Parameters
- $address : Mage_Sales_Model_Quote_Address
Return values
$thisafterCommitCallback()
Callback function which called after transaction commit in resource model
public
afterCommitCallback() : $this
Return values
$thisafterLoad()
Object after load processing. Implemented as public interface for supporting objects after load in collections
public
afterLoad() : $this
Return values
$thisassignCustomer()
Assign customer model object data to quote
public
assignCustomer(Mage_Customer_Model_Customer $customer) : $this
Parameters
- $customer : Mage_Customer_Model_Customer
Return values
$thisassignCustomerWithAddressChange()
Assign customer model to quote with billing and shipping address change
public
assignCustomerWithAddressChange(Mage_Customer_Model_Customer $customer[, Mage_Sales_Model_Quote_Address|null $billingAddress = null ][, Mage_Sales_Model_Quote_Address|null $shippingAddress = null ]) : $this
Parameters
- $customer : Mage_Customer_Model_Customer
- $billingAddress : Mage_Sales_Model_Quote_Address|null = null
- $shippingAddress : Mage_Sales_Model_Quote_Address|null = null
Tags
Return values
$thiscleanModelCache()
Remove model object related cache
public
cleanModelCache() : $this
Return values
$thisclearInstance()
Clearing object for correct deleting by garbage collector
public
final clearInstance() : $this
Return values
$thiscollectTotals()
Collect totals
public
collectTotals() : $this
Return values
$thisdataHasChangedFor()
Compare object data with original data
public
dataHasChangedFor(string $field) : bool
Parameters
- $field : string
Return values
booldebug()
Present object data as string in debug mode
public
debug([mixed $data = null ][, array<string|int, mixed> &$objects = [] ]) : string|array<string|int, mixed>
Parameters
- $data : mixed = null
- $objects : array<string|int, mixed> = []
Return values
string|array<string|int, mixed>delete()
Delete object from database
public
delete() : $this
Tags
Return values
$thisdeleteItem()
Delete quote item. If it does not have identifier then it will be only removed from collection
public
deleteItem(Mage_Sales_Model_Quote_Item $item) : $this
Parameters
- $item : Mage_Sales_Model_Quote_Item
Return values
$thisflagDirty()
public
flagDirty(string $field[, bool $flag = true ]) : $this
Parameters
- $field : string
- $flag : bool = true
Return values
$thisgetAddressByCustomerAddressId()
public
getAddressByCustomerAddressId(int $addressId) : Mage_Sales_Model_Quote_Address|false
Parameters
- $addressId : int
Return values
Mage_Sales_Model_Quote_Address|falsegetAddressById()
public
getAddressById(int $addressId) : Mage_Sales_Model_Quote_Address|false
Parameters
- $addressId : int
Return values
Mage_Sales_Model_Quote_Address|falsegetAddressesCollection()
Retrieve quote address collection
public
getAddressesCollection() : Mage_Sales_Model_Resource_Order_Address_Collection
Return values
Mage_Sales_Model_Resource_Order_Address_CollectiongetAllAddresses()
public
getAllAddresses() : array<string|int, Mage_Sales_Model_Quote_Address>
Return values
array<string|int, Mage_Sales_Model_Quote_Address>getAllItems()
Retrieve quote items array
public
getAllItems() : array<string|int, Mage_Sales_Model_Quote_Item>
Return values
array<string|int, Mage_Sales_Model_Quote_Item>getAllShippingAddresses()
public
getAllShippingAddresses() : array<string|int, Mage_Sales_Model_Quote_Address>
Return values
array<string|int, Mage_Sales_Model_Quote_Address>getAllVisibleItems()
Get array of all items what can be display directly
public
getAllVisibleItems() : array<string|int, Mage_Sales_Model_Quote_Item>
Return values
array<string|int, Mage_Sales_Model_Quote_Item>getAppliedRuleIds()
public
getAppliedRuleIds() : string|null
Return values
string|nullgetBaseCurrencyCode()
public
getBaseCurrencyCode() : string|null
Return values
string|nullgetBaseGrandTotal()
public
getBaseGrandTotal() : float|null
Return values
float|nullgetBaseSubtotal()
public
getBaseSubtotal() : float|null
Return values
float|nullgetBaseSubtotalWithDiscount()
public
getBaseSubtotalWithDiscount() : float|null
Return values
float|nullgetBaseToGlobalRate()
public
getBaseToGlobalRate() : float|null
Return values
float|nullgetBaseToQuoteRate()
public
getBaseToQuoteRate() : float|null
Return values
float|nullgetBillingAddress()
Retrieve quote billing address
public
getBillingAddress() : Mage_Sales_Model_Quote_Address
Attributes
- #[Override]
Return values
Mage_Sales_Model_Quote_AddressgetCacheIdTags()
Get cache tags associated with object id
public
getCacheIdTags() : array<string|int, mixed>|false
Return values
array<string|int, mixed>|falsegetCacheTags()
Get list of cache tags applied to model object.
public
getCacheTags() : array<string|int, mixed>|false
Return false if cache tags are not supported by model
Return values
array<string|int, mixed>|falsegetCanApplyMsrp()
public
getCanApplyMsrp() : bool|null
Return values
bool|nullgetChangedFlag()
public
getChangedFlag() : bool|null
Return values
bool|nullgetCheckoutMethod()
Return quote checkout method code
public
getCheckoutMethod([bool $originalMethod = false ]) : string
Parameters
- $originalMethod : bool = false
-
if true return defined method from beginning
Return values
stringgetCollection()
public
getCollection() : Mage_Core_Model_Resource_Db_Collection_Abstract|false
Tags
Return values
Mage_Core_Model_Resource_Db_Collection_Abstract|falsegetConvertedAt()
public
getConvertedAt() : string|null
Return values
string|nullgetCouponCode()
public
getCouponCode() : string
Return values
stringgetCreatedAt()
public
getCreatedAt() : string|null
Return values
string|nullgetCustomer()
Retrieve customer model object
public
getCustomer() : Mage_Customer_Model_Customer
Return values
Mage_Customer_Model_CustomergetCustomerDob()
public
getCustomerDob() : string|null
Return values
string|nullgetCustomerEmail()
public
getCustomerEmail() : string|null
Return values
string|nullgetCustomerFirstname()
public
getCustomerFirstname() : string|null
Return values
string|nullgetCustomerGender()
public
getCustomerGender() : int|null
Return values
int|nullgetCustomerGroupId()
public
getCustomerGroupId() : int
Return values
intgetCustomerId()
public
getCustomerId() : int|null
Return values
int|nullgetCustomerIsGuest()
public
getCustomerIsGuest() : bool|null
Return values
bool|nullgetCustomerIsNew()
public
getCustomerIsNew() : bool|null
Return values
bool|nullgetCustomerLastname()
public
getCustomerLastname() : string|null
Return values
string|nullgetCustomerMiddlename()
public
getCustomerMiddlename() : string|null
Return values
string|nullgetCustomerNote()
public
getCustomerNote() : string|null
Return values
string|nullgetCustomerNoteNotify()
public
getCustomerNoteNotify() : bool|null
Return values
bool|nullgetCustomerPrefix()
public
getCustomerPrefix() : string|null
Return values
string|nullgetCustomerSuffix()
public
getCustomerSuffix() : string|null
Return values
string|nullgetCustomerTaxClassId()
public
getCustomerTaxClassId() : mixed
getCustomerTaxvat()
public
getCustomerTaxvat() : string|null
Return values
string|nullgetData()
Object data getter
public
getData([string $key = '' ][, string|int $index = null ]) : mixed
If $key is not defined will return all the data as an array. Otherwise, it will return value of the element specified by $key. It is possible to use keys like a/b/c for access nested array data
If $index is specified it will assume that attribute data is an array and retrieve corresponding member. If data is the string - it will be explode by new line character and converted to array.
Parameters
- $key : string = ''
- $index : string|int = null
getDataByKey()
Get object data by particular key
public
getDataByKey(string $key) : mixed
Parameters
- $key : string
getDataByPath()
Get object data by path
public
getDataByPath(string $path) : mixed
Method consider the path as chain of keys: a/b/c => ['a']['b']['c']
Parameters
- $path : string
getDataSetDefault()
Fast get data or set default if value is not available
public
getDataSetDefault(string $key, mixed $default) : mixed
Parameters
- $key : string
- $default : mixed
getDataUsingMethod()
Get object data by key with calling getter method
public
getDataUsingMethod(string $key[, mixed $args = null ]) : mixed
Parameters
- $key : string
- $args : mixed = null
getEntityId()
public
getEntityId() : int
Return values
intgetErrors()
Retrieve current quote errors
public
getErrors() : array<string|int, mixed>
Return values
array<string|int, mixed>getExtShippingInfo()
public
getExtShippingInfo() : string|null
Return values
string|nullgetForcedCurrency()
public
getForcedCurrency() : Mage_Directory_Model_Currency|null
Return values
Mage_Directory_Model_Currency|nullgetGiftMessageId()
public
getGiftMessageId() : int|null
Return values
int|nullgetGlobalCurrencyCode()
public
getGlobalCurrencyCode() : string|null
Return values
string|nullgetGrandTotal()
public
getGrandTotal() : float|null
Return values
float|nullgetHasError()
public
getHasError() : bool|null
Return values
bool|nullgetId()
Retrieve model object identifier
public
getId() : int|string|null
Attributes
- #[Override]
Return values
int|string|nullgetIdFieldName()
Retrieve identifier field name for model
public
getIdFieldName() : string
Attributes
- #[Override]
Return values
stringgetIgnoreOldQty()
public
getIgnoreOldQty() : bool|null
Return values
bool|nullgetInventoryProcessed()
public
getInventoryProcessed() : bool|null
Return values
bool|nullgetIsActive()
public
getIsActive() : bool|null
Return values
bool|nullgetIsChanged()
public
getIsChanged() : bool|null
Return values
bool|nullgetIsCheckoutCart()
public
getIsCheckoutCart() : bool|null
Return values
bool|nullgetIsMultiPayment()
public
getIsMultiPayment() : bool|null
Return values
bool|nullgetIsSuperMode()
public
getIsSuperMode() : bool|null
Return values
bool|nullgetIsVirtual()
Check quote for virtual product only
public
getIsVirtual() : bool
Return values
boolgetItemById()
Retrieve item model object by item identifier
public
getItemById(int $itemId) : Mage_Sales_Model_Quote_Item
Parameters
- $itemId : int
Return values
Mage_Sales_Model_Quote_ItemgetItemByProduct()
Retrieve quote item by product id
public
getItemByProduct(Mage_Catalog_Model_Product $product) : Mage_Sales_Model_Quote_Item|false
Parameters
- $product : Mage_Catalog_Model_Product
Return values
Mage_Sales_Model_Quote_Item|falsegetItemsCollection()
Retrieve quote items collection
public
getItemsCollection([bool $useCache = true ]) : Mage_Sales_Model_Resource_Quote_Item_Collection
Parameters
- $useCache : bool = true
Return values
Mage_Sales_Model_Resource_Quote_Item_CollectiongetItemsCount()
public
getItemsCount() : int|null
Return values
int|nullgetItemsQty()
public
getItemsQty() : float|null
Return values
float|nullgetItemsSummaryQty()
public
getItemsSummaryQty() : float|int|mixed
Return values
float|int|mixedgetItemVirtualQty()
public
getItemVirtualQty() : int|mixed
Return values
int|mixedgetMessages()
Retrieve current quote messages
public
getMessages() : array<string|int, Mage_Core_Model_Message_Abstract>
Return values
array<string|int, Mage_Core_Model_Message_Abstract>getMethod()
public
getMethod() : string|null
Return values
string|nullgetOrigData()
Get object loaded data (original data)
public
getOrigData([string $key = null ]) : mixed
Parameters
- $key : string = null
getOrigOrderId()
public
getOrigOrderId() : int|null
Return values
int|nullgetPasswordHash()
public
getPasswordHash() : string|null
Return values
string|nullgetPayment()
public
getPayment() : Mage_Sales_Model_Quote_Payment
Return values
Mage_Sales_Model_Quote_PaymentgetPaymentById()
public
getPaymentById(int $paymentId) : false|Mage_Sales_Model_Quote_Payment
Parameters
- $paymentId : int
Return values
false|Mage_Sales_Model_Quote_PaymentgetPaymentsCollection()
public
getPaymentsCollection() : Mage_Sales_Model_Resource_Quote_Payment_Collection
Return values
Mage_Sales_Model_Resource_Quote_Payment_CollectiongetQuoteCurrencyCode()
public
getQuoteCurrencyCode() : string|null
Return values
string|nullgetRemoteIp()
public
getRemoteIp() : string|null
Return values
string|nullgetReservedOrderId()
public
getReservedOrderId() : string|null
Return values
string|nullgetResource()
Retrieve model resource
public
getResource() : Mage_Sales_Model_Resource_Quote
Return values
Mage_Sales_Model_Resource_QuotegetResourceCollection()
Get collection instance
public
getResourceCollection() : Mage_Core_Model_Resource_Db_Collection_Abstract
Tags
Return values
Mage_Core_Model_Resource_Db_Collection_AbstractgetResourceName()
Retrieve model resource name
public
getResourceName() : string
Return values
stringgetSharedStoreIds()
Get all available store ids for quote
public
getSharedStoreIds() : array<string|int, mixed>
Return values
array<string|int, mixed>getShippingAddress()
Retrieve quote shipping address
public
getShippingAddress() : Mage_Sales_Model_Quote_Address
Attributes
- #[Override]
Return values
Mage_Sales_Model_Quote_AddressgetShippingAddressByCustomerAddressId()
public
getShippingAddressByCustomerAddressId(int $addressId) : Mage_Sales_Model_Quote_Address|false
Parameters
- $addressId : int
Return values
Mage_Sales_Model_Quote_Address|falsegetStore()
Get quote store model object
public
getStore() : Mage_Core_Model_Store
Return values
Mage_Core_Model_StoregetStoreCurrencyCode()
public
getStoreCurrencyCode() : string|null
Return values
string|nullgetStoreId()
Get quote store identifier
public
getStoreId() : int
Return values
intgetStoreToBaseRate()
public
getStoreToBaseRate() : float|null
Return values
float|nullgetStoreToQuoteRate()
public
getStoreToQuoteRate() : float|null
Return values
float|nullgetSubtotal()
public
getSubtotal() : float|null
Return values
float|nullgetSubtotalWithDiscount()
public
getSubtotalWithDiscount() : float|null
Return values
float|nullgetTaxesForItems()
public
getTaxesForItems() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullgetTotals()
Get all quote totals (sorted by priority) Method process quote states isVirtual
public
getTotals() : array<string|int, mixed>
Return values
array<string|int, mixed>getTotalsCollectedFlag()
public
getTotalsCollectedFlag() : bool|null
Return values
bool|nullgetTriggerRecollect()
public
getTriggerRecollect() : bool|null
Return values
bool|nullgetUpdatedAt()
public
getUpdatedAt() : string|null
Return values
string|nullgetVirtualItemsQty()
public
getVirtualItemsQty() : float|null
Return values
float|nullgetWebsite()
public
getWebsite() : Mage_Core_Model_Website|null
Return values
Mage_Core_Model_Website|nullhasCanApplyMsrp()
public
hasCanApplyMsrp() : bool
Return values
boolhasChangedFlag()
public
hasChangedFlag() : bool
Return values
boolhasData()
If $key is empty, checks whether there's any data in the object Otherwise checks if the specified attribute is set.
public
hasData([string $key = '' ]) : bool
Parameters
- $key : string = ''
Return values
boolhasDataChanges()
Get data change status
public
hasDataChanges() : bool
Return values
boolhasErrors()
public
hasErrors() : bool
Return values
boolhasForcedCurrency()
public
hasForcedCurrency() : bool
Return values
boolhasItems()
Checking items availability
public
hasItems() : bool
Return values
boolhasItemsCollection()
public
hasItemsCollection() : bool
Return values
boolhasItemsWithDecimalQty()
Checking availability of items with decimal qty
public
hasItemsWithDecimalQty() : bool
Return values
boolhasNominalItems()
Getter whether quote has nominal items Can bypass treating virtual items as nominal
public
hasNominalItems([bool $countVirtual = true ]) : bool
Parameters
- $countVirtual : bool = true
Return values
boolhasProductId()
Checking product exist in Quote
public
hasProductId(int $productId) : bool
Parameters
- $productId : int
Return values
boolhasRecurringItems()
Whether there are recurring items
public
hasRecurringItems() : bool
Return values
boolhasStoreId()
public
hasStoreId() : bool
Return values
boolhasVirtualItems()
Has a virtual products on quote
public
hasVirtualItems() : bool
Return values
boolisAllowedGuestCheckout()
Check is allow Guest Checkout
public
isAllowedGuestCheckout() : bool
Return values
boolisDeleted()
Set _isDeleted flag value (if $isDeleted param is defined) and return current flag value
public
isDeleted([bool $isDeleted = null ]) : bool
Parameters
- $isDeleted : bool = null
Return values
boolisDirty()
public
isDirty([string $field = null ]) : bool
Parameters
- $field : string = null
Return values
boolisEmpty()
checks whether the object is empty
public
isEmpty() : bool
Return values
boolisModuleEnabled()
public
isModuleEnabled(string $moduleName[, string $helperAlias = 'core' ]) : bool
Parameters
- $moduleName : string
- $helperAlias : string = 'core'
Return values
boolisNominal()
Whether quote has nominal items only
public
isNominal() : bool
Return values
boolisObjectNew()
Check object state (true - if it is object without id on object just created) This method can help detect if object just created in _afterSave method problem is what in after save object has id and we can't detect what object was created in this transaction
public
isObjectNew([bool $flag = null ]) : bool
Parameters
- $flag : bool = null
Return values
boolisVirtual()
Check quote for virtual product only
public
isVirtual() : bool
Return values
booljsonSerialize()
Implementation of JsonSerializable::jsonSerialize()
public
jsonSerialize() : array<string|int, mixed>
Prepares the object data for JSON serialization. Returns all object data as an array, with special handling for nested DataObject instances:
- If a nested DataObject has a custom jsonSerialize() implementation, it's preserved as-is
- If a nested DataObject has a custom toJson() method, it's converted to JSON string
- If a nested DataObject uses only the base implementations, it's excluded from output
This prevents infinite recursion and circular references when serializing object hierarchies.
Attributes
- #[Override]
Return values
array<string|int, mixed>load()
Load object data
public
load(string|null|int $id[, string|null $field = null ]) : $this
Parameters
- $id : string|null|int
- $field : string|null = null
Return values
$thisloadActive()
Loading only active quote
public
loadActive(int $quoteId) : $this
Parameters
- $quoteId : int
Return values
$thisloadByCustomer()
Loading quote data by customer
public
loadByCustomer(int|Mage_Customer_Model_Customer $customer) : $this
Parameters
- $customer : int|Mage_Customer_Model_Customer
Return values
$thisloadByIdWithoutStore()
Loading quote by identifier
public
loadByIdWithoutStore(int $quoteId) : $this
Parameters
- $quoteId : int
Return values
$thismerge()
Merge quotes
public
merge(Mage_Sales_Model_Quote $quote) : $this
Parameters
- $quote : Mage_Sales_Model_Quote
Return values
$thisoffsetExists()
Implementation of ArrayAccess::offsetExists()
public
offsetExists(string $offset) : bool
Parameters
- $offset : string
Tags
Attributes
- #[Override]
Return values
booloffsetGet()
Implementation of ArrayAccess::offsetGet()
public
offsetGet(string $offset) : mixed
Parameters
- $offset : string
Tags
Attributes
- #[Override]
- #[ReturnTypeWillChange]
offsetSet()
Implementation of ArrayAccess::offsetSet()
public
offsetSet(string $offset, mixed $value) : void
Parameters
- $offset : string
- $value : mixed
Tags
Attributes
- #[Override]
offsetUnset()
Implementation of ArrayAccess::offsetUnset()
public
offsetUnset(string $offset) : void
Parameters
- $offset : string
Tags
Attributes
- #[Override]
prepareRecurringPaymentProfiles()
Create recurring payment profiles basing on the current items
public
prepareRecurringPaymentProfiles() : array<string|int, Mage_Payment_Model_Recurring_Profile>
Return values
array<string|int, Mage_Payment_Model_Recurring_Profile>preventSaving()
Prevent quote from saving
public
preventSaving() : $this
Return values
$thisrefreshCurrencyStamp()
Restate which currency this quote's amounts are in, from the store as it is right now. Shared with placement, which needs these fields refreshed without saving, so the two can never drift apart.
public
refreshCurrencyStamp() : static
global - currency which is set for default in backend base - currency which is set for current website. all attributes that have 'base_' prefix saved in this currency store - all the time it was currency of website and all attributes with 'base_' were saved in this currency. From now on it is deprecated and will be duplication of base currency code. quote/order - currency which was selected by customer or configured by admin for current store. currency in which customer sees price thought all checkout.
Rates: store_to_base & store_to_quote/store_to_order - are deprecated base_to_global & base_to_quote/base_to_order - must be used instead
Return values
staticremoveAddress()
public
removeAddress(int $addressId) : $this
Parameters
- $addressId : int
Return values
$thisremoveAllAddresses()
Leave no more than one billing and one shipping address, fill them with default data
public
removeAllAddresses() : $this
Return values
$thisremoveAllItems()
Mark all quote items as deleted (empty quote)
public
removeAllItems() : $this
Return values
$thisremoveErrorInfosByParams()
Removes error infos, that have parameters equal to passed in $params.
public
removeErrorInfosByParams(string|null $type, array<string|int, mixed> $params) : $this
$params can have the following keys (if not set - then any item is good for this key): 'origin', 'code', 'message'
Parameters
- $type : string|null
-
An internal error type ('error', 'qty', etc.), passed then to adding messages routine
- $params : array<string|int, mixed>
Return values
$thisremoveItem()
Remove quote item by item identifier
public
removeItem(int $itemId) : $this
Parameters
- $itemId : int
Return values
$thisremoveMessageByText()
Removes message by text
public
removeMessageByText(string $type, string $text) : $this
Parameters
- $type : string
- $text : string
Return values
$thisremovePayment()
public
removePayment() : $this
Return values
$thisreserveOrderId()
Generate new increment order id and associate it with current quote
public
reserveOrderId() : $this
Return values
$thissave()
Save quote with prevention checking
public
save() : $this
Attributes
- #[Override]
Return values
$thisserialize()
serialize object attributes
public
serialize([array<string|int, mixed> $attributes = [] ][, string $valueSeparator = '=' ][, string $fieldSeparator = ' ' ][, string $quote = '"' ]) : string
Parameters
- $attributes : array<string|int, mixed> = []
- $valueSeparator : string = '='
- $fieldSeparator : string = ' '
- $quote : string = '"'
Return values
stringsetAppliedRuleIds()
public
setAppliedRuleIds(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetAttribute()
public
setAttribute(Mage_Eav_Model_Entity_Attribute_Abstract $value) : $this
Parameters
Return values
$thissetBaseCurrencyCode()
public
setBaseCurrencyCode(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetBaseGrandTotal()
public
setBaseGrandTotal(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetBaseSubtotal()
public
setBaseSubtotal(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetBaseSubtotalWithDiscount()
public
setBaseSubtotalWithDiscount(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetBaseToGlobalRate()
public
setBaseToGlobalRate(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetBaseToQuoteRate()
public
setBaseToQuoteRate(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetBillingAddress()
public
setBillingAddress(Mage_Sales_Model_Quote_Address $address) : $this
Parameters
- $address : Mage_Sales_Model_Quote_Address
Return values
$thissetCheckoutMethod()
public
setCheckoutMethod(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetConvertedAt()
public
setConvertedAt(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetCouponCode()
public
setCouponCode(string|null $couponCode) : $this
Parameters
- $couponCode : string|null
Return values
$thissetCreatedAt()
public
setCreatedAt(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetCustomer()
Define customer object
public
setCustomer(Mage_Customer_Model_Customer $customer) : $this
Parameters
- $customer : Mage_Customer_Model_Customer
Return values
$thissetCustomerDob()
public
setCustomerDob(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetCustomerEmail()
public
setCustomerEmail(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetCustomerFirstname()
public
setCustomerFirstname(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetCustomerGender()
public
setCustomerGender(int|null $value) : static
Parameters
- $value : int|null
Return values
staticsetCustomerGroupId()
public
setCustomerGroupId(int|null $value) : static
Parameters
- $value : int|null
Return values
staticsetCustomerId()
public
setCustomerId(int|null $value) : static
Parameters
- $value : int|null
Return values
staticsetCustomerIsGuest()
public
setCustomerIsGuest([bool|null $value = true ]) : static
Parameters
- $value : bool|null = true
Return values
staticsetCustomerIsNew()
public
setCustomerIsNew([bool|null $value = true ]) : static
Parameters
- $value : bool|null = true
Return values
staticsetCustomerLastname()
public
setCustomerLastname(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetCustomerMiddlename()
public
setCustomerMiddlename(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetCustomerNote()
public
setCustomerNote(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetCustomerNoteNotify()
public
setCustomerNoteNotify([bool|null $value = true ]) : static
Parameters
- $value : bool|null = true
Return values
staticsetCustomerPrefix()
public
setCustomerPrefix(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetCustomerSuffix()
public
setCustomerSuffix(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetCustomerTaxClassId()
public
setCustomerTaxClassId(int|null $value) : static
Parameters
- $value : int|null
Return values
staticsetCustomerTaxvat()
public
setCustomerTaxvat(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetData()
Overwrite data in the object.
public
setData(string|array<string|int, mixed> $key[, mixed $value = null ]) : $this
$key can be string or array. If $key is string, the attribute value will be overwritten by $value
If $key is an array, it will overwrite all the data in the object.
Parameters
- $key : string|array<string|int, mixed>
- $value : mixed = null
Return values
$thissetDataChanges()
Clears data changes status
public
setDataChanges(bool $value) : $this
Parameters
- $value : bool
Return values
$thissetDataUsingMethod()
Set object data with calling setter method
public
setDataUsingMethod(string $key[, mixed $args = [] ]) : $this
Parameters
- $key : string
- $args : mixed = []
Return values
$thissetExtShippingInfo()
public
setExtShippingInfo(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetForcedCurrency()
Price this quote in a currency other than the store's, refusing one with no rate from base.
public
setForcedCurrency(Mage_Directory_Model_Currency $currency) : static
Parameters
- $currency : Mage_Directory_Model_Currency
Tags
Return values
staticsetGiftMessage()
public
setGiftMessage(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetGiftMessageId()
public
setGiftMessageId(int|null $value) : static
Parameters
- $value : int|null
Return values
staticsetGlobalCurrencyCode()
public
setGlobalCurrencyCode(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetGrandTotal()
public
setGrandTotal(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetHasError()
Sets flag, whether this quote has some error associated with it.
public
setHasError(bool $flag) : $this
When TRUE - also adds 'unknown' error information to list of quote errors. When FALSE - clears whole list of quote errors. It's recommended to use addErrorInfo() instead - to be able to remove error statuses later.
Parameters
- $flag : bool
Tags
Return values
$thissetId()
Declare model object identifier value
public
setId(mixed $id) : $this
Parameters
- $id : mixed
Attributes
- #[Override]
Return values
$thissetIdFieldName()
set name of object id field
public
setIdFieldName(string $name) : $this
Parameters
- $name : string
Return values
$thissetIgnoreOldQty()
public
setIgnoreOldQty([bool|null $value = true ]) : static
Parameters
- $value : bool|null = true
Return values
staticsetInventoryProcessed()
public
setInventoryProcessed([bool|null $value = true ]) : static
Parameters
- $value : bool|null = true
Return values
staticsetIsActive()
public
setIsActive([bool|null $value = true ]) : static
Parameters
- $value : bool|null = true
Return values
staticsetIsChanged()
public
setIsChanged([bool|null $value = true ]) : static
Parameters
- $value : bool|null = true
Return values
staticsetIsCheckoutCart()
public
setIsCheckoutCart([bool|null $value = true ]) : static
Parameters
- $value : bool|null = true
Return values
staticsetIsSuperMode()
public
setIsSuperMode([bool|null $value = true ]) : static
Parameters
- $value : bool|null = true
Return values
staticsetIsVirtual()
public
setIsVirtual([bool|null $value = true ]) : static
Parameters
- $value : bool|null = true
Return values
staticsetItemsCount()
public
setItemsCount(int|null $value) : static
Parameters
- $value : int|null
Return values
staticsetItemsQty()
public
setItemsQty(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetOrderId()
public
setOrderId(int|null $value) : static
Parameters
- $value : int|null
Return values
staticsetOrigData()
Initialize object original data
public
setOrigData([string $key = null ][, mixed $data = null ]) : $this
Parameters
- $key : string = null
- $data : mixed = null
Return values
$thissetOrigOrderId()
public
setOrigOrderId(int|null $value) : static
Parameters
- $value : int|null
Return values
staticsetPasswordHash()
public
setPasswordHash(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetPayment()
public
setPayment(Mage_Sales_Model_Quote_Payment $payment) : Mage_Sales_Model_Quote_Payment
Parameters
- $payment : Mage_Sales_Model_Quote_Payment
Return values
Mage_Sales_Model_Quote_PaymentsetQuoteCurrencyCode()
public
setQuoteCurrencyCode(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetRemoteIp()
public
setRemoteIp(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetReservedOrderId()
public
setReservedOrderId(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetSharedStoreIds()
public
setSharedStoreIds(array<string|int, mixed>|null $value) : static
Parameters
- $value : array<string|int, mixed>|null
Return values
staticsetShippingAddress()
public
setShippingAddress(Mage_Sales_Model_Quote_Address $address) : $this
Parameters
- $address : Mage_Sales_Model_Quote_Address
Return values
$thissetStore()
Declare quote store model
public
setStore(Mage_Core_Model_Store $store) : $this
Parameters
- $store : Mage_Core_Model_Store
Return values
$thissetStoreCurrencyCode()
public
setStoreCurrencyCode(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetStoreId()
public
setStoreId(int|null $value) : static
Parameters
- $value : int|null
Return values
staticsetStoreToBaseRate()
public
setStoreToBaseRate(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetStoreToQuoteRate()
public
setStoreToQuoteRate(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetSubtotal()
public
setSubtotal(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetSubtotalWithDiscount()
public
setSubtotalWithDiscount(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetTaxesForItems()
public
setTaxesForItems(array<string|int, mixed>|null $value) : static
Parameters
- $value : array<string|int, mixed>|null
Return values
staticsetTotalsCollectedFlag()
public
setTotalsCollectedFlag([bool|null $value = true ]) : static
Parameters
- $value : bool|null = true
Return values
staticsetTriggerRecollect()
public
setTriggerRecollect([bool|null $value = true ]) : static
Parameters
- $value : bool|null = true
Return values
staticsetUpdatedAt()
public
setUpdatedAt(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetVirtualItemsQty()
public
setVirtualItemsQty(float|null $value) : static
Parameters
- $value : float|null
Return values
staticsetWebsite()
public
setWebsite(Mage_Core_Model_Website|null $value) : static
Parameters
- $value : Mage_Core_Model_Website|null
Return values
staticsetXForwardedFor()
public
setXForwardedFor(string|null $value) : static
Parameters
- $value : string|null
Return values
statictoArray()
Public wrapper for __toArray
public
toArray([array<string|int, mixed> $arrAttributes = [] ]) : array<string|int, mixed>
Parameters
- $arrAttributes : array<string|int, mixed> = []
Return values
array<string|int, mixed>toJson()
Public wrapper for __toJson
public
toJson([array<string|int, mixed> $arrAttributes = [] ]) : string
Parameters
- $arrAttributes : array<string|int, mixed> = []
Return values
stringtoString()
Public wrapper for __toString
public
toString([string $format = '' ]) : string
Will use $format as an template and substitute {{key}} for attributes
Parameters
- $format : string = ''
Return values
stringtoXml()
Public wrapper for __toXml
public
toXml([array<string|int, mixed> $arrAttributes = [] ][, string $rootName = 'item' ][, bool $addOpenTag = false ][, bool $addCdata = true ]) : string
Parameters
- $arrAttributes : array<string|int, mixed> = []
- $rootName : string = 'item'
- $addOpenTag : bool = false
- $addCdata : bool = true
Return values
stringunsetData()
Unset data from the object.
public
unsetData([string $key = null ]) : $this
$key can be a string only. Array will be ignored.
Parameters
- $key : string = null
Return values
$thisunsetOldData()
Unset old fields data from the object.
public
unsetOldData([string $key = null ]) : $this
$key can be a string only. Array will be ignored.
Parameters
- $key : string = null
Return values
$thisupdateItem()
Updates quote item with new configuration
public
updateItem(int $itemId, DataObject $buyRequest[, null|array<string|int, mixed>|DataObject $params = null ]) : Mage_Sales_Model_Quote_Item
$params sets how current item configuration must be taken into account and additional options. It's passed to Mage_Catalog_Helper_Product->addParamsToBuyRequest() to compose resulting buyRequest.
Basically it can hold
- 'current_config', \Maho\DataObject or array - current buyRequest that configures product in this item, used to restore currently attached files
- 'files_prefix': string[a-z0-9_] - prefix that was added at frontend to names of file options (file inputs), so they won't intersect with other submitted options
For more options see Mage_Catalog_Helper_Product->addParamsToBuyRequest()
Parameters
- $itemId : int
- $buyRequest : DataObject
- $params : null|array<string|int, mixed>|DataObject = null
Tags
Return values
Mage_Sales_Model_Quote_ItemvalidateMinimumAmount()
public
validateMinimumAmount() : bool
Return values
bool__toJson()
Convert object attributes to JSON
protected
__toJson([array<string|int, mixed> $arrAttributes = [] ]) : string
Parameters
- $arrAttributes : array<string|int, mixed> = []
-
array of required attributes
Return values
string__toXml()
Convert object attributes to XML
protected
__toXml([array<string|int, mixed> $arrAttributes = [] ][, string $rootName = 'item' ][, bool $addOpenTag = false ][, bool $addCdata = true ]) : string
Parameters
- $arrAttributes : array<string|int, mixed> = []
-
array of required attributes
- $rootName : string = 'item'
-
name of the root element
- $addOpenTag : bool = false
- $addCdata : bool = true
Return values
string_addCatalogProduct()
Adding catalog product object data to quote
protected
_addCatalogProduct(Mage_Catalog_Model_Product $product[, int $qty = 1 ]) : Mage_Sales_Model_Quote_Item
Parameters
- $product : Mage_Catalog_Model_Product
- $qty : int = 1
Tags
Return values
Mage_Sales_Model_Quote_Item_addFullNames()
protected
_addFullNames() : mixed
_afterDelete()
Processing object after delete data
protected
_afterDelete() : $this
Return values
$this_afterDeleteCommit()
Processing manipulation after main transaction commit
protected
_afterDeleteCommit() : $this
Return values
$this_afterLoad()
Trigger collect totals after loading, if required
protected
_afterLoad() : $this
Attributes
- #[Override]
Return values
$this_afterSave()
Save related items
protected
_afterSave() : $this
Attributes
- #[Override]
Return values
$this_beforeDelete()
Delete custom option files before deleting quote
protected
_beforeDelete() : $this
Attributes
- #[Override]
Return values
$this_beforeLoad()
Processing object before load data
protected
_beforeLoad(int $id[, string|null $field = null ]) : $this
Parameters
- $id : int
- $field : string|null = null
Return values
$this_beforeSave()
Processing object before save data
protected
_beforeSave() : $this
Tags
Attributes
- #[Override]
Return values
$this_camelize()
protected
_camelize(string $name) : string
Parameters
- $name : string
Return values
string_clearData()
Clearing object's data
protected
_clearData() : $this
Return values
$this_clearErrorInfo()
Clears list of errors, associated with this quote.
protected
_clearErrorInfo() : $this
Also automatically removes error-flag from oneself.
Return values
$this_clearReferences()
Clearing cyclic references
protected
_clearReferences() : $this
Return values
$this_construct()
Init resource model
protected
_construct() : void
Attributes
- #[Override]
_getAddressByType()
Retrieve quote address by type
protected
_getAddressByType(string $type) : Mage_Sales_Model_Quote_Address
Parameters
- $type : string
Return values
Mage_Sales_Model_Quote_Address_getData()
Get value from _data array without parse key
protected
_getData(string $key) : mixed
Parameters
- $key : string
_getEventData()
Get array of objects transferred to default events processing
protected
_getEventData() : array<string|int, mixed>
Return values
array<string|int, mixed>_hasModelChanged()
Check whether model has changed data.
protected
_hasModelChanged() : bool
Can be overloaded in child classes to perform advanced check whether model needs to be saved e.g. using resourceModel->hasDataChanged() or any other technique
Return values
bool_init()
Standard model initialization
protected
_init(string $resourceModel) : mixed
Parameters
- $resourceModel : string
_initOldFieldsMap()
Init mapping array of short fields to its full names
protected
_initOldFieldsMap() : DataObject
Attributes
- #[Override]
Return values
DataObject_prepareArray()
Set required array elements
protected
_prepareArray(array<string|int, mixed> &$arr[, array<string|int, mixed> $elements = [] ]) : array<string|int, mixed>
Parameters
- $arr : array<string|int, mixed>
- $elements : array<string|int, mixed> = []
Return values
array<string|int, mixed>_prepareSyncFieldsMap()
Called after old fields are inited. Forms synchronization map to sync old fields and new fields between each other.
protected
_prepareSyncFieldsMap() : $this
Return values
$this_protectFromNonAdmin()
Safeguard func that will check, if we are in admin area
protected
_protectFromNonAdmin() : mixed
Tags
_setHasError()
Sets flag, whether this quote has some error associated with it.
protected
_setHasError(bool $flag) : $this
Parameters
- $flag : bool
Return values
$this_setResourceModel()
Set resource names
protected
_setResourceModel(string $resourceName[, string|null $resourceCollectionName = null ]) : mixed
If collection name is omitted, resource name will be used with _collection appended
Parameters
- $resourceName : string
- $resourceCollectionName : string|null = null
_underscore()
Converts field names for setters and getters
protected
_underscore(string $name) : string
$this->setMyField($value) === $this->setData('my_field', $value) Uses cache to eliminate unnecessary preg_replace
Parameters
- $name : string
Return values
string_validateCouponCode()
protected
_validateCouponCode() : $this