From f3c7406253938c70742cac308c12729a99f50a1c Mon Sep 17 00:00:00 2001 From: Anton Evers Date: Tue, 14 Mar 2017 12:11:45 +0100 Subject: [PATCH 1/3] add middle name to checkout address html templates #8878 --- .../view/frontend/web/template/billing-address/details.html | 2 +- .../web/template/shipping-address/address-renderer/default.html | 2 +- .../template/shipping-information/address-renderer/default.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html b/app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html index 17754b81849f5..f2baf5d50030e 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html @@ -5,7 +5,7 @@ */ -->
- +

,
diff --git a/app/code/Magento/Checkout/view/frontend/web/template/shipping-address/address-renderer/default.html b/app/code/Magento/Checkout/view/frontend/web/template/shipping-address/address-renderer/default.html index 4c3ce84baac4d..f9400227fae09 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/shipping-address/address-renderer/default.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/shipping-address/address-renderer/default.html @@ -5,7 +5,7 @@ */ -->
- +

,
diff --git a/app/code/Magento/Checkout/view/frontend/web/template/shipping-information/address-renderer/default.html b/app/code/Magento/Checkout/view/frontend/web/template/shipping-information/address-renderer/default.html index c3afce6c4537f..ec41cae0bdc5e 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/shipping-information/address-renderer/default.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/shipping-information/address-renderer/default.html @@ -5,7 +5,7 @@ */ --> - +

,
From 5f1b460249428e6c80910b672d769099d37619c7 Mon Sep 17 00:00:00 2001 From: Anton Evers Date: Mon, 12 Jun 2017 17:05:32 +0600 Subject: [PATCH 2/3] Fix prefix, middle name and suffix were not prefilled in the checkout --- .../Checkout/Block/Checkout/AttributeMerger.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/code/Magento/Checkout/Block/Checkout/AttributeMerger.php b/app/code/Magento/Checkout/Block/Checkout/AttributeMerger.php index a2880c28844ac..1905826133c2a 100644 --- a/app/code/Magento/Checkout/Block/Checkout/AttributeMerger.php +++ b/app/code/Magento/Checkout/Block/Checkout/AttributeMerger.php @@ -326,6 +326,21 @@ protected function getDefaultValue($attributeCode) return $this->getCustomer()->getLastname(); } break; + case 'middlename': + if ($this->getCustomer()) { + return $this->getCustomer()->getMiddlename(); + } + break; + case 'prefix': + if ($this->getCustomer()) { + return $this->getCustomer()->getPrefix(); + } + break; + case 'suffix': + if ($this->getCustomer()) { + return $this->getCustomer()->getSuffix(); + } + break; case 'country_id': return $this->directoryHelper->getDefaultCountry(); } From 3c632aa90963107c3450b5e67d6cc1aeafb680f2 Mon Sep 17 00:00:00 2001 From: Anton Evers Date: Tue, 13 Jun 2017 11:31:15 +0600 Subject: [PATCH 3/3] Move prefix and suffix default values to a new PR --- .../Checkout/Block/Checkout/AttributeMerger.php | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/app/code/Magento/Checkout/Block/Checkout/AttributeMerger.php b/app/code/Magento/Checkout/Block/Checkout/AttributeMerger.php index 1905826133c2a..dcfe1cd5e2038 100644 --- a/app/code/Magento/Checkout/Block/Checkout/AttributeMerger.php +++ b/app/code/Magento/Checkout/Block/Checkout/AttributeMerger.php @@ -321,24 +321,14 @@ protected function getDefaultValue($attributeCode) return $this->getCustomer()->getFirstname(); } break; - case 'lastname': - if ($this->getCustomer()) { - return $this->getCustomer()->getLastname(); - } - break; case 'middlename': if ($this->getCustomer()) { return $this->getCustomer()->getMiddlename(); } break; - case 'prefix': - if ($this->getCustomer()) { - return $this->getCustomer()->getPrefix(); - } - break; - case 'suffix': + case 'lastname': if ($this->getCustomer()) { - return $this->getCustomer()->getSuffix(); + return $this->getCustomer()->getLastname(); } break; case 'country_id':