Class OrderViewModel
- Namespace
- Dynamicweb.Ecommerce.Frontend
- Assembly
- Dynamicweb.Ecommerce.dll
Represents the context of an order when rendered on the frontend, containing all relevant order data. This includes everything from basic order details like order id, shop id, to customer and payment information.
public class OrderViewModel : FillableViewModelBase
- Inheritance
-
OrderViewModel
- Inherited Members
- Extension Methods
Properties
Comment
Gets the comment on the order.
public string Comment { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
Completed
See Complete.
public bool? Completed { get; set; }
Property Value
- bool?
Cannot actually be null
Remarks
Eager loaded - always available and using it does not come with an overhead.
CompletedDate
Gets the date and time for this order is complete. It's set when Complete is changed to true.
public DateTime? CompletedDate { get; set; }
Property Value
- DateTime?
Null if Complete has never been set to true, otherwise the latest date time of when it was set to true
Remarks
Eager loaded - always available and using it does not come with an overhead.
CreatedAt
Gets the date and time for when this order was created in the database.
public DateTime CreatedAt { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
- See Also
CustomerAccepted
Gets a value indicating whether customer has accepted order terms and conditions.
public bool? CustomerAccepted { get; set; }
Property Value
- bool?
Nullable, however can only be null if a new OrderViewModel is created, never null if it's created based on an Order, then it defaults to false.
Remarks
Eager loaded - always available and using it does not come with an overhead.
CustomerAddress
Gets the address for the customer whos order this is.
public string CustomerAddress { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
CustomerAddress2
Gets the secondary address for the customer whos order this is.
public string CustomerAddress2 { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
CustomerAddressId
Gets the address id related to the address for the customer whos order this is. Used with GetAddressById(int) to get a UserAddress.
public int CustomerAddressId { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
CustomerCell
Gets the cellphone number for the customer whos order this is.
public string CustomerCell { get; set; }
Property Value
- string
Any phone number formats are accepted.
Remarks
Eager loaded - always available and using it does not come with an overhead.
CustomerCity
Gets the city for the customer whos order this is.
public string CustomerCity { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
CustomerComment
Gets any additional comments provided by the customer regarding the order.
public string CustomerComment { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
CustomerCompany
Gets the company name for the customer whos order this is.
public string CustomerCompany { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
CustomerCountry
Gets the country for the customer whos order this is.
public string CustomerCountry { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
CustomerCountryCode
Gets the country code for the customer whos order this is.
public string CustomerCountryCode { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
CustomerEan
Gets the European Article Number (EAN) for the customer whos order this is.
public string CustomerEan { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
CustomerEmail
Gets the email for the customer whos order this is.
public string CustomerEmail { get; set; }
Property Value
- string
Any string can be stored but is often checked with IsValidEmailAddress(string?)
Remarks
Eager loaded - always available and using it does not come with an overhead.
CustomerFirstName
Gets the first name for the customer whos order this is.
public string CustomerFirstName { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
CustomerHouseNumber
Gets the house number for the customer whos order this is.
public string CustomerHouseNumber { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
CustomerInitials
Gets the initials for the customer whos order this is.
public string CustomerInitials { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
CustomerMiddleName
Gets the surname or middle name for the customer whos order this is.
public string CustomerMiddleName { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
CustomerName
Gets the full name for the customer whos order this is.
public string CustomerName { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
CustomerNumber
Gets the customer number for the customer whos order this is.
public string CustomerNumber { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
CustomerPhone
Gets the phone number for the customer whos order this is.
public string CustomerPhone { get; set; }
Property Value
- string
Any phone number formats are accepted.
Remarks
Eager loaded - always available and using it does not come with an overhead.
CustomerPrefix
Gets the prefix for the customer whos order this is.
public string CustomerPrefix { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
CustomerRefId
P.O number, purchase order
public string CustomerRefId { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
CustomerRegion
Gets the region, state, or province related to the customer whos order this is.
public string CustomerRegion { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
CustomerSurname
Gets the surname or last name for the customer whos order this is.
public string CustomerSurname { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
CustomerTitle
Gets the title for the customer whos order this is.
public string CustomerTitle { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
CustomerUserId
The user id of the customer whos order this is. Used with UserManagementServices GetUserById(int).
public int CustomerUserId { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
CustomerVatRegNumber
Gets the vat registration number for the customer who's order this is.
public string CustomerVatRegNumber { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
CustomerZip
Gets the zip code for the customer whos order this is.
public string CustomerZip { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
DeliveryAddress
Gets the primary address line for the delivery location.
public string DeliveryAddress { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
DeliveryAddress2
Gets the secondary address line for the delivery location.
public string DeliveryAddress2 { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
DeliveryAddressId
Gets the id for the delivery address, linking to a detailed address record.
public int DeliveryAddressId { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
DeliveryCell
Gets the mobile or cellular phone number associated with the delivery contact.
public string DeliveryCell { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
DeliveryCity
Gets the city for the delivery address.
public string DeliveryCity { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
DeliveryCompany
Gets the name of the company where the order is to be delivered, if different from the billing address.
public string DeliveryCompany { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
DeliveryCountry
Gets the country of the delivery address.
public string DeliveryCountry { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
DeliveryCountryCode
Gets the country code for the delivery address, used in international shipping and communications.
public string DeliveryCountryCode { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
DeliveryEmail
Gets the email address associated with the delivery location or contact.
public string DeliveryEmail { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
DeliveryFirstName
Gets the first name of the individual to whom the order is being delivered.
public string DeliveryFirstName { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
DeliveryHouseNumber
Gets the house or apartment number of the delivery address.
public string DeliveryHouseNumber { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
DeliveryInitials
Gets the initials of the delivery recipient.
public string DeliveryInitials { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
DeliveryMiddleName
Gets the middle name of the individual to whom the order is being delivered.
public string DeliveryMiddleName { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
DeliveryName
Gets the full name of the individual or entity where the order is to be delivered.
public string DeliveryName { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
- See Also
DeliveryPhone
Gets the phone number associated with the delivery address.
public string DeliveryPhone { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
DeliveryPrefix
Gets the prefix or formal title used in addressing the delivery recipient.
public string DeliveryPrefix { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
DeliveryRegion
Gets the region, state, or province for the delivery address.
public string DeliveryRegion { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
DeliverySurname
Gets the surname of the individual to whom the order is being delivered.
public string DeliverySurname { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
DeliveryTitle
Gets the title or honorific of the individual to whom the order is being delivered.
public string DeliveryTitle { get; set; }
Property Value
- string
Delivery title as a string, example: 'Dr.'
Remarks
Eager loaded - always available and using it does not come with an overhead.
DeliveryZip
Gets the postal or ZIP code for the delivery address.
public string DeliveryZip { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
DisplayName
Gets a friendly name for the order.
If the 'setname' cart command is used, this will be set to Context.Current.Request["CartName"]
public string DisplayName { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
DueDate
Gets or sets the due date.
public DateTime? DueDate { get; set; }
Property Value
Id
Gets or sets the order Id. When this is a cart, it will be one value and once the cart is converted to an order it will change to an order id Secret of this order will not change and the AutoId will also not change
public string Id { get; set; }
Property Value
- string
CART123 or ORDER123
Remarks
The ID is created by the autonumbering feature and the prefix and number series prefix and value can be defined in settings
IntegrationOrderId
Gets the order id which can be set from an integration job to have both the ERP order id as well as the Id.
public string IntegrationOrderId { get; set; }
Property Value
- string
Defaults to an empty string, otherwise any id set from an ERP system
Remarks
Eager loaded - always available and using it does not come with an overhead.
LedgerType
Gets the ledger type. Informational only, used for integration, set if LedgerEntry.
public string LedgerType { get; set; }
Property Value
- string
E.g. 'Invoice', 'Payment'
Remarks
Eager loaded - always available and using it does not come with an overhead.
Modified
Gets the date and time for when this order was last updated.
public DateTime Modified { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
- See Also
NewsletterSubscribe
Gets a value indicating whether the customer has subscribed to receive newsletters.
public bool NewsletterSubscribe { get; set; }
Property Value
- bool
Not nullable, defaults to false
Remarks
Eager loaded - always available and using it does not come with an overhead.
OrderFields
Gets a dictionary of custom fields associated with this order.
public Dictionary<string, FieldValueViewModel> OrderFields { get; set; }
Property Value
- Dictionary<string, FieldValueViewModel>
A dictionary where the key is the system name of the field
Remarks
Lazy loaded - only filled when using it. Comes with a performance hit when used.
OrderLines
Gets a list of orderlines. The properties retrieved from these orderlines are based on the OrderLineViewModelSettings used when converting an order to a view model.
public IList<OrderLineViewModel> OrderLines { get; set; }
Property Value
Remarks
Lazy loaded - only filled when using it. Comes with a performance hit when used.
ParentOrderId
Gets the id for the parent order. Not used internally for any logic.
public string ParentOrderId { get; set; }
Property Value
- string
E.g 'ORDER112'
Remarks
Eager loaded - always available and using it does not come with an overhead.
PaymentFee
Gets the payment fee for the order. Uses the id from the PaymentMethod to calculate the price.
public PriceViewModel PaymentFee { get; set; }
Property Value
Remarks
Lazy loaded - only filled when using it. Comes with a performance hit when used.
PaymentMethod
Gets the payment method for this order.
public PaymentViewModel PaymentMethod { get; set; }
Property Value
Remarks
Lazy loaded - only filled when using it. Comes with a performance hit when used.
Price
Gets the price for the order. Calculates the price based on the OrderLines, then adds ShippingFee and PaymentFee onto it.
public PriceViewModel Price { get; set; }
Property Value
Remarks
Lazy loaded - only filled when using it. Comes with a performance hit when used.
- See Also
PriceBeforeFees
Gets the price before fees for the order. Calculates the price based on the OrderLines without adding ShippingFee and PaymentFee onto it.
public PriceViewModel PriceBeforeFees { get; set; }
Property Value
Remarks
Lazy loaded - only filled when using it. Comes with a performance hit when used.
- See Also
PurchaseOrderNumber
Gets or sets the Purchase order number (PO number).
public string PurchaseOrderNumber { get; set; }
Property Value
RecurringOrderId
Gets the recurring order id, used to get the RecurringOrder with GetById(int).
public int? RecurringOrderId { get; set; }
Property Value
- int?
Defaults to 0 if none is set
Remarks
Eager loaded - always available and using it does not come with an overhead.
Reference
Gets the reference. Informational only, set during integration of order from external systems.
public string Reference { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
- See Also
SecondaryUserId
If a customer is being impersonated, this id is set to the id of the user doing the impersonating.
public int SecondaryUserId { get; set; }
Property Value
- int
Not nullable, so will default to 0 if no one is impersonating the user.
Remarks
Eager loaded - always available and using it does not come with an overhead.
Secret
Gets or sets the order secret. The secret is a hash that will not change after the instance of an order is created. The secret is used in checkout flows, receipt page, emails and in the web-api to identify the order. The order can be retrieved with the secret using GetBySecret(string) or /dwapi/ecommerce/carts/{secret} endpoint.
public string Secret { get; set; }
Property Value
- string
E.g. a480a17e0d9e40a9bd3499be74db1b8f
ShippingDate
Gets the planned date for shipping the order, often set in the future.
public DateTime? ShippingDate { get; set; }
Property Value
- DateTime?
Null if the order is not shipped
Remarks
Eager loaded - always available and using it does not come with an overhead.
ShippingFee
Gets the shipping fee for the order. Uses the id from the ShippingMethod to calculate the price.
public PriceViewModel ShippingFee { get; set; }
Property Value
Remarks
Lazy loaded - only filled when using it. Comes with a performance hit when used.
ShippingMethod
Gets the shipping method for this order.
public ShippingViewModel ShippingMethod { get; set; }
Property Value
Remarks
Lazy loaded - only filled when using it. Comes with a performance hit when used.
ShopId
Gets the id of the shop where the order was created.
public string ShopId { get; set; }
Property Value
- string
E.g 'SHOP1'
Remarks
Eager loaded - always available and using it does not come with an overhead.
StateDescription
Gets the description of the current order state, providing additional context for backend operations and support.
public string StateDescription { get; set; }
Property Value
- string
E.g. New orders, Completed orders, Rejected orders, Deleted orders
Remarks
Lazy loaded - only filled when using it. Comes with a performance hit when used.
StateId
Gets the state id of the order.
public string StateId { get; set; }
Property Value
- string
E.g. OS1
Remarks
Eager loaded - always available and using it does not come with an overhead.
StateName
Gets the name of the state related by the StateId. Uses the LanguageId to get the proper translation.
public string StateName { get; set; }
Property Value
- string
E.g. Completed, New, Important
Remarks
Lazy loaded - only filled when using it. Comes with a performance hit when used.
TotalDiscount
Gets the total discount amount for this order, summarizing all discount orderlines. Finds all orderlines where OrderLineType is Discount or ProductDiscount and runs the price calculation on that collection.
public PriceViewModel TotalDiscount { get; set; }
Property Value
Remarks
Lazy loaded - only filled when using it. Comes with a performance hit when used.
- See Also
TotalOrderDiscount
Gets the total order discount amount for this order, summarizing all order discount orderlines. Finds all orderlines where OrderLineType is Discount and runs the price calculation on that collection.
public PriceViewModel TotalOrderDiscount { get; set; }
Property Value
Remarks
Lazy loaded - only filled when using it. Comes with a performance hit when used.
- See Also
TotalPriceBeforeFeesAndTaxes
Gets the price before fees and taxes for the order. Subtracts the ShippingFee, PaymentFee and TotalTaxes from the price.
public PriceViewModel TotalPriceBeforeFeesAndTaxes { get; set; }
Property Value
Remarks
Lazy loaded - only filled when using it. Comes with a performance hit when used.
- See Also
TotalPriceWithoutDiscountsFeesAndTaxes
Gets the price before fees, taxes and discounts for the order. Subtracts the TotalTaxes, TotalDiscount, ShippingFee and PaymentFee from the price.
public PriceViewModel TotalPriceWithoutDiscountsFeesAndTaxes { get; set; }
Property Value
Remarks
Lazy loaded - only filled when using it. Comes with a performance hit when used.
- See Also
TotalPriceWithoutOrderDiscountsAndFeesAndTaxes
Gets the price before fees, order discounts and taxes for the order. Subtracts the ShippingFee, PaymentFee, TotalOrderDiscount and TotalTaxes from the price.
public PriceViewModel TotalPriceWithoutOrderDiscountsAndFeesAndTaxes { get; set; }
Property Value
Remarks
Lazy loaded - only filled when using it. Comes with a performance hit when used.
- See Also
TotalProductDiscount
Gets the total product discount amount for this order, summarizing all product discount orderlines. Finds all orderlines where OrderLineType is ProductDiscount and runs the price calculation on that collection.
public PriceViewModel TotalProductDiscount { get; set; }
Property Value
Remarks
Lazy loaded - only filled when using it. Comes with a performance hit when used.
- See Also
TotalTaxes
Gets the total tax amount for this order, summarizing all tax orderlines. Finds all orderlines where OrderLineType is Tax and runs the price calculation on that collection.
public PriceViewModel TotalTaxes { get; set; }
Property Value
Remarks
Lazy loaded - only filled when using it. Comes with a performance hit when used.
- See Also
TrackAndTraceName
Gets the name or identifier of the track and trace service used for the delivery.
public string TrackAndTraceName { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
TrackAndTraceNumber
Gets the tracking number of the package.
public string TrackAndTraceNumber { get; set; }
Property Value
Remarks
Eager loaded - always available and using it does not come with an overhead.
- See Also
TrackAndTraceURL
Gets the URL for tracking the order's delivery status online.
public string TrackAndTraceURL { get; set; }
Property Value
- string
Track and trace URL as a string, example: 'https://track.fedex.com/123456789'
Remarks
Eager loaded - always available and using it does not come with an overhead.
TransactionCardType
Gets the type of card used in the transaction, such as Visa or MasterCard.
public string TransactionCardType { get; set; }
Property Value
- string
Defaults to empty string
Remarks
Eager loaded - always available and using it does not come with an overhead.
TransactionCardnumber
Gets the card number used in the transaction, typically masked for security.
public string TransactionCardnumber { get; set; }
Property Value
- string
Transaction card number as a string, e.g. '**** **** **** 1234'
Remarks
Eager loaded - always available and using it does not come with an overhead.
TransactionNumber
Gets the unique transaction number associated with the order's payment.
public string TransactionNumber { get; set; }
Property Value
- string
Defaults to empty string
Remarks
Eager loaded - always available and using it does not come with an overhead.
TransactionStatus
Gets the current status of the transaction, such as 'pending', 'completed', or 'failed'.
public string TransactionStatus { get; set; }
Property Value
- string
Defaults to empty string
Remarks
Eager loaded - always available and using it does not come with an overhead.
Volume
Gets total volume of all products in the order, can be used for i.e calculating additional fees.
Uses the system default unit, located in /GlobalSettings/Ecom/Unit/Volume
public double Volume { get; set; }
Property Value
- double
E.g. 'm³'
Remarks
Eager loaded - always available and using it does not come with an overhead.
VoucherCode
The voucher code set on the Order.
The voucher code will check if it exists and has a valid VoucherList.
public string VoucherCode { get; set; }
Property Value
- string
E.g 'SPRINGSALE20'
Remarks
Eager loaded - always available and using it does not come with an overhead.
Weight
Gets the total weight of all products in the order, can be used for i.e calculating shipping costs.
Uses the system default unit, located in /GlobalSettings/Ecom/Unit/Weight
public double Weight { get; set; }
Property Value
- double
E.g. 'Kg'
Remarks
Eager loaded - always available and using it does not come with an overhead.