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
12 namespace Magento\Shipping\Block;
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 getPrintShipmentUrl($shipment)
56  {
57  return $this->getUrl('*/*/printShipment', ['shipment_id' => $shipment->getId()]);
58  }
59 
65  {
66  return $this->getUrl('*/*/printShipment', ['order_id' => $order->getId()]);
67  }
68 
75  public function getCommentsHtml($shipment)
76  {
77  $html = '';
78  $comments = $this->getChildBlock('shipment_comments');
79  if ($comments) {
80  $comments->setEntity($shipment)->setTitle(__('About Your Shipment'));
81  $html = $comments->toHtml();
82  }
83  return $html;
84  }
85 }
getCommentsHtml($shipment)
Definition: Items.php:75
$order
Definition: order.php:55
__()
Definition: __.php:13
getPrintShipmentUrl($shipment)
Definition: Items.php:55
__construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\Registry $registry, array $data=[])
Definition: Items.php:32
getPrintAllShipmentsUrl($order)
Definition: Items.php:64
foreach($order->getItems() as $orderItem) $shipment