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:  * Bundle product attributes tab
 29:  *
 30:  * @category    Mage
 31:  * @package     Mage_Bundle
 32:  * @author      Magento Core Team <core@magentocommerce.com>
 33:  */
 34: class Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Attributes
 35:     extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes
 36: {
 37:     /**
 38:      * Prepare attributes form of bundle product
 39:      *
 40:      * @return void
 41:      */
 42:     protected function _prepareForm()
 43:     {
 44:         parent::_prepareForm();
 45: 
 46:         $special_price = $this->getForm()->getElement('special_price');
 47:         if ($special_price) {
 48:             $special_price->setRenderer(
 49:                 $this->getLayout()->createBlock('bundle/adminhtml_catalog_product_edit_tab_attributes_special')
 50:                     ->setDisableChild(false)
 51:             );
 52:         }
 53: 
 54:         $sku = $this->getForm()->getElement('sku');
 55:         if ($sku) {
 56:             $sku->setRenderer(
 57:                 $this->getLayout()->createBlock('bundle/adminhtml_catalog_product_edit_tab_attributes_extend')
 58:                     ->setDisableChild(false)
 59:             );
 60:         }
 61: 
 62:         $price = $this->getForm()->getElement('price');
 63:         if ($price) {
 64:             $price->setRenderer(
 65:                 $this->getLayout()->createBlock('bundle/adminhtml_catalog_product_edit_tab_attributes_extend',
 66:                     'adminhtml.catalog.product.bundle.edit.tab.attributes.price')->setDisableChild(true)
 67:             );
 68:         }
 69: 
 70:         $tax = $this->getForm()->getElement('tax_class_id');
 71:         if ($tax) {
 72:             $tax->setAfterElementHtml(
 73:                 '<script type="text/javascript">'
 74:                 . "
 75:                 //<![CDATA[
 76:                 function changeTaxClassId() {
 77:                     if ($('price_type').value == '" . Mage_Bundle_Model_Product_Price::PRICE_TYPE_DYNAMIC . "') {
 78:                         $('tax_class_id').disabled = true;
 79:                         $('tax_class_id').value = '0';
 80:                         $('tax_class_id').removeClassName('required-entry');
 81:                         if ($('advice-required-entry-tax_class_id')) {
 82:                             $('advice-required-entry-tax_class_id').remove();
 83:                         }
 84:                     } else {
 85:                         $('tax_class_id').disabled = false;
 86:                         " . ($tax->getRequired() ? "$('tax_class_id').addClassName('required-entry');" : '') . "
 87:                     }
 88:                 }
 89: 
 90:                 document.observe('dom:loaded', function() {
 91:                     if ($('price_type')) {
 92:                         $('price_type').observe('change', changeTaxClassId);
 93:                         changeTaxClassId();
 94:                     }
 95:                 });
 96:                 //]]>
 97:                 "
 98:                 . '</script>'
 99:             );
100:         }
101: 
102:         $weight = $this->getForm()->getElement('weight');
103:         if ($weight) {
104:             $weight->setRenderer(
105:                 $this->getLayout()->createBlock('bundle/adminhtml_catalog_product_edit_tab_attributes_extend')
106:                     ->setDisableChild(true)
107:             );
108:         }
109: 
110:         $tier_price = $this->getForm()->getElement('tier_price');
111:         if ($tier_price) {
112:             $tier_price->setRenderer(
113:                 $this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_price_tier')
114:                     ->setPriceColumnHeader(Mage::helper('bundle')->__('Percent Discount'))
115:                     ->setPriceValidation('validate-greater-than-zero validate-percents')
116:             );
117:         }
118: 
119:         $groupPrice = $this->getForm()->getElement('group_price');
120:         if ($groupPrice) {
121:             $groupPrice->setRenderer(
122:                 $this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_price_group')
123:                     ->setPriceColumnHeader(Mage::helper('bundle')->__('Percent Discount'))
124:                     ->setPriceValidation('validate-greater-than-zero validate-percents')
125:             );
126:         }
127: 
128:         $mapEnabled = $this->getForm()->getElement('msrp_enabled');
129:         if ($mapEnabled && $this->getCanEditPrice() !== false) {
130:             $mapEnabled->setAfterElementHtml(
131:                 '<script type="text/javascript">'
132:                 . "
133:                 function changePriceTypeMap() {
134:                     if ($('price_type').value == " . Mage_Bundle_Model_Product_Price::PRICE_TYPE_DYNAMIC . ") {
135:                         $('msrp_enabled').setValue("
136:                         . Mage_Catalog_Model_Product_Attribute_Source_Msrp_Type_Enabled::MSRP_ENABLE_NO
137:                         . ");
138:                         $('msrp_enabled').disable();
139:                         $('msrp_display_actual_price_type').setValue("
140:                         . Mage_Catalog_Model_Product_Attribute_Source_Msrp_Type_Price::TYPE_USE_CONFIG
141:                         . ");
142:                         $('msrp_display_actual_price_type').disable();
143:                         $('msrp').setValue('');
144:                         $('msrp').disable();
145:                     } else {
146:                         $('msrp_enabled').enable();
147:                         $('msrp_display_actual_price_type').enable();
148:                         $('msrp').enable();
149:                     }
150:                 }
151:                 document.observe('dom:loaded', function() {
152:                     $('price_type').observe('change', changePriceTypeMap);
153:                     changePriceTypeMap();
154:                 });
155:                 "
156:                 . '</script>'
157:             );
158:         }
159:     }
160: 
161:     /**
162:      * Get current product from registry
163:      *
164:      * @return Mage_Catalog_Model_Product
165:      */
166:     public function getProduct()
167:     {
168:         if (!$this->getData('product')){
169:             $this->setData('product', Mage::registry('product'));
170:         }
171:         return $this->getData('product');
172:     }
173: }
174: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0