Dynamicweb 8 Documentation
GetOrderFieldValue Method
Example 

Name of the system.
Gets the OrderFieldValue object.
Syntax
'Declaration
 
Public Function GetOrderFieldValue( _ 
   ByVal SystemName As String _ 
) As OrderFieldValue
public OrderFieldValue GetOrderFieldValue( 
   string SystemName 
)

Parameters

SystemName
Name of the system.
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" );    
        }
 
    }
}
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 Class
OrderFieldValueCollection Members

Send Feedback