diff --git a/Pix/Block/Multishipping/Checkout/Success.php b/Pix/Block/Multishipping/Checkout/Success.php new file mode 100644 index 0000000..8cb9ffd --- /dev/null +++ b/Pix/Block/Multishipping/Checkout/Success.php @@ -0,0 +1,86 @@ +checkoutSession = $checkoutSession; + $this->customerSession = $customerSession; + $this->_helperData = $helper; + $this->_orderFactory = $orderFactory; + } + + public function getQrCodes() + { + $orderIds = $this->_session->getOrderIds(); + + if (! $orderIds || ! is_array($orderIds)) { + return []; + } + + $qrCodes = []; + + foreach ($orderIds as $orderId) { + $order = $this->_orderFactory->create() + ->loadByIncrementId($orderId); + + if (! $order->getId()) { + continue; + } + + $correlationID = $order->getOpenpixCorrelationid(); + + if (empty($correlationID)) { + continue; + } + + $qrCodes[] = [ + 'paymentLinkUrl' => $order->getOpenpixPaymentlinkurl(), + 'brCodeImage' => $order->getOpenpixQrcodeimage(), + 'brCode' => $order->getOpenpixBrcode(), + 'correlationID' => $correlationID, + ]; + } + + return $qrCodes; + } + + public function getAppID(): string + { + $appID = $this->_helperData->getAppID(); + + if (isset($appID)) { + return $appID; + } + + return ''; + } + + public function getPluginSrc(): string + { + return $this->_helperData->getOpenPixPluginUrlScript(); + } + + public function getCustomerId() + { + return $this->customerSession->getCustomer()->getId(); + } +} diff --git a/Pix/view/frontend/layout/multishipping_checkout_success.xml b/Pix/view/frontend/layout/multishipping_checkout_success.xml new file mode 100644 index 0000000..f747121 --- /dev/null +++ b/Pix/view/frontend/layout/multishipping_checkout_success.xml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file