_paymentHelper = $paymentHelper; $this->httpContext = $httpContext; parent::__construct($context, $registry, $data); $this->_isScopePrivate = true; } /** * @return void */ protected function _prepareLayout() { $this->pageConfig->getTitle()->set(__('Order # %1', $this->getOrder()->getRealOrderId())); $infoBlock = $this->_paymentHelper->getInfoBlock($this->getOrder()->getPayment(), $this->getLayout()); $this->setChild('payment_info', $infoBlock); } /** * @return string */ public function getPaymentInfoHtml() { return $this->getChildHtml('payment_info'); } /** * Retrieve current order model instance * * @return \Magento\Sales\Model\Order */ public function getOrder() { return $this->_coreRegistry->registry('current_order'); } /** * Return back url for logged in and guest users * * @return string */ public function getBackUrl() { if ($this->httpContext->getValue(Context::CONTEXT_AUTH)) { return $this->getUrl('*/*/history'); } return $this->getUrl('*/*/form'); } /** * Return back title for logged in and guest users * * @return \Magento\Framework\Phrase */ public function getBackTitle() { if ($this->httpContext->getValue(Context::CONTEXT_AUTH)) { return __('Back to My Orders'); } return __('View Another Order'); } /** * @param object $order * @return string */ public function getViewUrl($order) { return $this->getUrl('*/*/view', ['order_id' => $order->getId()]); } /** * @param object $order * @return string */ public function getShipmentUrl($order) { return $this->getUrl('*/*/shipment', ['order_id' => $order->getId()]); } /** * @param object $order * @return string */ public function getCreditmemoUrl($order) { return $this->getUrl('*/*/creditmemo', ['order_id' => $order->getId()]); } /** * @param object $invoice * @return string */ public function getPrintInvoiceUrl($invoice) { return $this->getUrl('*/*/printInvoice', ['invoice_id' => $invoice->getId()]); } /** * @param object $order * @return string */ public function getPrintAllInvoicesUrl($order) { return $this->getUrl('*/*/printInvoice', ['order_id' => $order->getId()]); } }