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 managing address data retrieved from Customer Management and Order Management, since these use different models for storing data, where one uses Meta Data Plus and the other Business Foundation.
Classes referred to here are available in the following namespaces:
* Metaclass from Meta Data Plus; ** Business Foundation class
Example: retrieving the preferred shipping address for a customer
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 21, 2014