Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Items.php
Go to the documentation of this file.
1 <?php
13 
19 {
25  protected $_coreRegistry = null;
26 
32  public function __construct(
33  \Magento\Framework\View\Element\Template\Context $context,
34  \Magento\Framework\Registry $registry,
35  array $data = []
36  ) {
37  $this->_coreRegistry = $registry;
38  parent::__construct($context, $data);
39  }
40 
46  public function getOrder()
47  {
48  return $this->_coreRegistry->registry('current_order');
49  }
50 
55  public function getPrintInvoiceUrl($invoice)
56  {
57  return $this->getUrl('*/*/printInvoice', ['invoice_id' => $invoice->getId()]);
58  }
59 
64  public function getPrintAllInvoicesUrl($order)
65  {
66  return $this->getUrl('*/*/printInvoice', ['order_id' => $order->getId()]);
67  }
68 
75  public function getInvoiceTotalsHtml($invoice)
76  {
77  $html = '';
78  $totals = $this->getChildBlock('invoice_totals');
79  if ($totals) {
80  $totals->setInvoice($invoice);
81  $html = $totals->toHtml();
82  }
83  return $html;
84  }
85 
93  {
94  $html = '';
95  $comments = $this->getChildBlock('invoice_comments');
96  if ($comments) {
97  $comments->setEntity($invoice)->setTitle(__('About Your Invoice'));
98  $html = $comments->toHtml();
99  }
100  return $html;
101  }
102 }
$order
Definition: order.php:55
__()
Definition: __.php:13
$totals
Definition: totalbar.phtml:10
$invoice
__construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\Registry $registry, array $data=[])
Definition: Items.php:32