Overview

Packages

  • currencysymbol
  • MAbout
  • Mage
    • Admin
    • Adminhtml
    • AdminNotification
    • Api
    • Api2
    • Authorizenet
    • Backup
    • Bundle
    • Captcha
    • Catalog
    • CatalogIndex
    • CatalogInventory
    • CatalogRule
    • CatalogSearch
    • Centinel
    • Checkout
    • Cms
    • Compiler
    • Connect
    • Contacts
    • Core
    • Cron
    • CurrencySymbol
    • Customer
    • Dataflow
    • Directory
    • DirtectPost
    • Downloadable
    • Eav
    • GiftMessage
    • GoogleAnalytics
    • GoogleBase
    • GoogleCheckout
    • ImportExport
    • Index
    • Install
    • Log
    • Media
    • Newsletter
    • Oauth
    • Page
    • PageCache
    • Paygate
    • Payment
    • Paypal
    • PaypalUk
    • Persistent
    • Poll
    • ProductAlert
    • Rating
    • Reports
    • Review
    • Rss
    • Rule
    • Sales
    • SalesRule
    • Sedfriend
    • Sendfriend
    • Shipping
    • Sitemap
    • Tag
    • Tax
    • Usa
    • Weee
    • Widget
    • Wishlist
    • XmlConnect
  • None
  • Phoenix
    • Moneybookers
  • PHP
  • Zend
    • Date
    • Mime
    • XmlRpc

Classes

  • Mage_Checkout_Block_Agreements
  • Mage_Checkout_Block_Cart
  • Mage_Checkout_Block_Cart_Abstract
  • Mage_Checkout_Block_Cart_Coupon
  • Mage_Checkout_Block_Cart_Crosssell
  • Mage_Checkout_Block_Cart_Item_Configure
  • Mage_Checkout_Block_Cart_Item_Renderer
  • Mage_Checkout_Block_Cart_Item_Renderer_Configurable
  • Mage_Checkout_Block_Cart_Item_Renderer_Grouped
  • Mage_Checkout_Block_Cart_Shipping
  • Mage_Checkout_Block_Cart_Sidebar
  • Mage_Checkout_Block_Cart_Totals
  • Mage_Checkout_Block_Links
  • Mage_Checkout_Block_Multishipping_Abstract
  • Mage_Checkout_Block_Multishipping_Address_Select
  • Mage_Checkout_Block_Multishipping_Addresses
  • Mage_Checkout_Block_Multishipping_Billing
  • Mage_Checkout_Block_Multishipping_Billing_Items
  • Mage_Checkout_Block_Multishipping_Link
  • Mage_Checkout_Block_Multishipping_Overview
  • Mage_Checkout_Block_Multishipping_Payment_Info
  • Mage_Checkout_Block_Multishipping_Shipping
  • Mage_Checkout_Block_Multishipping_State
  • Mage_Checkout_Block_Multishipping_Success
  • Mage_Checkout_Block_Onepage
  • Mage_Checkout_Block_Onepage_Abstract
  • Mage_Checkout_Block_Onepage_Billing
  • Mage_Checkout_Block_Onepage_Failure
  • Mage_Checkout_Block_Onepage_Link
  • Mage_Checkout_Block_Onepage_Login
  • Mage_Checkout_Block_Onepage_Payment
  • Mage_Checkout_Block_Onepage_Payment_Info
  • Mage_Checkout_Block_Onepage_Payment_Methods
  • Mage_Checkout_Block_Onepage_Progress
  • Mage_Checkout_Block_Onepage_Review
  • Mage_Checkout_Block_Onepage_Review_Info
  • Mage_Checkout_Block_Onepage_Shipping
  • Mage_Checkout_Block_Onepage_Shipping_Method
  • Mage_Checkout_Block_Onepage_Shipping_Method_Additional
  • Mage_Checkout_Block_Onepage_Shipping_Method_Available
  • Mage_Checkout_Block_Onepage_Success
  • Mage_Checkout_Block_Success
  • Mage_Checkout_Block_Total_Default
  • Mage_Checkout_Block_Total_Nominal
  • Mage_Checkout_Block_Total_Tax
  • Mage_Checkout_CartController
  • Mage_Checkout_Controller_Action
  • Mage_Checkout_Exception
  • Mage_Checkout_Helper_Cart
  • Mage_Checkout_Helper_Data
  • Mage_Checkout_Helper_Url
  • Mage_Checkout_IndexController
  • Mage_Checkout_Model_Agreement
  • Mage_Checkout_Model_Api_Resource
  • Mage_Checkout_Model_Api_Resource_Customer
  • Mage_Checkout_Model_Api_Resource_Product
  • Mage_Checkout_Model_Cart
  • Mage_Checkout_Model_Cart_Api
  • Mage_Checkout_Model_Cart_Api_V2
  • Mage_Checkout_Model_Cart_Coupon_Api
  • Mage_Checkout_Model_Cart_Coupon_Api_V2
  • Mage_Checkout_Model_Cart_Customer_Api
  • Mage_Checkout_Model_Cart_Customer_Api_V2
  • Mage_Checkout_Model_Cart_Payment_Api
  • Mage_Checkout_Model_Cart_Payment_Api_V2
  • Mage_Checkout_Model_Cart_Product_Api
  • Mage_Checkout_Model_Cart_Product_Api_V2
  • Mage_Checkout_Model_Cart_Shipping_Api
  • Mage_Checkout_Model_Cart_Shipping_Api_V2
  • Mage_Checkout_Model_Config_Source_Cart_Summary
  • Mage_Checkout_Model_Mysql4_Agreement
  • Mage_Checkout_Model_Mysql4_Agreement_Collection
  • Mage_Checkout_Model_Mysql4_Cart
  • Mage_Checkout_Model_Mysql4_Setup
  • Mage_Checkout_Model_Observer
  • Mage_Checkout_Model_Resource_Agreement
  • Mage_Checkout_Model_Resource_Agreement_Collection
  • Mage_Checkout_Model_Resource_Cart
  • Mage_Checkout_Model_Resource_Setup
  • Mage_Checkout_Model_Session
  • Mage_Checkout_Model_Type_Abstract
  • Mage_Checkout_Model_Type_Multishipping
  • Mage_Checkout_Model_Type_Multishipping_State
  • Mage_Checkout_Model_Type_Onepage
  • Mage_Checkout_Multishipping_AddressController
  • Mage_Checkout_MultishippingController
  • Mage_Checkout_OnepageController

Interfaces

  • Mage_Checkout_Model_Cart_Interface
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * Magento
  4:  *
  5:  * NOTICE OF LICENSE
  6:  *
  7:  * This source file is subject to the Open Software License (OSL 3.0)
  8:  * that is bundled with this package in the file LICENSE.txt.
  9:  * It is also available through the world-wide-web at this URL:
 10:  * http://opensource.org/licenses/osl-3.0.php
 11:  * If you did not receive a copy of the license and are unable to
 12:  * obtain it through the world-wide-web, please send an email
 13:  * to license@magentocommerce.com so we can send you a copy immediately.
 14:  *
 15:  * DISCLAIMER
 16:  *
 17:  * Do not edit or add to this file if you wish to upgrade Magento to newer
 18:  * versions in the future. If you wish to customize Magento for your
 19:  * needs please refer to http://www.magentocommerce.com for more information.
 20:  *
 21:  * @category    Mage
 22:  * @package     Mage_Checkout
 23:  * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
 24:  * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 25:  */
 26: 
 27: /**
 28:  * Multishipping checkout state model
 29:  *
 30:  * @category   Mage
 31:  * @package    Mage_Checkout
 32:  * @author      Magento Core Team <core@magentocommerce.com>
 33:  */
 34: class Mage_Checkout_Model_Type_Multishipping_State extends Varien_Object
 35: {
 36:     const STEP_SELECT_ADDRESSES = 'multishipping_addresses';
 37:     const STEP_SHIPPING         = 'multishipping_shipping';
 38:     const STEP_BILLING          = 'multishipping_billing';
 39:     const STEP_OVERVIEW         = 'multishipping_overview';
 40:     const STEP_SUCCESS          = 'multishipping_success';
 41: 
 42:     /**
 43:      * Allow steps array
 44:      *
 45:      * @var array
 46:      */
 47:     protected $_steps;
 48: 
 49:     /**
 50:      * Checkout model
 51:      *
 52:      * @var Mage_Checkout_Model_Type_Multishipping
 53:      */
 54:     protected $_checkout;
 55: 
 56:     /**
 57:      * Init model, steps
 58:      *
 59:      */
 60:     public function __construct()
 61:     {
 62:         parent::__construct();
 63:         $this->_steps = array(
 64:             self::STEP_SELECT_ADDRESSES => new Varien_Object(array(
 65:                 'label' => Mage::helper('checkout')->__('Select Addresses')
 66:             )),
 67:             self::STEP_SHIPPING => new Varien_Object(array(
 68:                 'label' => Mage::helper('checkout')->__('Shipping Information')
 69:             )),
 70:             self::STEP_BILLING => new Varien_Object(array(
 71:                 'label' => Mage::helper('checkout')->__('Billing Information')
 72:             )),
 73:             self::STEP_OVERVIEW => new Varien_Object(array(
 74:                 'label' => Mage::helper('checkout')->__('Place Order')
 75:             )),
 76:             self::STEP_SUCCESS => new Varien_Object(array(
 77:                 'label' => Mage::helper('checkout')->__('Order Success')
 78:             )),
 79:         );
 80: 
 81:         foreach ($this->_steps as $step) {
 82:             $step->setIsComplete(false);
 83:         }
 84: 
 85:         $this->_checkout = Mage::getSingleton('checkout/type_multishipping');
 86:         $this->_steps[$this->getActiveStep()]->setIsActive(true);
 87:     }
 88: 
 89:     /**
 90:      * Retrieve checkout model
 91:      *
 92:      * @return Mage_Checkout_Model_Type_Multishipping
 93:      */
 94:     public function getCheckout()
 95:     {
 96:         return $this->_checkout;
 97:     }
 98: 
 99:     /**
100:      * Retrieve available checkout steps
101:      *
102:      * @return array
103:      */
104:     public function getSteps()
105:     {
106:         return $this->_steps;
107:     }
108: 
109:     /**
110:      * Retrieve active step code
111:      *
112:      * @return string
113:      */
114:     public function getActiveStep()
115:     {
116:         $step = $this->getCheckoutSession()->getCheckoutState();
117:         if (isset($this->_steps[$step])) {
118:             return $step;
119:         }
120:         return self::STEP_SELECT_ADDRESSES;
121:     }
122: 
123:     public function setActiveStep($step)
124:     {
125:         if (isset($this->_steps[$step])) {
126:             $this->getCheckoutSession()->setCheckoutState($step);
127:         }
128:         else {
129:             $this->getCheckoutSession()->setCheckoutState(self::STEP_SELECT_ADDRESSES);
130:         }
131: 
132:         // Fix active step changing
133:         if(!$this->_steps[$step]->getIsActive()) {
134:             foreach($this->getSteps() as $stepObject) {
135:                 $stepObject->unsIsActive();
136:             }
137:             $this->_steps[$step]->setIsActive(true);
138:         }
139:         return $this;
140:     }
141: 
142:     /**
143:      * Mark step as completed
144:      *
145:      * @param string $step
146:      * @return Mage_Checkout_Model_Type_Multishipping_State
147:      */
148:     public function setCompleteStep($step)
149:     {
150:         if (isset($this->_steps[$step])) {
151:             $this->getCheckoutSession()->setStepData($step, 'is_complete', true);
152:         }
153:         return $this;
154:     }
155: 
156:     /**
157:      * Retrieve step complete status
158:      *
159:      * @param string $step
160:      * @return bool
161:      */
162:     public function getCompleteStep($step)
163:     {
164:         if (isset($this->_steps[$step])) {
165:             return $this->getCheckoutSession()->getStepData($step, 'is_complete');
166:         }
167:         return false;
168:     }
169: 
170:     /**
171:      * Unset complete status from step
172:      *
173:      * @param string $step
174:      * @return Mage_Checkout_Model_Type_Multishipping_State
175:      */
176:     public function unsCompleteStep($step)
177:     {
178:         if (isset($this->_steps[$step])) {
179:             $this->getCheckoutSession()->setStepData($step, 'is_complete', false);
180:         }
181:         return $this;
182:     }
183: 
184:     public function canSelectAddresses()
185:     {
186: 
187:     }
188: 
189:     public function canInputShipping()
190:     {
191: 
192:     }
193: 
194:     public function canSeeOverview()
195:     {
196: 
197:     }
198: 
199:     public function canSuccess()
200:     {
201: 
202:     }
203: 
204:     /**
205:      * Retrieve checkout session
206:      *
207:      * @return Mage_Checkout_Model_Session
208:      */
209:     public function getCheckoutSession()
210:     {
211:         return Mage::getSingleton('checkout/session');
212:     }
213: }
214: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0