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 |
Definition at line 34 of file State.php.
__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 }
getActiveStep | ( | ) |
Retrieve active step code
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 }
getCheckoutSession | ( | ) |
Retrieve checkout session
Definition at line 209 of file State.php.
00210 { 00211 return Mage::getSingleton('checkout/session'); 00212 }
getCompleteStep | ( | $ | step | ) |
Retrieve step complete status
string | $step |
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 | ( | ) |
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
string | $step |
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
string | $step |
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 }
const STEP_BILLING = 'multishipping_billing' |
const STEP_OVERVIEW = 'multishipping_overview' |
const STEP_SELECT_ADDRESSES = 'multishipping_addresses' |
const STEP_SHIPPING = 'multishipping_shipping' |
const STEP_SUCCESS = 'multishipping_success' |