Public Member Functions | |
__construct () | |
getQuote () | |
getCustomer () | |
getStore () | |
getOrder () | |
Public Attributes | |
const | XML_PATH_DEFAULT_CREATEACCOUNT_GROUP = 'customer/create_account/default_group' |
Protected Attributes | |
$_quote = null | |
$_customer = null | |
$_store = null | |
$_order = null |
Definition at line 34 of file Quote.php.
__construct | ( | ) |
Constructor
By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes
Reimplemented from Varien_Object.
Definition at line 66 of file Quote.php.
00067 { 00068 $this->init('adminhtml_quote'); 00069 if (Mage::app()->isSingleStoreMode()) { 00070 $this->setStoreId(Mage::app()->getStore(true)->getId()); 00071 } 00072 }
getCustomer | ( | ) |
Retrieve customer model object
Definition at line 106 of file Quote.php.
00107 { 00108 if (is_null($this->_customer)) { 00109 $this->_customer = Mage::getModel('customer/customer'); 00110 if ($customerId = $this->getCustomerId()) { 00111 $this->_customer->load($customerId); 00112 } 00113 } 00114 return $this->_customer; 00115 }
getOrder | ( | ) |
Retrieve order model object
Definition at line 138 of file Quote.php.
00139 { 00140 if (is_null($this->_order)) { 00141 $this->_order = Mage::getModel('sales/order'); 00142 if ($this->getOrderId()) { 00143 $this->_order->load($this->getOrderId()); 00144 } 00145 } 00146 return $this->_order; 00147 }
getQuote | ( | ) |
Retrieve quote model object
Definition at line 79 of file Quote.php.
00080 { 00081 if (is_null($this->_quote)) { 00082 $this->_quote = Mage::getModel('sales/quote'); 00083 if ($this->getStoreId() && $this->getQuoteId()) { 00084 $this->_quote->setStoreId($this->getStoreId()) 00085 ->load($this->getQuoteId()); 00086 } 00087 elseif($this->getStoreId() && $this->hasCustomerId()) { 00088 $this->_quote->setStoreId($this->getStoreId()) 00089 ->setCustomerGroupId(Mage::getStoreConfig(self::XML_PATH_DEFAULT_CREATEACCOUNT_GROUP)) 00090 ->assignCustomer($this->getCustomer()) 00091 ->setIsActive(false) 00092 ->save(); 00093 $this->setQuoteId($this->_quote->getId()); 00094 } 00095 $this->_quote->setIgnoreOldQty(true); 00096 $this->_quote->setIsSuperMode(true); 00097 } 00098 return $this->_quote; 00099 }
getStore | ( | ) |
Retrieve store model object
Definition at line 122 of file Quote.php.
00123 { 00124 if (is_null($this->_store)) { 00125 $this->_store = Mage::app()->getStore($this->getStoreId()); 00126 if ($currencyId = $this->getCurrencyId()) { 00127 $this->_store->setCurrentCurrencyCode($currencyId); 00128 } 00129 } 00130 return $this->_store; 00131 }
const XML_PATH_DEFAULT_CREATEACCOUNT_GROUP = 'customer/create_account/default_group' |