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_Bundle_Adminhtml_Bundle_Product_EditController
  • Mage_Bundle_Adminhtml_Bundle_SelectionController
  • Mage_Bundle_Block_Adminhtml_Catalog_Product_Composite_Fieldset_Options_Type_Checkbox
  • Mage_Bundle_Block_Adminhtml_Catalog_Product_Composite_Fieldset_Options_Type_Multi
  • Mage_Bundle_Block_Adminhtml_Catalog_Product_Composite_Fieldset_Options_Type_Radio
  • Mage_Bundle_Block_Adminhtml_Catalog_Product_Composite_Fieldset_Options_Type_Select
  • Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Attributes
  • Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Attributes_Extend
  • Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Attributes_Special
  • Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle
  • Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle_Option
  • Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle_Option_Search
  • Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle_Option_Search_Grid
  • Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle_Option_Selection
  • Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tabs
  • Mage_Bundle_Block_Adminhtml_Sales_Order_Items_Renderer
  • Mage_Bundle_Block_Adminhtml_Sales_Order_View_Items_Renderer
  • Mage_Bundle_Block_Catalog_Product_List_Partof
  • Mage_Bundle_Block_Catalog_Product_Price
  • Mage_Bundle_Block_Catalog_Product_View
  • Mage_Bundle_Block_Catalog_Product_View_Type_Bundle
  • Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option
  • Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Checkbox
  • Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Multi
  • Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Radio
  • Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Select
  • Mage_Bundle_Block_Checkout_Cart_Item_Renderer
  • Mage_Bundle_Block_Sales_Order_Items_Renderer
  • Mage_Bundle_Helper_Catalog_Product_Configuration
  • Mage_Bundle_Helper_Data
  • Mage_Bundle_Model_CatalogIndex_Data_Bundle
  • Mage_Bundle_Model_Mysql4_Bundle
  • Mage_Bundle_Model_Mysql4_Indexer_Price
  • Mage_Bundle_Model_Mysql4_Indexer_Stock
  • Mage_Bundle_Model_Mysql4_Option
  • Mage_Bundle_Model_Mysql4_Option_Collection
  • Mage_Bundle_Model_Mysql4_Price_Index
  • Mage_Bundle_Model_Mysql4_Selection
  • Mage_Bundle_Model_Mysql4_Selection_Collection
  • Mage_Bundle_Model_Observer
  • Mage_Bundle_Model_Option
  • Mage_Bundle_Model_Price_Index
  • Mage_Bundle_Model_Product_Attribute_Source_Price_View
  • Mage_Bundle_Model_Product_Price
  • Mage_Bundle_Model_Product_Type
  • Mage_Bundle_Model_Resource_Bundle
  • Mage_Bundle_Model_Resource_Indexer_Price
  • Mage_Bundle_Model_Resource_Indexer_Stock
  • Mage_Bundle_Model_Resource_Option
  • Mage_Bundle_Model_Resource_Option_Collection
  • Mage_Bundle_Model_Resource_Price_Index
  • Mage_Bundle_Model_Resource_Selection
  • Mage_Bundle_Model_Resource_Selection_Collection
  • Mage_Bundle_Model_Sales_Order_Pdf_Items_Abstract
  • Mage_Bundle_Model_Sales_Order_Pdf_Items_Shipment
  • Mage_Bundle_Model_Selection
  • Mage_Bundle_Model_Source_Option_Selection_Price_Type
  • Mage_Bundle_Model_Source_Option_Type
  • 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_Bundle
 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: /**
 29:  * Adminhtml sales order item renderer
 30:  *
 31:  * @category    Mage
 32:  * @package     Mage_Bundle
 33:  * @author      Magento Core Team <core@magentocommerce.com>
 34:  */
 35: class Mage_Bundle_Block_Adminhtml_Sales_Order_View_Items_Renderer extends Mage_Adminhtml_Block_Sales_Order_View_Items_Renderer_Default
 36: {
 37:     public function isShipmentSeparately($item = null)
 38:     {
 39:         if ($item) {
 40:             if ($parentItem = $item->getParentItem()) {
 41:                 if ($options = $parentItem->getProductOptions()) {
 42:                     if (isset($options['shipment_type']) && $options['shipment_type'] == Mage_Catalog_Model_Product_Type_Abstract::SHIPMENT_SEPARATELY) {
 43:                         return true;
 44:                     } else {
 45:                         return false;
 46:                     }
 47:                 }
 48:             } else {
 49:                 if ($options = $item->getProductOptions()) {
 50:                     if (isset($options['shipment_type']) && $options['shipment_type'] == Mage_Catalog_Model_Product_Type_Abstract::SHIPMENT_SEPARATELY) {
 51:                         return false;
 52:                     } else {
 53:                         return true;
 54:                     }
 55:                 }
 56:             }
 57:         }
 58: 
 59:         if ($options = $this->getOrderItem()->getProductOptions()) {
 60:             if (isset($options['shipment_type']) && $options['shipment_type'] == Mage_Catalog_Model_Product_Type_Abstract::SHIPMENT_SEPARATELY) {
 61:                 return true;
 62:             }
 63:         }
 64:         return false;
 65:     }
 66: 
 67:     public function isChildCalculated($item = null)
 68:     {
 69:         if ($item) {
 70:             if ($parentItem = $item->getParentItem()) {
 71:                 if ($options = $parentItem->getProductOptions()) {
 72:                     if (isset($options['product_calculations']) && $options['product_calculations'] == Mage_Catalog_Model_Product_Type_Abstract::CALCULATE_CHILD) {
 73:                         return true;
 74:                     } else {
 75:                         return false;
 76:                     }
 77:                 }
 78:             } else {
 79:                 if ($options = $item->getProductOptions()) {
 80:                     if (isset($options['product_calculations']) && $options['product_calculations'] == Mage_Catalog_Model_Product_Type_Abstract::CALCULATE_CHILD) {
 81:                         return false;
 82:                     } else {
 83:                         return true;
 84:                     }
 85:                 }
 86:             }
 87:         }
 88: 
 89:         if ($options = $this->getItem()->getProductOptions()) {
 90:             if (isset($options['product_calculations'])
 91:                 && $options['product_calculations'] == Mage_Catalog_Model_Product_Type_Abstract::CALCULATE_CHILD) {
 92:                 return true;
 93:             }
 94:         }
 95:         return false;
 96:     }
 97: 
 98:     public function getSelectionAttributes($item) {
 99:         if ($item instanceof Mage_Sales_Model_Order_Item) {
100:             $options = $item->getProductOptions();
101:         } else {
102:             $options = $item->getOrderItem()->getProductOptions();
103:         }
104:         if (isset($options['bundle_selection_attributes'])) {
105:             return unserialize($options['bundle_selection_attributes']);
106:         }
107:         return null;
108:     }
109: 
110:     public function getOrderOptions()
111:     {
112:         $result = array();
113:         if ($options = $this->getItem()->getProductOptions()) {
114:             if (isset($options['options'])) {
115:                 $result = array_merge($result, $options['options']);
116:             }
117:             if (isset($options['additional_options'])) {
118:                 $result = array_merge($result, $options['additional_options']);
119:             }
120:             if (!empty($options['attributes_info'])) {
121:                 $result = array_merge($options['attributes_info'], $result);
122:             }
123:         }
124:         return $result;
125:     }
126: 
127:     public function getValueHtml($item)
128:     {
129:         $result = $this->htmlEscape($item->getName());
130:         if (!$this->isShipmentSeparately($item)) {
131:             if ($attributes = $this->getSelectionAttributes($item)) {
132:                 $result =  sprintf('%d', $attributes['qty']) . ' x ' . $result;
133:             }
134:         }
135:         if (!$this->isChildCalculated($item)) {
136:             if ($attributes = $this->getSelectionAttributes($item)) {
137:                 $result .= " " . $this->getItem()->getOrder()->formatPrice($attributes['price']);
138:             }
139:         }
140:         return $result;
141:     }
142: 
143:     public function canShowPriceInfo($item)
144:     {
145:         if (($item->getParentItem() && $this->isChildCalculated())
146:                 || (!$item->getParentItem() && !$this->isChildCalculated())) {
147:             return true;
148:         }
149:         return false;
150:     }
151: }
152: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0