From 4f536cd292cc91c9bac60cf3390326400e99981b Mon Sep 17 00:00:00 2001 From: peterojo Date: Fri, 30 Apr 2021 16:02:19 +0200 Subject: [PATCH] [PW-4379] add comments to order if available --- Controllers/Frontend/Adyen.php | 4 ++++ Resources/frontend/js/jquery.adyen-confirm-order.js | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Controllers/Frontend/Adyen.php b/Controllers/Frontend/Adyen.php index 3152a993..2643c494 100644 --- a/Controllers/Frontend/Adyen.php +++ b/Controllers/Frontend/Adyen.php @@ -209,6 +209,10 @@ private function prepareOrder($transaction) $transaction->getId() ); + if ($this->Request()->getParam('sComment') !== null) { + Shopware()->Session()->offsetSet('sComment', $this->Request()->getParam('sComment')); + } + $orderNumber = $this->saveOrder( $transaction->getId(), $signature, diff --git a/Resources/frontend/js/jquery.adyen-confirm-order.js b/Resources/frontend/js/jquery.adyen-confirm-order.js index a9d91655..fe8717e8 100644 --- a/Resources/frontend/js/jquery.adyen-confirm-order.js +++ b/Resources/frontend/js/jquery.adyen-confirm-order.js @@ -83,7 +83,8 @@ 'paymentMethod': me.getPaymentMethod(), 'storePaymentMethod': me.getStorePaymentMethod(), 'browserInfo': me.getBrowserInfo(), - 'origin': window.location.origin + 'origin': window.location.origin, + 'sComment': me.getComment(), }; $.ajax({ @@ -303,6 +304,10 @@ me.adyenCheckout = new AdyenCheckout(me.adyenConfiguration); }, + getComment: function() { + return $('[data-storagekeyname="sComment"]').val(); + }, + getPaymentMethod: function () { var me = this;