44 parent::__construct($context);
54 $invoiceId = (int)$this->
getRequest()->getParam(
'invoice_id');
56 $invoice = $this->_objectManager->create(
57 \
Magento\Sales\Api\InvoiceRepositoryInterface::class
61 $orderId = (int)$this->
getRequest()->getParam(
'order_id');
62 $order = $this->_objectManager->create(\
Magento\Sales\Model\Order::class)->load($orderId);
65 if ($this->orderAuthorization->canView(
$order)) {
66 $this->_coreRegistry->register(
'current_order',
$order);
68 $this->_coreRegistry->register(
'current_invoice',
$invoice);
71 $resultPage = $this->resultPageFactory->create();
72 $resultPage->addHandle(
'print');
76 $resultRedirect = $this->resultRedirectFactory->create();
77 if ($this->_objectManager->get(\
Magento\Customer\Model\Session::class)->isLoggedIn()) {
78 $resultRedirect->setPath(
'*/*/history');
80 $resultRedirect->setPath(
'sales/guest/form');
82 return $resultRedirect;
__construct(Context $context, OrderViewAuthorizationInterface $orderAuthorization, \Magento\Framework\Registry $registry, PageFactory $resultPageFactory)