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
11 
17 {
23  protected $_coreRegistry = null;
24 
30  public function __construct(
31  \Magento\Framework\View\Element\Template\Context $context,
32  \Magento\Framework\Registry $registry,
33  array $data = []
34  ) {
35  $this->_coreRegistry = $registry;
36  parent::__construct($context, $data);
37  }
38 
44  public function getOrder()
45  {
46  return $this->_coreRegistry->registry('current_order');
47  }
48 
54  {
55  return $this->getUrl('*/*/printCreditmemo', ['creditmemo_id' => $creditmemo->getId()]);
56  }
57 
63  {
64  return $this->getUrl('*/*/printCreditmemo', ['order_id' => $order->getId()]);
65  }
66 
73  public function getTotalsHtml($creditmemo)
74  {
75  $totals = $this->getChildBlock('creditmemo_totals');
76  $html = '';
77  if ($totals) {
78  $totals->setCreditmemo($creditmemo);
79  $html = $totals->toHtml();
80  }
81  return $html;
82  }
83 
90  public function getCommentsHtml($creditmemo)
91  {
92  $html = '';
93  $comments = $this->getChildBlock('creditmemo_comments');
94  if ($comments) {
95  $comments->setEntity($creditmemo)->setTitle(__('About Your Refund'));
96  $html = $comments->toHtml();
97  }
98  return $html;
99  }
100 }
$order
Definition: order.php:55
__()
Definition: __.php:13
$totals
Definition: totalbar.phtml:10
__construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\Registry $registry, array $data=[])
Definition: Items.php:30