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 overview information
 29:  *
 30:  * @category   Mage
 31:  * @package    Mage_Checkout
 32:  * @author      Magento Core Team <core@magentocommerce.com>
 33:  */
 34: class Mage_Checkout_Block_Multishipping_Overview extends Mage_Sales_Block_Items_Abstract
 35: {
 36:     /**
 37:      * Initialize default item renderer for row-level items output
 38:      */
 39:     protected function _construct()
 40:     {
 41:         parent::_construct();
 42:         $this->addItemRender(
 43:             $this->_getRowItemType('default'),
 44:             'checkout/cart_item_renderer',
 45:             'checkout/multishipping/overview/item.phtml'
 46:         );
 47:     }
 48: 
 49:     /**
 50:      * Get multishipping checkout model
 51:      *
 52:      * @return Mage_Checkout_Model_Type_Multishipping
 53:      */
 54:     public function getCheckout()
 55:     {
 56:         return Mage::getSingleton('checkout/type_multishipping');
 57:     }
 58: 
 59:     protected function _prepareLayout()
 60:     {
 61:         if ($headBlock = $this->getLayout()->getBlock('head')) {
 62:             $headBlock->setTitle(
 63:                 $this->__('Review Order - %s', $headBlock->getDefaultTitle())
 64:             );
 65:         }
 66:         return parent::_prepareLayout();
 67:     }
 68: 
 69:     public function getBillingAddress()
 70:     {
 71:         return $this->getCheckout()->getQuote()->getBillingAddress();
 72:     }
 73: 
 74:     public function getPaymentHtml()
 75:     {
 76:         return $this->getChildHtml('payment_info');
 77:     }
 78: 
 79:     /**
 80:      * Get object with payment info posted data
 81:      *
 82:      * @return Varien_Object
 83:      */
 84:     public function getPayment()
 85:     {
 86:         if (!$this->hasData('payment')) {
 87:             $payment = new Varien_Object($this->getRequest()->getPost('payment'));
 88:             $this->setData('payment', $payment);
 89:         }
 90:         return $this->_getData('payment');
 91:         //return $this->getCheckout()->getQuote()->getPayment();
 92:     }
 93: 
 94:     public function getShippingAddresses()
 95:     {
 96:         return $this->getCheckout()->getQuote()->getAllShippingAddresses();
 97:     }
 98: 
 99:     public function getShippingAddressCount()
100:     {
101:         $count = $this->getData('shipping_address_count');
102:         if (is_null($count)) {
103:             $count = count($this->getShippingAddresses());
104:             $this->setData('shipping_address_count', $count);
105:         }
106:         return $count;
107:     }
108: 
109:     public function getShippingAddressRate($address)
110:     {
111:         if ($rate = $address->getShippingRateByCode($address->getShippingMethod())) {
112:             return $rate;
113:         }
114:         return false;
115:     }
116: 
117:     public function getShippingPriceInclTax($address)
118:     {
119:         $exclTax = $address->getShippingAmount();
120:         $taxAmount = $address->getShippingTaxAmount();
121:         return $this->formatPrice($exclTax + $taxAmount);
122:     }
123: 
124:     public function getShippingPriceExclTax($address)
125:     {
126:         return $this->formatPrice($address->getShippingAmount());
127:     }
128: 
129:     public function formatPrice($price)
130:     {
131:         return $this->getQuote()->getStore()->formatPrice($price);
132:     }
133: 
134:     public function getShippingAddressItems($address)
135:     {
136:         return $address->getAllVisibleItems();
137:     }
138: 
139:     public function getShippingAddressTotals($address)
140:     {
141:         $totals = $address->getTotals();
142:         foreach ($totals as $total) {
143:             if ($total->getCode()=='grand_total') {
144:                 if ($address->getAddressType() == Mage_Sales_Model_Quote_Address::TYPE_BILLING) {
145:                     $total->setTitle($this->__('Total'));
146:                 }
147:                 else {
148:                     $total->setTitle($this->__('Total for this address'));
149:                 }
150:             }
151:         }
152:         return $totals;
153:     }
154: 
155:     public function getTotal()
156:     {
157:         return $this->getCheckout()->getQuote()->getGrandTotal();
158:     }
159: 
160:     public function getAddressesEditUrl()
161:     {
162:         return $this->getUrl('*/*/backtoaddresses');
163:     }
164: 
165:     public function getEditShippingAddressUrl($address)
166:     {
167:         return $this->getUrl('*/multishipping_address/editShipping', array('id'=>$address->getCustomerAddressId()));
168:     }
169: 
170:     public function getEditBillingAddressUrl($address)
171:     {
172:         return $this->getUrl('*/multishipping_address/editBilling', array('id'=>$address->getCustomerAddressId()));
173:     }
174: 
175:     public function getEditShippingUrl()
176:     {
177:         return $this->getUrl('*/*/backtoshipping');
178:     }
179: 
180:     public function getPostActionUrl()
181:     {
182:         return $this->getUrl('*/*/overviewPost');
183:     }
184: 
185:     public function getEditBillingUrl()
186:     {
187:         return $this->getUrl('*/*/backtobilling');
188:     }
189: 
190:     public function getBackUrl()
191:     {
192:         return $this->getUrl('*/*/backtobilling');
193:     }
194: 
195:     /**
196:      * Retrieve virtual product edit url
197:      *
198:      * @return string
199:      */
200:     public function getVirtualProductEditUrl()
201:     {
202:         return $this->getUrl('*/cart');
203:     }
204: 
205:     /**
206:      * Retrieve virtual product collection array
207:      *
208:      * @return array
209:      */
210:     public function getVirtualItems()
211:     {
212:         $items = array();
213:         foreach ($this->getBillingAddress()->getItemsCollection() as $_item) {
214:             if ($_item->isDeleted()) {
215:                 continue;
216:             }
217:             if ($_item->getProduct()->getIsVirtual() && !$_item->getParentItemId()) {
218:                 $items[] = $_item;
219:             }
220:         }
221:         return $items;
222:     }
223: 
224:     /**
225:      * Retrieve quote
226:      *
227:      * @return Mage_Sales_Model_Qoute
228:      */
229:     public function getQuote()
230:     {
231:         return $this->getCheckout()->getQuote();
232:     }
233: 
234:     public function getBillinAddressTotals()
235:     {
236:         $_address = $this->getQuote()->getBillingAddress();
237:         return $this->getShippingAddressTotals($_address);
238:     }
239: 
240: 
241:     public function renderTotals($totals, $colspan=null)
242:     {
243:         if ($colspan === null) {
244:             $colspan = $this->helper('tax')->displayCartBothPrices() ? 5 : 3;
245:         }
246:         $totals = $this->getChild('totals')->setTotals($totals)->renderTotals('', $colspan)
247:             . $this->getChild('totals')->setTotals($totals)->renderTotals('footer', $colspan);
248:         return $totals;
249:     }
250: 
251:     /**
252:      * Add renderer for row-level item output
253:      *
254:      * @param   string $type Product type
255:      * @param   string $block Block type
256:      * @param   string $template Block template
257:      * @return  Mage_Checkout_Block_Multishipping_Overview
258:      */
259:     public function addRowItemRender($type, $block, $template)
260:     {
261:         $type = $this->_getRowItemType($type);
262:         parent::addItemRender($this->_getRowItemType($type), $block, $template);
263:         return $this;
264:     }
265: 
266:     /**
267:      * Return row-level item html
268:      *
269:      * @param Varien_Object $item
270:      * @return string
271:      */
272:     public function getRowItemHtml(Varien_Object $item)
273:     {
274:         $type = $this->_getItemType($item);
275:         $block = $this->_getRowItemRenderer($type)
276:             ->setItem($item);
277:         $this->_prepareItem($block);
278:         return $block->toHtml();
279:     }
280: 
281:     /**
282:      * Retrieve renderer block for row-level item output
283:      *
284:      * @param string $type
285:      * @return Mage_Core_Block_Abstract
286:      */
287:     public function _getRowItemRenderer($type)
288:     {
289:         $type = $this->_getRowItemType($type);
290:         $type = isset($this->_itemRenders[$type]) ? $type : $this->_getRowItemType('default');
291:         return parent::getItemRenderer($type);
292:     }
293: 
294:     /**
295:      * Wrap row renderers into namespace by adding 'row_' suffix
296:      *
297:      * @param string $type Product type
298:      * @return string
299:      */
300:     protected function _getRowItemType($type)
301:     {
302:         return 'row_' . $type;
303:     }
304: }
305: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0