Mage_Checkout_Model_Type_Abstract Class Reference

Inheritance diagram for Mage_Checkout_Model_Type_Abstract:

Varien_Object Mage_Checkout_Model_Type_Multishipping

List of all members.

Public Member Functions

 getCheckoutSession ()
 getQuote ()
 getQuoteItems ()
 getCustomerSession ()
 getCustomer ()
 getCustomerDefaultShippingAddress ()
 getCustomerDefaultBillingAddress ()

Protected Member Functions

 _createOrderFromAddress ($address)
 _emailOrderConfirmation ($email, $name, $order)


Detailed Description

Definition at line 34 of file Abstract.php.


Member Function Documentation

_createOrderFromAddress ( address  )  [protected]

Definition at line 133 of file Abstract.php.

00134     {
00135         $order = Mage::getModel('sales/order')->createFromQuoteAddress($address)
00136             ->setCustomerId($this->getCustomer()->getId())
00137             ->setGlobalCurrencyCode('USD')
00138             ->setBaseCurrencyCode('USD')
00139             ->setStoreCurrencyCode('USD')
00140             ->setOrderCurrencyCode('USD')
00141             ->setStoreToBaseRate(1)
00142             ->setStoreToOrderRate(1);
00143         return $order;
00144     }

_emailOrderConfirmation ( email,
name,
order 
) [protected]

Definition at line 146 of file Abstract.php.

00147     {
00148         $mailer = Mage::getModel('core/email')
00149             ->setTemplate('email/order.phtml')
00150             ->setType('html')
00151             ->setTemplateVar('order', $order)
00152             ->setTemplateVar('quote', $this->getQuote())
00153             ->setTemplateVar('name', $name)
00154             ->setToName($name)
00155             ->setToEmail($email)
00156             ->send();
00157     }

getCheckoutSession (  ) 

Retrieve checkout session model

Returns:
Mage_Checkout_Model_Session

Definition at line 41 of file Abstract.php.

00042     {
00043         $checkout = $this->getData('checkout_session');
00044         if (is_null($checkout)) {
00045             $checkout = Mage::getSingleton('checkout/session');
00046             $this->setData('checkout_session', $checkout);
00047         }
00048         return $checkout;
00049     }

getCustomer (  ) 

Retrieve customer object

Returns:
Mage_Customer_Model_Customer

Definition at line 91 of file Abstract.php.

00092     {
00093         return $this->getCustomerSession()->getCustomer();
00094     }

getCustomerDefaultBillingAddress (  ) 

Retrieve customer default billing address

Returns:
Mage_Customer_Model_Address || false

Definition at line 123 of file Abstract.php.

00124     {
00125         $address = $this->getData('customer_default_billing_address');
00126         if (is_null($address)) {
00127             $address = $this->getCustomer()->getDefaultBillingAddress();
00128             $this->setData('customer_default_billing_address', $address);
00129         }
00130         return $address;
00131     }

getCustomerDefaultShippingAddress (  ) 

Retrieve customer default shipping address

Returns:
Mage_Customer_Model_Address || false

Definition at line 101 of file Abstract.php.

00102     {
00103         $address = $this->getData('customer_default_shipping_address');
00104         if (is_null($address)) {
00105             $address = $this->getCustomer()->getDefaultShippingAddress();
00106             if (!$address) {
00107                 foreach ($this->getCustomer()->getAddresses() as $address) {
00108                     if($address){
00109                         break;
00110                     }
00111                 }
00112             }
00113             $this->setData('customer_default_shipping_address', $address);
00114         }
00115         return $address;
00116     }

getCustomerSession (  ) 

Retrieve customer session vodel

Returns:
Mage_Customer_Model_Session

Definition at line 76 of file Abstract.php.

00077     {
00078         $customer = $this->getData('customer_session');
00079         if (is_null($customer)) {
00080             $customer = Mage::getSingleton('customer/session');
00081             $this->setData('customer_session', $customer);
00082         }
00083         return $customer;
00084     }

getQuote (  ) 

Retrieve quote model

Returns:
Mage_Sales_Model_Quote

Definition at line 56 of file Abstract.php.

00057     {
00058         return $this->getCheckoutSession()->getQuote();
00059     }

getQuoteItems (  ) 

Retrieve quote items

Returns:
array

Definition at line 66 of file Abstract.php.

00067     {
00068         return $this->getQuote()->getAllItems();
00069     }


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

Generated on Sat Jul 4 17:23:51 2009 for Magento by  doxygen 1.5.8