Skip to content

Commit 11619df

Browse files
committed
MC-36838: Cannot checkout with automatic customer group assignment
1 parent b246e2a commit 11619df

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/code/Magento/Quote/Observer/Frontend/Quote/Address/CollectTotalsObserver.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,10 @@ public function execute(\Magento\Framework\Event\Observer $observer)
135135
$address->setPrevQuoteCustomerGroupId($quote->getCustomerGroupId());
136136
$quote->setCustomerGroupId($groupId);
137137
$this->customerSession->setCustomerGroupId($groupId);
138-
$customer->setGroupId($groupId);
139-
$quote->setCustomer($customer);
138+
if ($customer->getId() !== null) {
139+
$customer->setGroupId($groupId);
140+
$quote->setCustomer($customer);
141+
}
140142
}
141143
}
142144
}

0 commit comments

Comments
 (0)