Dynamicweb.eCommerce.Orders Namespace : OrderFieldValue Class |
'Declaration
<SerializableAttribute()> Public Class OrderFieldValue
[SerializableAttribute()] public class OrderFieldValue
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; foreach (OrderFieldValue orderField in ofvCol) { if (orderField.OrderField.SystemName.ToLower() == "newsletteremail") { emailAddress = orderField.Value.ToString(); sendNewsletter = true; break; } } if (sendNewsletter) { SendEmail( emailAddress, "Order is completed" ); } } }
class MyPage : System.Web.UI.Page { public void CustomOrderFields(Order order) { FieldTypeCollection fieldTypes = FieldType.getFieldTypes(); foreach (OrderFieldValue ofv in order.OrderFieldValues) { FieldType ft = fieldTypes.GetFieldType(ofv.OrderField.TypeID); string reqValue = Base.ChkString(Base.Request(ofv.OrderField.SystemName)); switch (ft.DWName.ToLower()) { case "text": case "largetext": case "integer": case "double": ofv.Value = Base.ChkString(Base.Request(ofv.OrderField.SystemName, false)); break; case "checkbox": ofv.Value = !string.IsNullOrEmpty(reqValue); break; case "date": case "datetime": ofv.Value = Dates.ParseAsDate(ofv.OrderField.SystemName); break; case "link": ofv.Value = reqValue; break; case "filemanager": ofv.Value = reqValue; break; default: break; } } } }
System.Object
Dynamicweb.eCommerce.Orders.OrderFieldValue
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