Hi Dynamicweb,
I have a issue with my date fields created as Order Fields as the valued is cleared when not having the field on the cart. I have pasted some code from Dynamicweb.eCommerce.Cart.Frontend.vb and does not understand the line marked with red and I do not understand why a value which is not in the request is updated?
Dim value As String = Base.Request(orderFieldValue.OrderField.SystemName, False)
Dim fieldType As String = fieldTypes.GetFieldType(orderFieldValue.OrderField.TypeID).DWName.ToLower()
' date/datetime control doesn't produce request with systemname
If value Is Nothing AndAlso Not {"date", "datetime"}.Contains(fieldType) Then
Continue For
End If
Dim valueChanged As Boolean = value <> Base.ChkString(orderFieldValue.Value)
If fieldType.Equals("checkbox") Then
valueChanged = Base.ChkBoolean(orderFieldValue.Value) = (value <> "")
ElseIf fieldType.Equals("date") OrElse fieldType.Equals("datetime") Then
valueChanged = Not Base.ChkDate(orderFieldValue.Value).Equals(Dates.ParseAsDate(orderFieldValue.OrderField.SystemName))
End If
Is tries to compare whether the current date in the OrderField is the same as the SystemName? I hope that someone can solve this for me?
Best regards, Anders