Skip to content

Commit 0fecd76

Browse files
committed
Merge pull request #372 from magento-folks/develop
[Folks] Bug-fix (P0)
2 parents b6654ab + c9c44ae commit 0fecd76

File tree

6 files changed

+12
-6
lines changed

6 files changed

+12
-6
lines changed

app/code/Magento/Quote/Model/BillingAddressManagement.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ public function assign($cartId, \Magento\Quote\Api\Data\AddressInterface $addres
8787
$shippingAddress = $quote->getShippingAddress()->importCustomerAddressData($addressData);
8888
$shippingAddress->setSaveInAddressBook($saveInAddressBook);
8989
}
90+
} elseif ($quote->getCustomerId()) {
91+
$address->setEmail($quote->getCustomerEmail());
9092
}
9193
$address->setSaveInAddressBook($saveInAddressBook);
9294
$quote->setBillingAddress($address);

app/code/Magento/Quote/Model/ShippingAddressManagement.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ public function assign($cartId, \Magento\Quote\Api\Data\AddressInterface $addres
8989
if ($customerAddressId) {
9090
$addressData = $this->addressRepository->getById($customerAddressId);
9191
$address = $quote->getShippingAddress()->importCustomerAddressData($addressData);
92+
} elseif ($quote->getCustomerId()) {
93+
$address->setEmail($quote->getCustomerEmail());
9294
}
9395
$address->setSameAsBilling($sameAsBilling);
9496
$address->setSaveInAddressBook($saveInAddressBook);

dev/tests/api-functional/testsuite/Magento/Quote/Api/BillingAddressManagementTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function testSetAddress()
103103
$addressData = [
104104
'firstname' => 'John',
105105
'lastname' => 'Smith',
106-
'email' => '[email protected]',
106+
'email' => '',
107107
'company' => 'eBay Inc',
108108
'street' => ['Typical Street', 'Tiny House 18'],
109109
'city' => 'Big City',
@@ -134,6 +134,7 @@ public function testSetAddress()
134134
$this->assertContains($streetLine, $quote->getBillingAddress()->getStreet());
135135
}
136136
unset($addressData['street']);
137+
unset($addressData['email']);
137138
$this->assertEquals('billing', $savedData['address_type']);
138139
//check the rest of fields
139140
foreach ($addressData as $key => $value) {
@@ -226,7 +227,6 @@ public function testSetMyAddress()
226227
$addressData = [
227228
'firstname' => 'John',
228229
'lastname' => 'Smith',
229-
'email' => '[email protected]',
230230
'company' => 'eBay Inc',
231231
'street' => ['Typical Street', 'Tiny House 18'],
232232
'city' => 'Big City',

dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestBillingAddressManagementTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function testSetAddress()
112112
$addressData = [
113113
'firstname' => 'John',
114114
'lastname' => 'Smith',
115-
'email' => '[email protected]',
115+
'email' => '',
116116
'company' => 'eBay Inc',
117117
'street' => ['Typical Street', 'Tiny House 18'],
118118
'city' => 'Big City',
@@ -143,6 +143,7 @@ public function testSetAddress()
143143
$this->assertContains($streetLine, $quote->getBillingAddress()->getStreet());
144144
}
145145
unset($addressData['street']);
146+
unset($addressData['email']);
146147
$this->assertEquals('billing', $savedData['address_type']);
147148
//check the rest of fields
148149
foreach ($addressData as $key => $value) {

dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestShippingAddressManagementTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public function testSetAddress()
153153
$addressData = [
154154
'firstname' => 'John',
155155
'lastname' => 'Smith',
156-
'email' => '[email protected]',
156+
'email' => '',
157157
'company' => 'eBay Inc',
158158
'street' => ['Typical Street', 'Tiny House 18'],
159159
'city' => 'Big City',
@@ -183,6 +183,7 @@ public function testSetAddress()
183183
//custom checks for street, region and address_type
184184
$this->assertEquals($addressData['street'], $quote->getShippingAddress()->getStreet());
185185
unset($addressData['street']);
186+
unset($addressData['email']);
186187

187188
$this->assertEquals('shipping', $savedData['address_type']);
188189
//check the rest of fields

dev/tests/api-functional/testsuite/Magento/Quote/Api/ShippingAddressManagementTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function testSetAddress()
128128
$addressData = [
129129
'firstname' => 'John',
130130
'lastname' => 'Smith',
131-
'email' => '[email protected]',
131+
'email' => '',
132132
'company' => 'eBay Inc',
133133
'street' => ['Typical Street', 'Tiny House 18'],
134134
'city' => 'Big City',
@@ -158,6 +158,7 @@ public function testSetAddress()
158158
//custom checks for street, region and address_type
159159
$this->assertEquals($addressData['street'], $quote->getShippingAddress()->getStreet());
160160
unset($addressData['street']);
161+
unset($addressData['email']);
161162

162163
$this->assertEquals('shipping', $savedData['address_type']);
163164
//check the rest of fields
@@ -306,7 +307,6 @@ public function testSetMyAddress()
306307
$addressData = [
307308
'firstname' => 'John',
308309
'lastname' => 'Smith',
309-
'email' => '[email protected]',
310310
'company' => 'eBay Inc',
311311
'street' => ['Typical Street', 'Tiny House 18'],
312312
'city' => 'Big City',

0 commit comments

Comments
 (0)