*/ class Mage_Adminhtml_Block_Sales_Order_Totalbar extends Mage_Adminhtml_Block_Sales_Order_Abstract { protected $_totals = array(); /** * Retrieve required options from parent */ protected function _beforeToHtml() { if (!$this->getParentBlock()) { Mage::throwException(Mage::helper('adminhtml')->__('Invalid parent block for this block.')); } $this->setOrder($this->getParentBlock()->getOrder()); $this->setSource($this->getParentBlock()->getSource()); $this->setCurrency($this->getParentBlock()->getOrder()->getOrderCurrency()); foreach ($this->getParentBlock()->getOrderTotalbarData() as $v) { $this->addTotal($v[0], $v[1], $v[2]); } parent::_beforeToHtml(); } protected function getTotals() { return $this->_totals; } public function addTotal($label, $value, $grand = false) { $this->_totals[] = array( 'label' => $label, 'value' => $value, 'grand' => $grand ); return $this; } }