Public Member Functions | |
__construct ($attributes=array()) | |
getAfterElementHtml () | |
getEscapedValue ($index=null) | |
Protected Member Functions | |
_getTaxObservingCode ($attribute) |
Definition at line 34 of file Price.php.
__construct | ( | $ | attributes = array() |
) |
Enter description here...
array | $attributes |
Reimplemented from Varien_Data_Form_Element_Text.
Definition at line 37 of file Price.php.
00038 { 00039 parent::__construct($attributes); 00040 $this->addClass('validate-zero-or-greater'); 00041 }
_getTaxObservingCode | ( | $ | attribute | ) | [protected] |
Definition at line 70 of file Price.php.
00071 { 00072 $spanId = "dynamic-tax-{$attribute->getAttributeCode()}"; 00073 00074 $html = "<script>if (dynamicTaxes == undefined) var dynamicTaxes = new Array(); dynamicTaxes[dynamicTaxes.length]='{$attribute->getAttributeCode()}'</script>"; 00075 return $html; 00076 }
getAfterElementHtml | ( | ) |
getEntityAttribute - use __call
Reimplemented from Varien_Data_Form_Element_Abstract.
Definition at line 43 of file Price.php.
00044 { 00045 $html = parent::getAfterElementHtml(); 00046 /** 00047 * getEntityAttribute - use __call 00048 */ 00049 $addJsObserver = false; 00050 if ($attribute = $this->getEntityAttribute()) { 00051 if (!($storeId = $attribute->getStoreId())) { 00052 $storeId = $this->getForm()->getDataObject()->getStoreId(); 00053 } 00054 $store = Mage::app()->getStore($storeId); 00055 $html.= '<strong>['.(string)$store->getBaseCurrencyCode().']</strong>'; 00056 if (Mage::helper('tax')->priceIncludesTax()) { 00057 if ($attribute->getAttributeCode()!=='cost') { 00058 $addJsObserver = true; 00059 $html.= ' <strong>['.Mage::helper('tax')->__('Inc. Tax').'<span id="dynamic-tax-'.$attribute->getAttributeCode().'"></span>]</strong>'; 00060 } 00061 } 00062 } 00063 if ($addJsObserver) { 00064 $html .= $this->_getTaxObservingCode($attribute); 00065 } 00066 00067 return $html; 00068 }
getEscapedValue | ( | $ | index = null |
) |
Reimplemented from Varien_Data_Form_Element_Abstract.
Definition at line 78 of file Price.php.
00079 { 00080 $value = $this->getValue(); 00081 00082 if (!is_numeric($value)) { 00083 return null; 00084 } 00085 00086 return number_format($value, 2, null, ''); 00087 }