Skip to content

Commit 594fc93

Browse files
committed
Set e-mail address for the PayPal guest quote's customer model
This change sets an e-mail address on the customer model assigned to the guest quote prepared for further processing by PayPal module. It circumvents inability to place a guest order with PayPal Express when Automatic Asignment to Customer Group is enabled. Fixes #25399
1 parent 7d23e3f commit 594fc93

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/code/Magento/Paypal/Model/Express/Checkout.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,6 +1159,9 @@ protected function prepareGuestQuote()
11591159
->setCustomerEmail($quote->getBillingAddress()->getEmail())
11601160
->setCustomerIsGuest(true)
11611161
->setCustomerGroupId(\Magento\Customer\Model\Group::NOT_LOGGED_IN_ID);
1162+
if ($quote->getCustomer()->getEmail() === null) {
1163+
$quote->getCustomer()->setEmail($quote->getBillingAddress()->getEmail());
1164+
}
11621165
return $this;
11631166
}
11641167
}

0 commit comments

Comments
 (0)