Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Popup.php
Go to the documentation of this file.
1 <?php
8 
10 
12 {
18  protected $_coreRegistry;
19 
24 
28  protected $_orderFactory;
29 
36  public function __construct(
37  \Magento\Framework\App\Action\Context $context,
38  \Magento\Framework\Registry $coreRegistry,
39  \Magento\Shipping\Model\InfoFactory $shippingInfoFactory,
40  \Magento\Sales\Model\OrderFactory $orderFactory
41  ) {
42  $this->_coreRegistry = $coreRegistry;
43  $this->_shippingInfoFactory = $shippingInfoFactory;
44  $this->_orderFactory = $orderFactory;
45  parent::__construct($context);
46  }
47 
55  public function execute()
56  {
57  $shippingInfoModel = $this->_shippingInfoFactory->create()->loadByHash($this->getRequest()->getParam('hash'));
58  $this->_coreRegistry->register('current_shipping_info', $shippingInfoModel);
59  if (count($shippingInfoModel->getTrackingInfo()) == 0) {
60  throw new NotFoundException(__('Page not found.'));
61  }
62  $this->_view->loadLayout();
63  $this->_view->getPage()->getConfig()->getTitle()->set(__('Tracking Information'));
64  $this->_view->renderLayout();
65  }
66 }
__()
Definition: __.php:13
__construct(\Magento\Framework\App\Action\Context $context, \Magento\Framework\Registry $coreRegistry, \Magento\Shipping\Model\InfoFactory $shippingInfoFactory, \Magento\Sales\Model\OrderFactory $orderFactory)
Definition: Popup.php:36