diff --git a/src/CoreShop/Component/Core/Customer/Address/AddressAssignmentManager.php b/src/CoreShop/Component/Core/Customer/Address/AddressAssignmentManager.php index 200e86c19d..b3f511569e 100644 --- a/src/CoreShop/Component/Core/Customer/Address/AddressAssignmentManager.php +++ b/src/CoreShop/Component/Core/Customer/Address/AddressAssignmentManager.php @@ -130,6 +130,12 @@ public function allocateAddressByAffiliation(CustomerInterface $customer, Addres ); } + //If it's a customer address, and the customer doesn't have one yet, use this address as default and allow it for all types + if ($affiliation === CustomerAddressAllocatorInterface::ADDRESS_AFFILIATION_TYPE_OWN && 0 === count($customer->getAddresses())) { + $address->setAddressIdentifier(null); + $customer->setDefaultAddress($address); + } + $address = $this->customerTransformHelper->moveAddressToNewAddressStack($address, $relationEntity); return $address;