Mage_Checkout_Model_Type_Multishipping_State Class Reference

Inheritance diagram for Mage_Checkout_Model_Type_Multishipping_State:

Varien_Object

List of all members.

Public Member Functions

 __construct ()
 getCheckout ()
 getSteps ()
 getActiveStep ()
 setActiveStep ($step)
 setCompleteStep ($step)
 getCompleteStep ($step)
 unsCompleteStep ($step)
 canSelectAddresses ()
 canInputShipping ()
 canSeeOverview ()
 canSuccess ()
 getCheckoutSession ()

Public Attributes

const STEP_SELECT_ADDRESSES = 'multishipping_addresses'
const STEP_SHIPPING = 'multishipping_shipping'
const STEP_BILLING = 'multishipping_billing'
const STEP_OVERVIEW = 'multishipping_overview'
const STEP_SUCCESS = 'multishipping_success'

Protected Attributes

 $_steps
 $_checkout


Detailed Description

Definition at line 34 of file State.php.


Constructor & Destructor Documentation

__construct (  ) 

Init model, steps

Reimplemented from Varien_Object.

Definition at line 60 of file State.php.

00061     {
00062         parent::__construct();
00063         $this->_steps = array(
00064             self::STEP_SELECT_ADDRESSES => new Varien_Object(array(
00065                 'label' => Mage::helper('checkout')->__('Select Addresses')
00066             )),
00067             self::STEP_SHIPPING => new Varien_Object(array(
00068                 'label' => Mage::helper('checkout')->__('Shipping Information')
00069             )),
00070             self::STEP_BILLING => new Varien_Object(array(
00071                 'label' => Mage::helper('checkout')->__('Billing Information')
00072             )),
00073             self::STEP_OVERVIEW => new Varien_Object(array(
00074                 'label' => Mage::helper('checkout')->__('Place Order')
00075             )),
00076             self::STEP_SUCCESS => new Varien_Object(array(
00077                 'label' => Mage::helper('checkout')->__('Order Success')
00078             )),
00079         );
00080 
00081         foreach ($this->_steps as $step) {
00082             $step->setIsComplete(false);
00083         }
00084 
00085         $this->_checkout = Mage::getSingleton('checkout/type_multishipping');
00086         $this->_steps[$this->getActiveStep()]->setIsActive(true);
00087     }


Member Function Documentation

canInputShipping (  ) 

Definition at line 189 of file State.php.

00190     {
00191 
00192     }

canSeeOverview (  ) 

Definition at line 194 of file State.php.

00195     {
00196 
00197     }

canSelectAddresses (  ) 

Definition at line 184 of file State.php.

00185     {
00186 
00187     }

canSuccess (  ) 

Definition at line 199 of file State.php.

00200     {
00201 
00202     }

getActiveStep (  ) 

Retrieve active step code

Returns:
string

Definition at line 114 of file State.php.

00115     {
00116         $step = $this->getCheckoutSession()->getCheckoutState();
00117         if (isset($this->_steps[$step])) {
00118             return $step;
00119         }
00120         return self::STEP_SELECT_ADDRESSES;
00121     }

getCheckout (  ) 

Retrieve checkout model

Returns:
Mage_Checkout_Model_Type_Multishipping

Definition at line 94 of file State.php.

00095     {
00096         return $this->_checkout;
00097     }

getCheckoutSession (  ) 

Retrieve checkout session

Returns:
Mage_Checkout_Model_Session

Definition at line 209 of file State.php.

00210     {
00211         return Mage::getSingleton('checkout/session');
00212     }

getCompleteStep ( step  ) 

Retrieve step complete status

Parameters:
string $step
Returns:
bool

Definition at line 162 of file State.php.

00163     {
00164         if (isset($this->_steps[$step])) {
00165             return $this->getCheckoutSession()->getStepData($step, 'is_complete');
00166         }
00167         return false;
00168     }

getSteps (  ) 

Retrieve available checkout steps

Returns:
array

Definition at line 104 of file State.php.

00105     {
00106         return $this->_steps;
00107     }

setActiveStep ( step  ) 

Definition at line 123 of file State.php.

00124     {
00125         if (isset($this->_steps[$step])) {
00126             $this->getCheckoutSession()->setCheckoutState($step);
00127         }
00128         else {
00129             $this->getCheckoutSession()->setCheckoutState(self::STEP_SELECT_ADDRESSES);
00130         }
00131 
00132         // Fix active step changing
00133         if(!$this->_steps[$step]->getIsActive()) {
00134             foreach($this->getSteps() as $stepObject) {
00135                 $stepObject->unsIsActive();
00136             }
00137             $this->_steps[$step]->setIsActive(true);
00138         }
00139         return $this;
00140     }

setCompleteStep ( step  ) 

Mark step as completed

Parameters:
string $step
Returns:
Mage_Checkout_Model_Type_Multishipping_State

Definition at line 148 of file State.php.

00149     {
00150         if (isset($this->_steps[$step])) {
00151             $this->getCheckoutSession()->setStepData($step, 'is_complete', true);
00152         }
00153         return $this;
00154     }

unsCompleteStep ( step  ) 

Unset complete status from step

Parameters:
string $step
Returns:
Mage_Checkout_Model_Type_Multishipping_State

Definition at line 176 of file State.php.

00177     {
00178         if (isset($this->_steps[$step])) {
00179             $this->getCheckoutSession()->setStepData($step, 'is_complete', false);
00180         }
00181         return $this;
00182     }


Member Data Documentation

$_checkout [protected]

Definition at line 54 of file State.php.

$_steps [protected]

Definition at line 47 of file State.php.

const STEP_BILLING = 'multishipping_billing'

Definition at line 38 of file State.php.

const STEP_OVERVIEW = 'multishipping_overview'

Definition at line 39 of file State.php.

const STEP_SELECT_ADDRESSES = 'multishipping_addresses'

Definition at line 36 of file State.php.

const STEP_SHIPPING = 'multishipping_shipping'

Definition at line 37 of file State.php.

const STEP_SUCCESS = 'multishipping_success'

Definition at line 40 of file State.php.


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