Share via


Commerce Foundation Basket

This Commerce Server 2009 commerce entity is used to represent an order that may contain line items, shipments, addresses, payments, requested promotion codes, properties exposing various rebates and totals, as well as other related products (based on the products in the cart).

Model

This commerce entity can be modified, as required. This model, taken from the out-of-the-box site, is provided as an example.

<CommerceEntity name="Basket">
    <DisplayName value="Basket">
      <LanguageSpecific language="en" value="Basket"/>
      <LanguageSpecific language="de" value="Warenkorb"/>
      <LanguageSpecific language="fr" value="Panier" />
      <LanguageSpecific language="ja" value="バスケット" />
    </DisplayName>
    <EntityMappings>
      <EntityMapping csType="Microsoft.CommerceServer.Runtime.Orders.OrderForm" csAssembly="Microsoft.CommerceServer.Runtime, Version=6.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
        <PropertyMappings>
          <PropertyMapping property="Id" csProperty="OrderGroupId" />
          <PropertyMapping property="DateCreated" csProperty="Created" />
          <PropertyMapping property="DateModified" csProperty="LastModified" />
          <PropertyMapping property="SubTotal" csProperty="SubTotal"/>
          <PropertyMapping property="BillingCurrency" csProperty="BillingCurrency"/>
          <PropertyMapping property="OrderNumber" csProperty="TrackingNumber"/>
          <PropertyMapping property="UserId" csProperty="SoldToId"/>
          <PropertyMapping property="BasketLevelDiscountsTotal" csProperty="BasketLevelDiscountsTotal"/>
          <PropertyMapping property="BasketType" csProperty="BasketType"/>
          <PropertyMapping property="DiscountsTotal" csProperty="DiscountsTotal"/>
          <PropertyMapping property="LineItemDiscountsTotal"  csProperty="LineItemDiscountsTotal"/>
          <PropertyMapping property="ShippingDiscountsTotal"  csProperty="ShippingDiscountsTotal"/>
          <PropertyMapping property="BasketErrors" csProperty="_Basket_Errors"/>
          <PropertyMapping property="PurchaseErrors" csProperty="_Purchase_Errors"/>
        </PropertyMappings>
      </EntityMapping>
    </EntityMappings>
    <Properties>
      <Property name="BillingCurrency" dataType="String" isStronglyTyped="true" >
        <DisplayName value="Billing Currency">
          <LanguageSpecific language="en" value="Billing Currency"/>
        </DisplayName>
      </Property>
      <Property name="OrderNumber" dataType="String" isStronglyTyped="true" >
        <DisplayName value="Order Number">
          <LanguageSpecific language="en" value="Order Number"/>
        </DisplayName>
        <Constraints>
          <Range minValue="0" minBoundaryType="Include" maxValue="32"  maxBoundaryType="Include" />
        </Constraints>
      </Property>
      <Property name="UserId" dataType="String" isStronglyTyped="true" >
        <DisplayName value="User ID">
          <LanguageSpecific language="en" value="User ID"/>
        </DisplayName>
      </Property>
      <Property name="BasketLevelDiscountsTotal" dataType="Decimal" />
      <Property name="BasketType" dataType="Integer">
        <EnumeratedValues >
          <EnumerationEntry value="0">
        <DisplayName value="Cart" />
          </EnumerationEntry>
          <EnumerationEntry value="1">
        <DisplayName value="Order" />
          </EnumerationEntry>
        </EnumeratedValues>
      </Property>
      <Property name="DiscountsTotal" dataType="Decimal" />
      <Property name="LineItemDiscountsTotal" dataType="Decimal" />
      <Property name="ShippingDiscountsTotal" dataType="Decimal" />
      <Property name="BasketErrors" dataType="Array" />
      <Property name="PurchaseErrors" dataType="Array" />
    </Properties>
</CommerceEntity>

Properties

Property

Type

Description

Basket_Errors

String[]

Array of messages, filled in if any Commerce Server pipeline components encountered errors while running the Commerce Server basket or total pipeline.

BasketLevelDiscountsTotal

decimal?

Sum of the basket level discount amounts applied to line items.

BasketType

int?

Type of basket specified as follows:

0 - Cart

1 - Order

BillingCurrency

String

Currency the site uses for billing.

DateCreated

DateTime?

Date the commerce entity was created.

DateModified

DateTime?

Date the commerce entity was modified.

DiscountsTotal

decimal?

Total of discounts, which is the sum of LineItem, BasketLevel, and Shipping discount totals.

HandlingTotal

decimal?

The total handling charge for the current basket.

Id

String

Unique identifier of the commerce entity.

LineItemDiscountsTotal

decimal?

Sum of the discount amounts applied to line items.

Name

String

Gets or sets the name of the basket.

OrderNumber

String

A string value that uniquely identifies a placed order.

Purchase_Errors

String[]

Array of messages, filled in if any Commerce Server components encountered any errors that occurred while running the Commerce Server checkout pipeline.

ShipppingDiscountsTotal

decimal?

Sum of the discount amounts applied to shipping.

ShippingTotal

decimal?

The total shipping charges associated with the current instance, after all the applicable shipping discounts have been applied.

Status

String

Gets or sets the status of the current basket. This value may be user-defined, but known values include:

InProcess - The basket is still being built. Totals are not ready for review.

Subtotal

decimal?

Total amount for the current basket, after line item totals and line item discounts have been applied, but before shipping, shipping discounts, handling and taxes have been applied.

TaxTotal

decimal?

The sum total of sub total, shipping, handling and taxes for the current basket.

UserId

String

User identifier of the shopper to which the basket belongs.

Relationships

Property

Description

Addresses

List of addresses for the current basket.

LineItems

List of line items associated with the current basket.

Payments

List of payments for the current basket.

RequestedPromoCodes

List or marketing promotion codes associated with the current basket.

Shipments

List of shipments associated with the current basket.

TargetingContext

The targeting context associated with the current basket.

Supported Operations

The Basket commerce entity supports the following operations:

Commerce Foundation Basket CommerceDelete

Commerce Foundation Basket CommerceQuery

Commerce Foundation Basket CommerceUpdate

Unlike other Commerce Server 2009 commerce entities, baskets are not created explicitly. When a CommerceQuery or CommerceUpdate operation is performed, if the basket does not already exist, it will be created dynamically.

See Also

Other Resources

Developing with the Commerce Foundation Orders System

Commerce Foundation Address

Commerce Foundation Basket Order Search

Commerce Foundation LineItem

Commerce Foundation Payment

Commerce Foundation RequestedPromoCode

Commerce Foundation Shipment

Commerce Foundation TargetingContext

Commerce Foundation Basket CommerceDelete

Commerce Foundation Basket CommerceQuery

Commerce Foundation Basket CommerceUpdate