Public Member Functions | |
__construct () | |
getProduct () | |
render (Varien_Data_Form_Element_Abstract $element) | |
setElement (Varien_Data_Form_Element_Abstract $element) | |
getElement () | |
getValues () | |
getWebsiteCount () | |
isMultiWebsites () | |
getCountries () | |
getWebsites () | |
getAddButtonHtml () | |
Protected Member Functions | |
_sortWeeeTaxes ($a, $b) | |
_setAddButton () | |
Protected Attributes | |
$_element = null | |
$_countries = null | |
$_websites = null |
Definition at line 34 of file Tax.php.
__construct | ( | ) |
Constructor
By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes
Reimplemented from Varien_Object.
Definition at line 41 of file Tax.php.
_setAddButton | ( | ) | [protected] |
Definition at line 146 of file Tax.php.
00147 { 00148 $this->setChild('add_button', 00149 $this->getLayout()->createBlock('adminhtml/widget_button') 00150 ->setData(array( 00151 'label' => Mage::helper('catalog')->__('Add Tax'), 00152 'onclick' => "weeeTaxControl.addItem('".$this->getElement()->getHtmlId()."')", 00153 'class' => 'add' 00154 ))); 00155 }
_sortWeeeTaxes | ( | $ | a, | |
$ | b | |||
) | [protected] |
getAddButtonHtml | ( | ) |
Definition at line 157 of file Tax.php.
00158 { 00159 return $this->getChildHtml('add_button'); 00160 }
getCountries | ( | ) |
Definition at line 102 of file Tax.php.
00103 { 00104 if (is_null($this->_countries)) { 00105 $this->_countries = Mage::getModel('adminhtml/system_config_source_country') 00106 ->toOptionArray(); 00107 } 00108 00109 return $this->_countries; 00110 }
getProduct | ( | ) |
getValues | ( | ) |
getWebsiteCount | ( | ) |
getWebsites | ( | ) |
Definition at line 112 of file Tax.php.
00113 { 00114 if (!is_null($this->_websites)) { 00115 return $this->_websites; 00116 } 00117 $websites = array(); 00118 $websites[0] = array( 00119 'name' => $this->__('All Websites'), 00120 'currency' => Mage::app()->getBaseCurrencyCode() 00121 ); 00122 00123 if (!Mage::app()->isSingleStoreMode() && !$this->getElement()->getEntityAttribute()->isScopeGlobal()) { 00124 if ($storeId = $this->getProduct()->getStoreId()) { 00125 $website = Mage::app()->getStore($storeId)->getWebsite(); 00126 $websites[$website->getId()] = array( 00127 'name' => $website->getName(), 00128 'currency' => $website->getConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE), 00129 ); 00130 } else { 00131 foreach (Mage::app()->getWebsites() as $website) { 00132 if (!in_array($website->getId(), $this->getProduct()->getWebsiteIds())) { 00133 continue; 00134 } 00135 $websites[$website->getId()] = array( 00136 'name' => $website->getName(), 00137 'currency' => $website->getConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE), 00138 ); 00139 } 00140 } 00141 } 00142 $this->_websites = $websites; 00143 return $this->_websites; 00144 }
isMultiWebsites | ( | ) |
render | ( | Varien_Data_Form_Element_Abstract $ | element | ) |
Implements Varien_Data_Form_Element_Renderer_Interface.
Definition at line 51 of file Tax.php.
00052 { 00053 $this->setElement($element); 00054 $this->_setAddButton(); 00055 return $this->toHtml(); 00056 }
setElement | ( | Varien_Data_Form_Element_Abstract $ | element | ) |