Class Mage_Sales_Model_Quote

Description

Quote model

Supported events: sales_quote_load_after sales_quote_save_before sales_quote_save_after sales_quote_delete_before sales_quote_delete_after

Located in /Sales/Model/Quote.php (line 39)

Varien_Object
   |
   --Mage_Core_Model_Abstract
      |
      --Mage_Sales_Model_Quote
Class Constant Summary
Variable Summary
Method Summary
void addMessage ( $message, [ $index = 'error'])
Mage_Sales_Model_Quote_Item|string addProduct ( $product, [null|float|Varien_Object $request = null])
Mage_Sales_Model_Quote_Item|string addProductAdvanced ( $product, [null|float|Varien_Object $request = null], [null|string $processMode = null])
void getAddressByCustomerAddressId ( $addressId)
void getAllAddresses ()
array getAllItems ()
string getCheckoutMethod ([boolean $originalMethod = false])
bool getIsVirtual ()
Mage_Eav_Model_Entity_Collection_Abstract getItemsCollection ([ $useCache = true], bool $loaded)
void getMessages ()
void getPaymentById ( $paymentId)
int getStoreId ()
array getTotals ()
bool hasItems ()
bool hasNominalItems ([bool $countVirtual = true])
bool hasProductId (int $productId)
bool hasVirtualItems ()
bool isNominal ()
bool isVirtual ()
void removeAddress ( $addressId)
void removePayment ()
Mage_Sales_Model_Quote_Item updateItem (int $itemId, Varien_Object $buyRequest, [null|array|Varien_Object $params = null])
void validateMinimumAmount ([ $multishipping = false])
Mage_Sales_Model_Quote_Item _addCatalogProduct ( $product, [ $qty = 1])
void _construct ()
Variables
Mage_Eav_Model_Entity_Collection_Abstract $_addresses = null (line 56)

Quote addresses collection

  • access: protected
Mage_Customer_Model_Customer $_customer (line 49)

Quote customer model object

  • access: protected
mixed $_eventObject = 'quote' (line 42)
  • access: protected

Redefinition of:
Mage_Core_Model_Abstract::$_eventObject
Parameter name in event
mixed $_eventPrefix = 'sales_quote' (line 41)
  • access: protected

Redefinition of:
Mage_Core_Model_Abstract::$_eventPrefix
Prefix of model events names

Quote items collection

  • access: protected
Mage_Eav_Model_Entity_Collection_Abstract $_payments = null (line 70)

Quote payments

  • access: protected

Inherited Variables

Inherited from Mage_Core_Model_Abstract

Mage_Core_Model_Abstract::$_cacheTag
Mage_Core_Model_Abstract::$_dataSaveAllowed
Mage_Core_Model_Abstract::$_isObjectNew
Mage_Core_Model_Abstract::$_resource
Mage_Core_Model_Abstract::$_resourceCollectionName
Mage_Core_Model_Abstract::$_resourceName
Methods
addAddress (line 510)
  • access: public
void addAddress (Mage_Sales_Model_Quote_Address $address)
addItem (line 699)

Adding new item to quote

  • access: public
addMessage (line 1194)
  • access: public
void addMessage ( $message, [ $index = 'error'])
  • $message
  • $index
addPayment (line 1038)
  • access: public
void addPayment (Mage_Sales_Model_Quote_Payment $payment)
addProduct (line 808)

Add product to quote

return error message if product type instance can't prepare product

  • access: public
Mage_Sales_Model_Quote_Item|string addProduct ( $product, [null|float|Varien_Object $request = null])
  • mixed $product
  • null|float|Varien_Object $request
addProductAdvanced (line 730)

Advanced func to add product to quote - processing mode can be specified there.

Returns error message if product type instance can't prepare product.

  • access: public
Mage_Sales_Model_Quote_Item|string addProductAdvanced ( $product, [null|float|Varien_Object $request = null], [null|string $processMode = null])
  • mixed $product
  • null|float|Varien_Object $request
  • null|string $processMode
addShippingAddress (line 560)
  • access: public
void addShippingAddress (Mage_Sales_Model_Quote_Address $address)
assignCustomer (line 264)

Assign customer model object data to quote

  • access: public
Mage_Sales_Model_Quote assignCustomer ( $customer)
assignCustomerWithAddressChange (line 277)

Assign customer model to quote with billing and shipping address change

  • access: public
Mage_Sales_Model_Quote assignCustomerWithAddressChange ( $customer, [Mage_Sales_Model_Quote_Address $billingAddress = null], [Mage_Sales_Model_Quote_Address $shippingAddress = null])
collectTotals (line 1068)

Collect totals

  • access: public
Mage_Sales_Model_Quote collectTotals ()
getAddressByCustomerAddressId (line 470)
  • access: public
void getAddressByCustomerAddressId ( $addressId)
  • $addressId
getAddressById (line 460)
  • access: public
Mage_Sales_Model_Quote_Address getAddressById (int $addressId)
  • int $addressId
getAddressesCollection (line 378)

Retrieve quote address collection

  • access: public
Mage_Eav_Model_Entity_Collection_Abstract getAddressesCollection ()
getAllAddresses (line 444)
  • access: public
void getAllAddresses ()
getAllItems (line 586)

Retrieve quote items array

  • access: public
array getAllItems ()
getAllShippingAddresses (line 432)
  • access: public
void getAllShippingAddresses ()
getAllVisibleItems (line 602)

Get array of all items what can be display directly

  • access: public
array getAllVisibleItems ()
getBillingAddress (line 417)

Retrieve quote billing address

  • access: public
Mage_Sales_Model_Quote_Address getBillingAddress ()
getCheckoutMethod (line 1516)

Return quote checkout method code

  • deprecated: after 1.4 beta1 it is checkout module responsibility
  • access: public
string getCheckoutMethod ([boolean $originalMethod = false])
  • boolean $originalMethod: if true return defined method from begining
getCustomer (line 331)

Retrieve customer model object

  • access: public
getCustomerGroupId (line 350)

Retrieve customer group id

  • access: public
int getCustomerGroupId ()
getCustomerTaxClassId (line 360)
  • access: public
void getCustomerTaxClassId ()
getIsVirtual (line 1303)

Check quote for virtual product only

  • access: public
bool getIsVirtual ()
getItemById (line 662)

Retrieve item model object by item identifier

  • access: public
Mage_Sales_Model_Quote_Item getItemById (int $itemId)
  • int $itemId
getItemByProduct (line 937)

Retrieve quote item by product id

  • return: || false
  • access: public
getItemsCollection (line 572)

Retrieve quote items collection

  • access: public
Mage_Eav_Model_Entity_Collection_Abstract getItemsCollection ([ $useCache = true], bool $loaded)
  • bool $loaded
  • $useCache
getItemsSummaryQty (line 947)
  • access: public
void getItemsSummaryQty ()
getItemVirtualQty (line 970)
  • access: public
void getItemVirtualQty ()
getMessages (line 1214)
  • access: public
void getMessages ()
getPayment (line 1016)
  • access: public
getPaymentById (line 1028)
  • access: public
void getPaymentById ( $paymentId)
  • $paymentId
getPaymentsCollection (line 998)

********************* PAYMENTS **************************

  • access: public
void getPaymentsCollection ()
getSharedStoreIds (line 120)

Get all available store ids for quote

  • access: public
array getSharedStoreIds ()
getShippingAddress (line 427)

retrieve quote shipping address

  • access: public
Mage_Sales_Model_Quote_Address getShippingAddress ()
getShippingAddressByCustomerAddressId (line 480)
  • access: public
void getShippingAddressByCustomerAddressId ( $addressId)
  • $addressId
getStore (line 98)

Get quote store model object

  • access: public
Mage_Core_Model_Store getStore ()
getStoreId (line 85)

Get quote store identifier

  • access: public
int getStoreId ()
getTotals (line 1158)

Get all quote totals (sorted by priority) Method process quote states isVirtual and isMultiShipping

  • access: public
array getTotals ()
hasItems (line 618)

Checking items availability

  • access: public
bool hasItems ()
hasItemsWithDecimalQty (line 628)

Checking availability of items with decimal qty

  • access: public
bool hasItemsWithDecimalQty ()
hasNominalItems (line 1411)

Getter whether quote has nominal items Can bypass treating virtual items as nominal

  • access: public
bool hasNominalItems ([bool $countVirtual = true])
  • bool $countVirtual
hasProductId (line 645)

Checking product exist in Quote

  • access: public
bool hasProductId (int $productId)
  • int $productId
hasRecurringItems (line 1394)

Whether there are recurring items

  • access: public
bool hasRecurringItems ()
hasVirtualItems (line 1313)

Has a virtual products on quote

  • access: public
bool hasVirtualItems ()
isAllowedGuestCheckout (line 1530)

Check is allow Guest Checkout

  • deprecated: after 1.4 beta1 it is checkout module responsibility
  • access: public
bool isAllowedGuestCheckout ()
isNominal (line 1429)

Whether quote has nominal items only

  • access: public
bool isNominal ()
isVirtual (line 1280)

Check quote for virtual product only

  • access: public
bool isVirtual ()
loadActive (line 238)

Loading only active quote

  • access: public
Mage_Sales_Model_Quote loadActive (int $quoteId)
  • int $quoteId
loadByCustomer (line 219)

Loading quote data by customer

  • access: public
Mage_Sales_Model_Quote loadByCustomer ( $customer)
  • $customer
loadByIdWithoutStore (line 251)

Loading quote by identifier

  • access: public
Mage_Sales_Model_Quote loadByIdWithoutStore (int $quoteId)
  • int $quoteId
merge (line 1333)

Merge quotes

  • access: public
prepareRecurringPaymentProfiles (line 1444)

Create recurring payment profiles basing on the current items

  • access: public
array prepareRecurringPaymentProfiles ()
removeAddress (line 491)
  • access: public
void removeAddress ( $addressId)
  • $addressId
removeAllAddresses (line 502)
  • access: public
void removeAllAddresses ()
removeItem (line 673)

Remove quote item by item identifier

  • access: public
Mage_Sales_Model_Quote removeItem (int $itemId)
  • int $itemId
removePayment (line 1057)
  • access: public
void removePayment ()
reserveOrderId (line 1229)

Generate new increment order id and associate it with current quote

  • access: public
Mage_Sales_Model_Quote reserveOrderId ()
setBillingAddress (line 525)

Enter description here...

  • access: public
setCustomer (line 318)

Define customer object

  • access: public
Mage_Sales_Model_Quote setCustomer ( $customer)
setPayment (line 1047)
  • access: public
void setPayment (Mage_Sales_Model_Quote_Payment $payment)
setShippingAddress (line 543)

Enter description here...

  • access: public
setStore (line 109)

Declare quote store model

  • access: public
Mage_Sales_Model_Quote setStore ( $store)
updateItem (line 874)

Updates quote item with new configuration

$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', Varien_Object 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()

Mage_Sales_Model_Quote_Item updateItem (int $itemId, Varien_Object $buyRequest, [null|array|Varien_Object $params = null])
  • int $itemId
  • Varien_Object $buyRequest
  • null|array|Varien_Object $params
validateMinimumAmount (line 1243)
  • access: public
void validateMinimumAmount ([ $multishipping = false])
  • $multishipping
_addCatalogProduct (line 819)

Adding catalog product object data to quote

  • access: protected
Mage_Sales_Model_Quote_Item _addCatalogProduct ( $product, [ $qty = 1])
_afterLoad (line 1489)

Trigger collect totals after loading, if required

  • access: protected
Mage_Sales_Model_Quote _afterLoad ()

Redefinition of:
Mage_Core_Model_Abstract::_afterLoad()
Processing object after load data
_afterSave (line 196)

Save related items

  • access: protected
Mage_Sales_Model_Quote _afterSave ()

Redefinition of:
Mage_Core_Model_Abstract::_afterSave()
Processing object after save data
_beforeSave (line 137)

Prepare data before save

  • access: protected
Mage_Sales_Model_Quote _beforeSave ()

Redefinition of:
Mage_Core_Model_Abstract::_beforeSave()
Processing object before save data
_construct (line 75)

Init resource model

  • access: protected
void _construct ()
_getAddressByType (line 399)

Retrieve quote address by type

  • access: protected
Mage_Sales_Model_Quote_Address _getAddressByType (string $type)
  • string $type
_validateCouponCode (line 1464)
  • access: protected
void _validateCouponCode ()

Inherited Methods

Inherited From Mage_Core_Model_Abstract

Mage_Core_Model_Abstract::afterCommitCallback()
Mage_Core_Model_Abstract::afterLoad()
Mage_Core_Model_Abstract::cleanModelCache()
Mage_Core_Model_Abstract::clearInstance()
Mage_Core_Model_Abstract::delete()
Mage_Core_Model_Abstract::getCacheIdTags()
Mage_Core_Model_Abstract::getCacheTags()
Mage_Core_Model_Abstract::getCollection()
Mage_Core_Model_Abstract::getEntityId()
Mage_Core_Model_Abstract::getId()
Mage_Core_Model_Abstract::getIdFieldName()
Mage_Core_Model_Abstract::getResource()
Mage_Core_Model_Abstract::getResourceCollection()
Mage_Core_Model_Abstract::getResourceName()
Mage_Core_Model_Abstract::isObjectNew()
Mage_Core_Model_Abstract::load()
Mage_Core_Model_Abstract::save()
Mage_Core_Model_Abstract::setId()
Mage_Core_Model_Abstract::_afterDelete()
Mage_Core_Model_Abstract::_afterDeleteCommit()
Mage_Core_Model_Abstract::_afterLoad()
Mage_Core_Model_Abstract::_afterSave()
Mage_Core_Model_Abstract::_afterSaveCommit()
Mage_Core_Model_Abstract::_beforeDelete()
Mage_Core_Model_Abstract::_beforeLoad()
Mage_Core_Model_Abstract::_beforeSave()
Mage_Core_Model_Abstract::_clearData()
Mage_Core_Model_Abstract::_clearReferences()
Mage_Core_Model_Abstract::_getEventData()
Mage_Core_Model_Abstract::_getResource()
Mage_Core_Model_Abstract::_hasModelChanged()
Mage_Core_Model_Abstract::_init()
Mage_Core_Model_Abstract::_protectFromNonAdmin()
Mage_Core_Model_Abstract::_setResourceModel()
Class Constants
CHECKOUT_METHOD_GUEST = 'guest' (line 1506)
CHECKOUT_METHOD_LOGIN_IN = 'login_in' (line 1507)
CHECKOUT_METHOD_REGISTER = 'register' (line 1505)
  • deprecated: after 1.4 beta1 - one page checkout responsibility

Documentation generated on Fri, 11 Feb 2011 17:10:49 +0200 by phpDocumentor 1.4.3