Skip to content

Commit 25664e4

Browse files
committed
MCP-537: [MCP-304] PR Delivery
1 parent c586697 commit 25664e4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@ public function placeOrder($cartId, PaymentInterface $paymentMethod = null)
387387
{
388388
$quote = $this->quoteRepository->getActive($cartId);
389389
$customer = $quote->getCustomer();
390+
$customerId = $customer ? $customer->getId() : null;
390391

391392
if ($paymentMethod) {
392393
$paymentMethod->setChecks(
@@ -406,7 +407,7 @@ public function placeOrder($cartId, PaymentInterface $paymentMethod = null)
406407
$quote->collectTotals();
407408
}
408409

409-
if ($quote->getCheckoutMethod() === self::METHOD_GUEST || !$customer) {
410+
if ($quote->getCheckoutMethod() === self::METHOD_GUEST || !$customerId) {
410411
$quote->setCustomerId(null);
411412
$billingAddress = $quote->getBillingAddress();
412413
$quote->setCustomerEmail($billingAddress ? $billingAddress->getEmail() : null);
@@ -421,7 +422,7 @@ public function placeOrder($cartId, PaymentInterface $paymentMethod = null)
421422
}
422423
}
423424
$quote->setCustomerIsGuest(true);
424-
$groupId = $customer ? $customer->getGroupId() : GroupInterface::NOT_LOGGED_IN_ID;
425+
$groupId = $customerId ? $customer->getGroupId() : GroupInterface::NOT_LOGGED_IN_ID;
425426
$quote->setCustomerGroupId($groupId);
426427
}
427428

0 commit comments

Comments
 (0)