Dynamicweb 8 Documentation
OrderFieldValueCollection Class
Members  Example 

Represents a collection of the OrderFieldValue objects.
Object Model
OrderFieldValueCollection ClassOrderFieldValue Class
Syntax
'Declaration
 
<SerializableAttribute()> 
Public Class OrderFieldValueCollection 
   Inherits System.Collections.ObjectModel.Collection(Of OrderFieldValue)
Example
The example shows how you can manipulate the information in custom order fields. The following shows an example where a class subscribes to the notification Dynamicweb.Notifications.eCommerce.Order.Steps.Completed, which can be used to manage the custom order field information.
[Subscribe(Dynamicweb.Notifications.eCommerce.Order.Steps.Completed)]
public class OrderCompleteNotificationSubscriber : NotificationSubscriber
{
    public override void OnNotify(string notification, object[] args)
    {
        bool sendNewsletter = false;
        string emailAddress = "";
 
        Dynamicweb.eCommerce.Orders.Order MyOrder = (Dynamicweb.eCommerce.Orders.Order)args[0];
        OrderFieldValueCollection ofvCol = MyOrder.OrderFieldValues;
        OrderFieldValue orderField = ofvCol.GetOrderFieldValue("newsletteremail");
        if (orderField != null)
        {
               emailAddress = orderField.Value.ToString();
               sendNewsletter = true;
               break;
        }
 
        if (sendNewsletter)
        { 
           SendEmail( emailAddress, "Order is completed" );    
        }
 
    }
}
Inheritance Hierarchy

System.Object
   System.Collections.ObjectModel.Collection<T>
      Dynamicweb.eCommerce.Orders.OrderFieldValueCollection

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

OrderFieldValueCollection Members
Dynamicweb.eCommerce.Orders Namespace

Send Feedback