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:  * One page checkout status
 29:  *
 30:  * @category   Mage
 31:  * @category   Mage
 32:  * @package    Mage_Checkout
 33:  * @author      Magento Core Team <core@magentocommerce.com>
 34:  */
 35: class Mage_Checkout_Block_Onepage_Billing extends Mage_Checkout_Block_Onepage_Abstract
 36: {
 37:     /**
 38:      * Sales Qoute Billing Address instance
 39:      *
 40:      * @var Mage_Sales_Model_Quote_Address
 41:      */
 42:     protected $_address;
 43: 
 44:     /**
 45:      * Customer Taxvat Widget block
 46:      *
 47:      * @var Mage_Customer_Block_Widget_Taxvat
 48:      */
 49:     protected $_taxvat;
 50: 
 51:     /**
 52:      * Initialize billing address step
 53:      *
 54:      */
 55:     protected function _construct()
 56:     {
 57:         $this->getCheckout()->setStepData('billing', array(
 58:             'label'     => Mage::helper('checkout')->__('Billing Information'),
 59:             'is_show'   => $this->isShow()
 60:         ));
 61: 
 62:         if ($this->isCustomerLoggedIn()) {
 63:             $this->getCheckout()->setStepData('billing', 'allow', true);
 64:         }
 65:         parent::_construct();
 66:     }
 67: 
 68:     public function isUseBillingAddressForShipping()
 69:     {
 70:         if (($this->getQuote()->getIsVirtual())
 71:             || !$this->getQuote()->getShippingAddress()->getSameAsBilling()) {
 72:             return false;
 73:         }
 74:         return true;
 75:     }
 76: 
 77:     /**
 78:      * Return country collection
 79:      *
 80:      * @return Mage_Directory_Model_Mysql4_Country_Collection
 81:      */
 82:     public function getCountries()
 83:     {
 84:         return Mage::getResourceModel('directory/country_collection')->loadByStore();
 85:     }
 86: 
 87:     /**
 88:      * Return checkout method
 89:      *
 90:      * @return string
 91:      */
 92:     public function getMethod()
 93:     {
 94:         return $this->getQuote()->getCheckoutMethod();
 95:     }
 96: 
 97:     /**
 98:      * Return Sales Quote Address model
 99:      *
100:      * @return Mage_Sales_Model_Quote_Address
101:      */
102:     public function getAddress()
103:     {
104:         if (is_null($this->_address)) {
105:             if ($this->isCustomerLoggedIn()) {
106:                 $this->_address = $this->getQuote()->getBillingAddress();
107:                 if(!$this->_address->getFirstname()) {
108:                     $this->_address->setFirstname($this->getQuote()->getCustomer()->getFirstname());
109:                 }
110:                 if(!$this->_address->getLastname()) {
111:                     $this->_address->setLastname($this->getQuote()->getCustomer()->getLastname());
112:                 }
113:             } else {
114:                 $this->_address = Mage::getModel('sales/quote_address');
115:             }
116:         }
117: 
118:         return $this->_address;
119:     }
120: 
121:     /**
122:      * Return Customer Address First Name
123:      * If Sales Quote Address First Name is not defined - return Customer First Name
124:      *
125:      * @return string
126:      */
127:     public function getFirstname()
128:     {
129:         $firstname = $this->getAddress()->getFirstname();
130:         if (empty($firstname) && $this->getQuote()->getCustomer()) {
131:             return $this->getQuote()->getCustomer()->getFirstname();
132:         }
133:         return $firstname;
134:     }
135: 
136:     /**
137:      * Return Customer Address Last Name
138:      * If Sales Quote Address Last Name is not defined - return Customer Last Name
139:      *
140:      * @return string
141:      */
142:     public function getLastname()
143:     {
144:         $lastname = $this->getAddress()->getLastname();
145:         if (empty($lastname) && $this->getQuote()->getCustomer()) {
146:             return $this->getQuote()->getCustomer()->getLastname();
147:         }
148:         return $lastname;
149:     }
150: 
151:     /**
152:      * Check is Quote items can ship to
153:      *
154:      * @return boolean
155:      */
156:     public function canShip()
157:     {
158:         return !$this->getQuote()->isVirtual();
159:     }
160: 
161:     public function getSaveUrl()
162:     {
163:     }
164: 
165:     /**
166:      * Get Customer Taxvat Widget block
167:      *
168:      * @return Mage_Customer_Block_Widget_Taxvat
169:      */
170:     protected function _getTaxvat()
171:     {
172:         if (!$this->_taxvat) {
173:             $this->_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat');
174:         }
175: 
176:         return $this->_taxvat;
177:     }
178: 
179:     /**
180:      * Check whether taxvat is enabled
181:      *
182:      * @return bool
183:      */
184:     public function isTaxvatEnabled()
185:     {
186:         return $this->_getTaxvat()->isEnabled();
187:     }
188: 
189:     public function getTaxvatHtml()
190:     {
191:         return $this->_getTaxvat()
192:             ->setTaxvat($this->getQuote()->getCustomerTaxvat())
193:             ->setFieldIdFormat('billing:%s')
194:             ->setFieldNameFormat('billing[%s]')
195:             ->toHtml();
196:     }
197: }
198: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0