File tree 2 files changed +462
-11
lines changed
app/code/Magento/Customer
2 files changed +462
-11
lines changed Original file line number Diff line number Diff line change @@ -106,24 +106,22 @@ protected function _prepareLayout()
106
106
if ($ addressId = $ this ->getRequest ()->getParam ('id ' )) {
107
107
try {
108
108
$ this ->_address = $ this ->_addressRepository ->getById ($ addressId );
109
+ if ($ this ->_address ->getCustomerId () != $ this ->_customerSession ->getCustomerId ()) {
110
+ $ this ->_address = null ;
111
+ }
109
112
} catch (NoSuchEntityException $ e ) {
110
113
$ this ->_address = null ;
111
114
}
112
115
}
113
116
114
117
if ($ this ->_address === null || !$ this ->_address ->getId ()) {
115
118
$ this ->_address = $ this ->addressDataFactory ->create ();
116
- $ this ->_address ->setPrefix (
117
- $ this ->getCustomer ()->getPrefix ()
118
- )->setFirstname (
119
- $ this ->getCustomer ()->getFirstname ()
120
- )->setMiddlename (
121
- $ this ->getCustomer ()->getMiddlename ()
122
- )->setLastname (
123
- $ this ->getCustomer ()->getLastname ()
124
- )->setSuffix (
125
- $ this ->getCustomer ()->getSuffix ()
126
- );
119
+ $ customer = $ this ->getCustomer ();
120
+ $ this ->_address ->setPrefix ($ customer ->getPrefix ());
121
+ $ this ->_address ->setFirstname ($ customer ->getFirstname ());
122
+ $ this ->_address ->setMiddlename ($ customer ->getMiddlename ());
123
+ $ this ->_address ->setLastname ($ customer ->getLastname ());
124
+ $ this ->_address ->setSuffix ($ customer ->getSuffix ());
127
125
}
128
126
129
127
$ this ->pageConfig ->getTitle ()->set ($ this ->getTitle ());
You can’t perform that action at this time.
0 commit comments