From 4491398eeb87e48345c1fe6b065e1af6bbb2d378 Mon Sep 17 00:00:00 2001 From: serucee Date: Mon, 1 Oct 2018 16:26:00 +0200 Subject: [PATCH 1/2] #70 Update birthdate selector for invoice and installment Update Readme and version --- Frontend/WirecardCheckoutPage/Bootstrap.php | 7 ++++++- Frontend/WirecardCheckoutPage/Models/Page.php | 9 +++++---- .../responsive/frontend/checkout/confirm.tpl | 15 +++++++-------- README.md | 2 +- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/Frontend/WirecardCheckoutPage/Bootstrap.php b/Frontend/WirecardCheckoutPage/Bootstrap.php index e5b4869..3273b6b 100755 --- a/Frontend/WirecardCheckoutPage/Bootstrap.php +++ b/Frontend/WirecardCheckoutPage/Bootstrap.php @@ -71,7 +71,7 @@ public function getCapabilities() */ public function getVersion() { - return '1.6.1'; + return '1.6.2'; } /** @@ -902,6 +902,11 @@ public function onPreDispatch(Enlight_Event_EventArgs $args) self::init(); Shopware()->WirecardCheckoutPage()->financialInstitution = $financialInstitution; } + $birthDate = $args->getSubject()->Request()->get('birthdate'); + if (!empty($birthDate)) { + self::init(); + Shopware()->Session()->sOrderVariables['sUserData']['additional']['user']['birthday'] = $birthDate; + } } /** diff --git a/Frontend/WirecardCheckoutPage/Models/Page.php b/Frontend/WirecardCheckoutPage/Models/Page.php index 1df47d5..14e56c0 100644 --- a/Frontend/WirecardCheckoutPage/Models/Page.php +++ b/Frontend/WirecardCheckoutPage/Models/Page.php @@ -195,11 +195,12 @@ public function getConsumerData($paymentType) $userData = Shopware()->Session()->sOrderVariables['sUserData']; $birthday = $userData['additional']['user']['birthday']; - $birthday = $this->getDateObject($birthday); - if (false !== $birthday) { - $consumerData = $consumerData->setBirthDate($birthday); + if (!empty($birthday)) { + $birthday = $this->getDateObject($birthday); + if (false !== $birthday) { + $consumerData = $consumerData->setBirthDate($birthday); + } } - } return $consumerData; diff --git a/Frontend/WirecardCheckoutPage/Views/responsive/frontend/checkout/confirm.tpl b/Frontend/WirecardCheckoutPage/Views/responsive/frontend/checkout/confirm.tpl index f9dc3fb..6bbb705 100755 --- a/Frontend/WirecardCheckoutPage/Views/responsive/frontend/checkout/confirm.tpl +++ b/Frontend/WirecardCheckoutPage/Views/responsive/frontend/checkout/confirm.tpl @@ -8,7 +8,7 @@ {/if}