*/ class Mage_Sales_Block_Order_Print_Invoice extends Mage_Sales_Block_Items_Abstract { protected function _prepareLayout() { if ($headBlock = $this->getLayout()->getBlock('head')) { $headBlock->setTitle($this->__('Order # %s', $this->getOrder()->getRealOrderId())); } $this->setChild( 'payment_info', $this->helper('payment')->getInfoBlock($this->getOrder()->getPayment()) ); } public function getBackUrl() { return Mage::getUrl('*/*/history'); } public function getPrintUrl() { return Mage::getUrl('*/*/print'); } public function getPaymentInfoHtml() { return $this->getChildHtml('payment_info'); } public function getOrder() { return Mage::registry('current_order'); } public function getInvoice() { return Mage::registry('current_invoice'); } protected function _prepareItem(Mage_Core_Block_Abstract $renderer) { $renderer->setPrintStatus(true); return parent::_prepareItem($renderer); } /** * Get html of invoice totlas block * * @param Mage_Sales_Model_Order_Invoice $invoice * @return string */ public function getInvoiceTotalsHtml($invoice) { $html = ''; $totals = $this->getChild('invoice_totals'); if ($totals) { $totals->setInvoice($invoice); $html = $totals->toHtml(); } return $html; } }