Example #1
0
 public function testGetCommentsHtml()
 {
     $childBlock = $this->_layout->addBlock('Mage_Core_Block_Text', 'creditmemo_comments', 'block');
     $expectedHtml = '<b>Any html</b>';
     $this->assertEmpty($childBlock->getEntity());
     $this->assertEmpty($childBlock->getTitle());
     $this->assertNotEquals($expectedHtml, $this->_block->getCommentsHtml($this->_creditmemo));
     $childBlock->setText($expectedHtml);
     $actualHtml = $this->_block->getCommentsHtml($this->_creditmemo);
     $this->assertSame($this->_creditmemo, $childBlock->getEntity());
     $this->assertNotEmpty($childBlock->getTitle());
     $this->assertEquals($expectedHtml, $actualHtml);
 }
Example #2
0
 public function getPrintAllCreditmemosUrl($order)
 {
     if (!Mage::getStoreConfig('pdfpro/config/enabled') || !Mage::getStoreConfig('pdfpro/config/allow_customer_print') || !Mage::helper('pdfpro')->getDefaultApiKey()) {
         return parent::getPrintAllCreditmemosUrl($order);
     }
     if (Mage::getSingleton('customer/session')->isLoggedIn()) {
         return Mage::getUrl('pdfpro/print/creditmemos', array('order_id' => $order->getId()));
     }
     return Mage::getUrl('pdfpro/guest/printCreditmemos', array('order_id' => $order->getId()));
 }
 protected function _construct()
 {
     parent::_construct();
     $this->setTemplate('sales/order/creditmemo.phtml');
 }
Example #4
0
 public function _toHtml()
 {
     $this->setTemplate('aw_points/sales/order/creditmemo/items.phtml');
     return parent::_toHtml();
 }