Skip to content

Commit dd1d1bd

Browse files
committed
AC-13828::Unable to place order with paypal express checkout when we are directly checking out from cart page
1 parent e25b678 commit dd1d1bd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ public function validateAddresses(QuoteEntity $quote)
159159
$quote->getShippingAddress()->getCustomerAddressId()
160160
);
161161
}
162-
if (!empty($addresses) && $quote->getCustomerIsGuest()) {
162+
if (empty($addresses) && $quote->getCustomerIsGuest() && $quote->getBillingAddress()->getTelephone()) {
163163
$billingAddress = $quote->getBillingAddress();
164164
$customerAddress = $this->customerAddressFactory->create();
165165
$customerAddress->setFirstname($billingAddress->getFirstname());

app/code/Magento/Quote/Test/Unit/Model/CustomerManagementTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,11 @@ public function testValidateAddressesNotSavedInAddressBook()
279279
->getMock();
280280
$this->addressFactoryMock->expects($this->exactly(1))->method('create')->willReturn($addressMock);
281281
$this->quoteMock
282-
->expects($this->any())
282+
->expects($this->atLeastOnce())
283283
->method('getBillingAddress')
284284
->willReturn($this->quoteAddressMock);
285285
$this->quoteMock
286-
->expects($this->any())
286+
->expects($this->atLeastOnce())
287287
->method('getShippingAddress')
288288
->willReturn($this->quoteAddressMock);
289289
$validatorMock = $this->getMockBuilder(Validator::class)

0 commit comments

Comments
 (0)