Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Order addresses are useful when you manage address data retrieved from Customer Management and Order Management, since they use different models for storing data: one uses Meta Data Plus, and the other uses Business Foundation (BF).
Classes in this topic are available in the following namespaces:
* Metaclass from Meta Data Plus; ** BF class
Example: retrieving a customer's preferred shipping address
CustomerContact contact = CustomerContext.Current.GetContactForUser(SecurityContext.Current.CurrentUser);
CustomerProfileWrapper customerProfile = SecurityContext.Current.CurrentUserProfile as CustomerProfileWrapper;
IEnumerable addresses = contact.ContactAddresses;
foreach (CustomerAddress ca in addresses)
{
if (ca.Name == customerProfile.PreferredShippingAddress)
{
//we have the preferred shipping address
}
}
Example: retrieving a shipping address
string shippingAddressName = cart.OrderForms[0].Shipments[0].ShippingAddressId;OrderAddressCollection addresses = cart.OrderAddresses;
foreach (OrderAddress oa in addresses)
{
if (oa.Name == shippingAddressName)
{
//we have found the shipping address
}
}
Last updated: Oct 12, 2015