Order Address MetaFields Saving Issue

Member since: 2014

Using EPIServer.Commerce 10.4:

I am trying to save the payment billing address as following:

IOrderAddress address = GetDefaultBillingAddress();
address.Id = Constants.Order.BillingAddressName;
address.Properties["IsValidated"] = true;
address.Properties["UserChoosetoOverrideValidation"] = true;
payment.BillingAddress = address;

ServiceLocator.Current.GetInstance<IOrderRepository>().Save(cart);


All properties are saved properly except the MetaFields. They are all null.

Any thoughts?

Thanks!

#176199 Mar 13, 2017 18:05
  • Member since: 2008

    I believe this is fixed in 10.4.1 released today.

    #176201 Mar 13, 2017 18:40
  • Member since: 2014

    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);
    #176203 Mar 13, 2017 20:16
  • Member since: 2008

    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)?

    #176204 Mar 13, 2017 20:39
  • Member since: 2014

    Correct, they have same name exactly.

    All attached to the order group address meta class.

    #176205 Mar 13, 2017 20:42
  • Member since: 2011

    Did this work before on a previous version? (I currently have no idea what is wrong, but first step is to limit the scope)

    #176215 Mar 14, 2017 0:28
  • Member since: 2014

    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.

    #176248 Mar 14, 2017 13:36
  • Member since: 2012

    This will be a bug and we will fix this soon.

    #176475 Mar 20, 2017 11:00
  • Member since: 2014

    Thanks @Son for the update!

    #176507 Mar 20, 2017 14:54
  • Hi,

    I just want to inform that the problem was fixed in 10.4.3

    #178290 May 08, 2017 5:56