Mage_Checkout_Multishipping_AddressController Class Reference

Inheritance diagram for Mage_Checkout_Multishipping_AddressController:

Mage_Core_Controller_Front_Action Mage_Core_Controller_Varien_Action

List of all members.

Public Member Functions

 newShippingAction ()
 shippingSavedAction ()
 editShippingAction ()
 editShippingPostAction ()
 selectBillingAction ()
 newBillingAction ()
 editAddressAction ()
 editBillingAction ()
 setBillingAction ()
 saveBillingAction ()

Protected Member Functions

 _getCheckout ()
 _getState ()


Detailed Description

Definition at line 34 of file AddressController.php.


Member Function Documentation

_getCheckout (  )  [protected]

Retrieve multishipping checkout model

Returns:
Mage_Checkout_Model_Type_Multishipping

Definition at line 41 of file AddressController.php.

00042     {
00043         return Mage::getSingleton('checkout/type_multishipping');
00044     }

_getState (  )  [protected]

Retrieve checkout state model

Returns:
Mage_Checkot_Model_Type_Multishipping_State

Definition at line 51 of file AddressController.php.

00052     {
00053         return Mage::getSingleton('checkout/type_multishipping_state');
00054     }

editAddressAction (  ) 

Definition at line 151 of file AddressController.php.

00152     {
00153         $this->loadLayout();
00154         $this->_initLayoutMessages('customer/session');
00155         if ($addressForm = $this->getLayout()->getBlock('customer_address_edit')) {
00156             $addressForm->setTitle(Mage::helper('checkout')->__('Edit Address'))
00157                 ->setSuccessUrl(Mage::getUrl('*/*/selectBilling'))
00158                 ->setErrorUrl(Mage::getUrl('*/*/*', array('id'=>$this->getRequest()->getParam('id'))))
00159                 ->setBackUrl(Mage::getUrl('*/*/selectBilling'));
00160 
00161             if ($headBlock = $this->getLayout()->getBlock('head')) {
00162                 $headBlock->setTitle($addressForm->getTitle() . ' - ' . $headBlock->getDefaultTitle());
00163             }
00164         }
00165         $this->renderLayout();
00166     }

editBillingAction (  ) 

Definition at line 168 of file AddressController.php.

00169     {
00170         $this->_getState()->setActiveStep(
00171             Mage_Checkout_Model_Type_Multishipping_State::STEP_BILLING
00172         );
00173         $this->loadLayout();
00174         $this->_initLayoutMessages('customer/session');
00175         if ($addressForm = $this->getLayout()->getBlock('customer_address_edit')) {
00176             $addressForm->setTitle(Mage::helper('checkout')->__('Edit Billing Address'))
00177                 ->setSuccessUrl(Mage::getUrl('*/*/saveBilling', array('id'=>$this->getRequest()->getParam('id'))))
00178                 ->setErrorUrl(Mage::getUrl('*/*/*', array('id'=>$this->getRequest()->getParam('id'))))
00179                 ->setBackUrl(Mage::getUrl('*/multishipping/overview'));
00180             if ($headBlock = $this->getLayout()->getBlock('head')) {
00181                 $headBlock->setTitle($addressForm->getTitle() . ' - ' . $headBlock->getDefaultTitle());
00182             }
00183         }
00184         $this->renderLayout();
00185     }

editShippingAction (  ) 

Definition at line 95 of file AddressController.php.

00096     {
00097         $this->_getState()->setActiveStep(Mage_Checkout_Model_Type_Multishipping_State::STEP_SHIPPING);
00098         $this->loadLayout();
00099         $this->_initLayoutMessages('customer/session');
00100         if ($addressForm = $this->getLayout()->getBlock('customer_address_edit')) {
00101             $addressForm->setTitle(Mage::helper('checkout')->__('Edit Shipping Address'))
00102                 ->setSuccessUrl(Mage::getUrl('*/*/editShippingPost', array('id'=>$this->getRequest()->getParam('id'))))
00103                 ->setErrorUrl(Mage::getUrl('*/*/*'));
00104 
00105             if ($headBlock = $this->getLayout()->getBlock('head')) {
00106                 $headBlock->setTitle($addressForm->getTitle() . ' - ' . $headBlock->getDefaultTitle());
00107             }
00108 
00109             if ($this->_getCheckout()->getCustomerDefaultShippingAddress()) {
00110                 $addressForm->setBackUrl(Mage::getUrl('*/multishipping/shipping'));
00111             }
00112         }
00113         $this->renderLayout();
00114     }

editShippingPostAction (  ) 

Definition at line 116 of file AddressController.php.

00117     {
00118         if ($addressId = $this->getRequest()->getParam('id')) {
00119             Mage::getModel('checkout/type_multishipping')
00120                 ->updateQuoteCustomerShippingAddress($addressId);
00121         }
00122         $this->_redirect('*/multishipping/shipping');
00123     }

newBillingAction (  ) 

Definition at line 134 of file AddressController.php.

00135     {
00136         $this->loadLayout();
00137         $this->_initLayoutMessages('customer/session');
00138         if ($addressForm = $this->getLayout()->getBlock('customer_address_edit')) {
00139             $addressForm->setTitle(Mage::helper('checkout')->__('Create Billing Address'))
00140                 ->setSuccessUrl(Mage::getUrl('*/*/selectBilling'))
00141                 ->setErrorUrl(Mage::getUrl('*/*/*'))
00142                 ->setBackUrl(Mage::getUrl('*/*/selectBilling'));
00143 
00144             if ($headBlock = $this->getLayout()->getBlock('head')) {
00145                 $headBlock->setTitle($addressForm->getTitle() . ' - ' . $headBlock->getDefaultTitle());
00146             }
00147         }
00148         $this->renderLayout();
00149     }

newShippingAction (  ) 

Create New Shipping address Form

Definition at line 60 of file AddressController.php.

00061     {
00062         $this->_getState()->setActiveStep(Mage_Checkout_Model_Type_Multishipping_State::STEP_SELECT_ADDRESSES);
00063         $this->loadLayout();
00064         $this->_initLayoutMessages('customer/session');
00065         if ($addressForm = $this->getLayout()->getBlock('customer_address_edit')) {
00066             $addressForm->setTitle(Mage::helper('checkout')->__('Create Shipping Address'))
00067                 ->setSuccessUrl(Mage::getUrl('*/*/shippingSaved'))
00068                 ->setErrorUrl(Mage::getUrl('*/*/*'));
00069 
00070             if ($headBlock = $this->getLayout()->getBlock('head')) {
00071                 $headBlock->setTitle($addressForm->getTitle() . ' - ' . $headBlock->getDefaultTitle());
00072             }
00073 
00074             if ($this->_getCheckout()->getCustomerDefaultShippingAddress()) {
00075                 $addressForm->setBackUrl(Mage::getUrl('*/multishipping/addresses'));
00076             }
00077             else {
00078                 $addressForm->setBackUrl(Mage::getUrl('*/cart/'));
00079             }
00080         }
00081         $this->renderLayout();
00082     }

saveBillingAction (  ) 

Definition at line 196 of file AddressController.php.

00197     {
00198         if ($addressId = $this->getRequest()->getParam('id')) {
00199             Mage::getModel('checkout/type_multishipping')
00200                 ->setQuoteCustomerBillingAddress($addressId);
00201         }
00202         $this->_redirect('*/multishipping/overview');
00203     }

selectBillingAction (  ) 

Definition at line 125 of file AddressController.php.

00126     {
00127         $this->_getState()->setActiveStep(Mage_Checkout_Model_Type_Multishipping_State::STEP_BILLING);
00128         $this->loadLayout();
00129         $this->_initLayoutMessages('customer/session');
00130         $this->_initLayoutMessages('checkout/session');
00131         $this->renderLayout();
00132     }

setBillingAction (  ) 

Definition at line 187 of file AddressController.php.

00188     {
00189         if ($addressId = $this->getRequest()->getParam('id')) {
00190             Mage::getModel('checkout/type_multishipping')
00191                 ->setQuoteCustomerBillingAddress($addressId);
00192         }
00193         $this->_redirect('*/multishipping/billing');
00194     }

shippingSavedAction (  ) 

if we create first address we need reset emd init checkout

Definition at line 84 of file AddressController.php.

00085     {
00086         /**
00087          * if we create first address we need reset emd init checkout
00088          */
00089         if (count($this->_getCheckout()->getCustomer()->getAddresses()) == 1) {
00090             $this->_getCheckout()->reset();
00091         }
00092         $this->_redirect('*/multishipping/');
00093     }


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

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