Duplicate addresses created on checkout

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 years ago
The Address.Clone() does not include the Id property.
The OrderProcessingService.PreparePlaceOrderDetails() and PrepareRecurringOrderDetails() calls the Address.Clone() but the new clone Address has Id = 0. So new Addresses are created by those calls, identical to already existing Addresses, they get saved as new ones and are not even linked to the customer.
Is this by design?

Bug in 4.10 but tested on 4.20 and the same happens.
4 years ago
It's by design.  The address is cloned, and the Order references it.   The reason is to preserve the address as it was at the time of the order.  If Order was to point to the customers address, and then the customer was to change his address after the order is placed, then the order would not reflect the address that was there at the 'point in time' of the order.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.