コード例 #1
0
ファイル: ItemsTest.php プロジェクト: nemphys/magento2
 public function testGetInvoiceCommentsHtml()
 {
     $childBlock = $this->_layout->addBlock('Mage_Core_Block_Text', 'invoice_comments', 'block');
     $expectedHtml = '<b>Any html</b>';
     $this->assertEmpty($childBlock->getEntity());
     $this->assertEmpty($childBlock->getTitle());
     $this->assertNotEquals($expectedHtml, $this->_block->getInvoiceCommentsHtml($this->_invoice));
     $childBlock->setText($expectedHtml);
     $actualHtml = $this->_block->getInvoiceCommentsHtml($this->_invoice);
     $this->assertSame($this->_invoice, $childBlock->getEntity());
     $this->assertNotEmpty($childBlock->getTitle());
     $this->assertEquals($expectedHtml, $actualHtml);
 }
コード例 #2
0
 public function getPrintAllInvoicesUrl($order)
 {
     if (!Mage::getStoreConfig('pdfpro/config/enabled') || !Mage::getStoreConfig('pdfpro/config/allow_customer_print') || !Mage::helper('pdfpro')->getDefaultApiKey()) {
         return parent::getPrintAllInvoicesUrl($order);
     }
     if (Mage::getSingleton('customer/session')->isLoggedIn()) {
         return Mage::getUrl('pdfpro/print/invoices', array('order_id' => $order->getId()));
     }
     return Mage::getUrl('pdfpro/guest/printInvoices', array('order_id' => $order->getId()));
 }
コード例 #3
0
ファイル: Invoice.php プロジェクト: relue/magento2
 protected function _construct()
 {
     parent::_construct();
     $this->setTemplate('order/invoice.phtml');
 }
コード例 #4
0
 public function _toHtml()
 {
     $this->setTemplate('aw_points/sales/order/invoice/items.phtml');
     return parent::_toHtml();
 }