How To: NopCommerce Best Practices for Order table
NopCommerce Versions: 3.7
NOTE: DRAFT IN PROGRESS
The Order table captures both registered Customers and Guest orders.
Registered Customer Orders will use the Customer.Id associated to them at registration. During checkout, users are prompted for the billing and shipping address. The billing and shipping Address records are duplicated as point in time records and associated to the Order.
Guest Checkout Orders orders will leave a cookie on the client with a generated ID that was created in the Customer table. The Next time the registered Guest user comes to the site and places an order as Guest, it will use the originally created Customer.Id to use and associate to the Order. If the user decides to register at this point, it will use the originally created Customer record associated to the cookie.ID to be used for the newly registered account.
You will find that any time an order is placed, a point in time copy of a billing and shipping address record is created and associated to the order. This allows the order to have historical records at that point in time. The created address will not by modified again.
Table: Order
- AffiliateId (int, 4)
- AllowStoringCreditCardNumber (bit, 1)
- AuthorizationTransactionCode (nvarchar, not null)
- AuthorizationTransactionId (nvarchar, not null)
- AuthorizationTransactionResult (nvarchar, not null)
- BillingAddressId (int, 4)
- CaptureTransactionId (nvarchar, not null)
- CaptureTransactionResult (nvarchar, not null)
- CardCvv2 (nvarchar, not null)
- CardExpirationMonth (nvarchar, not null)
- CardExpirationYear (nvarchar, not null)
- CardName (nvarchar, not null)
- CardNumber (nvarchar, not null)
- CardType (nvarchar, not null)
- CheckoutAttributeDescription (nvarchar, not null)
- CheckoutAttributesXml (nvarchar, not null)
- CreatedOnUtc (datetime, 8)
- CurrencyRate (decimal, 9)
- CustomerCurrencyCode (nvarchar, not null)
- CustomerId (int, 4)
- CustomerIp (nvarchar, not null)
- CustomerLanguageId (int, 4)
- CustomerTaxDisplayTypeId (int, 4)
- CustomValuesXml (nvarchar, not null)
- Deleted (bit, 1)
- ForEndCustomerCompanyAddressId (int, 4, not null)
- ForEndCustomerCompanyId (int, 4, not null)
- ForResellerCompanyAddressId (int, 4, not null)
- ForResellerCompanyId (int, 4, not null)
- ForResellerCompanyTypeId (int, 4, not null)
- Id (PK, int, 4)
- IsTransferable (bit, 1)
- MaskedCreditCardNumber (nvarchar, not null)
- OrderDiscount (decimal, 9)
- OrderGuid (uniqueidentifier, 16)
- OrderShippingExclTax (decimal, 9)
- OrderShippingInclTax (decimal, 9)
- OrderStatusId (int, 4)
- OrderSubTotalDiscountExclTax (decimal, 9)
- OrderSubTotalDiscountInclTax (decimal, 9)
- OrderSubtotalExclTax (decimal, 9)
- OrderSubtotalInclTax (decimal, 9)
- OrderTax (decimal, 9)
- OrderTotal (decimal, 9)
- PaidDateUtc (datetime, 8, not null)
- PaymentMethodAdditionalFeeExclTax (decimal, 9)
- PaymentMethodAdditionalFeeInclTax (decimal, 9)
- PaymentMethodSystemName (nvarchar, not null) - This is the name of the plugin system name used to do the payment. Example: Payments.PurchaseOrder (Nop.Plugin.Payments.Manual), Payments.Manual (Nop.Plugin.Payments.Manual).
- PaymentStatusId (int, 4)
- PickUpInStore (bit, 1)
- RefundedAmount (decimal, 9)
- RewardPointsWereAdded (bit, 1)
- ShippingAddressId (int, 4, not null)
- ShippingMethod (nvarchar, not null)
- ShippingRateComputationMethodSystemName (nvarchar, not null)
- ShippingStatusId (int, 4)
- StoreId (int, 4)
- SubscriptionTransactionId (nvarchar, not null)
- TaxRates (nvarchar, not null)
- VatNumber (nvarchar, not null)
Related Tables:
- OrderItem
- OrderNote
- GenericAttribute
Uses:
- Check Out > Registered User:
- Checkout > Guest:
- Admin > Order:
Extending: