Public Member Functions | |
addTotal ($label, $value, $isQuantity=false) | |
format ($price) | |
setCurrency ($currency) | |
getCurrency () | |
Protected Member Functions | |
_construct () | |
getTotals () | |
Protected Attributes | |
$_totals = array() | |
$_currentCurrencyCode = null |
Definition at line 35 of file Bar.php.
_construct | ( | ) | [protected] |
Internal constructor, that is called from real constructor
Please override this one instead of overriding real __construct constructor
Please override this one instead of overriding real __construct constructor
Reimplemented from Mage_Core_Block_Abstract.
Reimplemented in Mage_Adminhtml_Block_Dashboard_Sales, and Mage_Adminhtml_Block_Dashboard_Totals.
Definition at line 40 of file Bar.php.
00041 { 00042 parent::_construct(); 00043 $this->setTemplate('dashboard/bar.phtml'); 00044 }
addTotal | ( | $ | label, | |
$ | value, | |||
$ | isQuantity = false | |||
) |
Definition at line 51 of file Bar.php.
00052 { 00053 /*if (!$isQuantity) { 00054 $value = $this->format($value); 00055 $decimals = substr($value, -2); 00056 $value = substr($value, 0, -2); 00057 } else { 00058 $value = ($value != '')?$value:0; 00059 $decimals = ''; 00060 }*/ 00061 if (!$isQuantity) { 00062 $value = $this->format($value); 00063 } 00064 $decimals = ''; 00065 $this->_totals[] = array( 00066 'label' => $label, 00067 'value' => $value, 00068 'decimals' => $decimals, 00069 ); 00070 00071 return $this; 00072 }
format | ( | $ | price | ) |
Formating value specific for this store
decimal | $price |
Definition at line 80 of file Bar.php.
00081 { 00082 return $this->getCurrency()->format($price); 00083 }
getCurrency | ( | ) |
Retrieve currency model if not set then return currency model for current store
Definition at line 100 of file Bar.php.
00101 { 00102 if (is_null($this->_currentCurrencyCode)) { 00103 if ($this->getRequest()->getParam('store')) { 00104 $this->_currentCurrencyCode = Mage::app()->getStore($this->getRequest()->getParam('store'))->getBaseCurrency(); 00105 } else if ($this->getRequest()->getParam('website')){ 00106 $this->_currentCurrencyCode = Mage::app()->getWebsite($this->getRequest()->getParam('website'))->getBaseCurrency(); 00107 } else if ($this->getRequest()->getParam('group')){ 00108 $this->_currentCurrencyCode = Mage::app()->getGroup($this->getRequest()->getParam('group'))->getWebsite()->getBaseCurrency(); 00109 } else { 00110 $this->_currentCurrencyCode = Mage::app()->getStore()->getBaseCurrency(); 00111 } 00112 } 00113 00114 return $this->_currentCurrencyCode; 00115 }
getTotals | ( | ) | [protected] |
setCurrency | ( | $ | currency | ) |
Setting currency model
Mage_Directory_Model_Currency | $currency |
Definition at line 90 of file Bar.php.