I still have the same issue after upgrading to 10.4.1
It is really a weird behavior as it works fine for Shipment shipping address but not for Payment billing address and they both have same code (Pasted below).
if (AddressName == Constants.Order.BillingAddressName) { IOrderAddress address = GetDefaultBillingAddress(); address.Id = Constants.Order.BillingAddressName; payment.BillingAddress = address; var addressMetaFields = new Hashtable(address.Properties); foreach (var field in addressMetaFields.Keys) { if (addressMetaFields[field] != null) payment.BillingAddress.Properties[field] = addressMetaFields[field]; } } else if (AddressName == Constants.Order.ShippingAddressName) { IOrderAddress address = GetDefaultShippingAddress(); address.Id = Constants.Order.ShippingAddressName; shipment.ShippingAddress = address; var addressMetaFields = new Hashtable(address.Properties); foreach (var field in addressMetaFields.Keys) { if (addressMetaFields[field] != null) shipment.ShippingAddress.Properties[field] = addressMetaFields[field]; } } ServiceLocator.Current.GetInstance<IOrderRepository>().Save(cart);
I was wrong, the issue I was thinking about was fixed in 10.4 already, so this is something else. I assume your metaclass really has these fields (with names exactly like you assign, casing and all)?
Correct, they have same name exactly.
All attached to the order group address meta class.
Did this work before on a previous version? (I currently have no idea what is wrong, but first step is to limit the scope)
Before we used the old Cart APIs and we were attaching the billing and shipping addresses to OrderAddresses property in Cart object.
It was working fine and meta fields were populated properly.
This is the first time to test the version 10 upgrade and we just came through this issue.
Using EPIServer.Commerce 10.4:
I am trying to save the payment billing address as following:
All properties are saved properly except the MetaFields. They are all null.
Any thoughts?
Thanks!