*/ class Mage_Adminhtml_Block_Sales_Order_Abstract extends Mage_Adminhtml_Block_Widget { /** * Retrieve available order * * @return Mage_Sales_Model_Order */ public function getOrder() { if ($this->hasOrder()) { return $this->getData('order'); } if (Mage::registry('current_order')) { return Mage::registry('current_order'); } if (Mage::registry('order')) { return Mage::registry('order'); } Mage::throwException(Mage::helper('sales')->__('Cannot get order instance')); } public function getPriceDataObject() { $obj = $this->getData('price_data_object'); if (is_null($obj)) { return $this->getOrder(); } return $obj; } public function displayPriceAttribute($code, $strong = false, $separator = '
') { return $this->helper('adminhtml/sales')->displayPriceAttribute($this->getPriceDataObject(), $code, $strong, $separator); } public function displayPrices($basePrice, $price, $strong = false, $separator = '
') { return $this->helper('adminhtml/sales')->displayPrices($this->getPriceDataObject(), $basePrice, $price, $strong, $separator); } /** * Retrieve order totals block settings * * @return array */ public function getOrderTotalData() { return array(); } /** * Retrieve order info block settings * * @return array */ public function getOrderInfoData() { return array(); } /** * Retrieve subtotal price include tax html formated content * * @param Varien_Object $item * @return string */ public function displayShippingPriceInclTax($order) { $shipping = $order->getShippingInclTax(); if ($shipping) { $baseShipping = $order->getBaseShippingInclTax(); } else { $shipping = $order->getShippingAmount()+$order->getShippingTaxAmount(); $baseShipping = $order->getBaseShippingAmount()+$order->getBaseShippingTaxAmount(); } return $this->displayPrices($baseShipping, $shipping, false, ' '); } }