Share via


Commerce Foundation LineItem

This Commerce Server 2009 commerce entity represents a product added to a basket. A Microsoft Multi-Channel Commerce Foundation Line Item contains the product identifiers (catalog, product ID, and variant ID), as well as other information required for display, such as display name, quantity, costs, applied discounts, and so on. In addition to these, it also contains instructions for shipping and packaging. The Line Item is not a data entity that can live by itself; it must be associated with a basket.

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="LineItem">
    <EntityMappings>
      <EntityMapping csType="Microsoft.CommerceServer.Runtime.Orders.LineItem" csAssembly="Microsoft.CommerceServer.Runtime, Version=6.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
        <PropertyMappings>
          <PropertyMapping property="Id" csProperty="LineItemId"/>
          <PropertyMapping property="DateCreated" csProperty="Created"/>
          <PropertyMapping property="DateModified" csProperty="LastModified"/>
          <PropertyMapping property="BasketLevelDiscountAmount" csProperty="OrderLevelDiscountAmount"/>
          <PropertyMapping property="CatalogName" csProperty="ProductCatalog"/>
          <PropertyMapping property="ItemLevelDiscountAmount" csProperty="LineItemDiscountAmount"/>
          <PropertyMapping property="VariantId" csProperty="ProductVariantId"/>
          <PropertyMapping property="Total" csProperty="ExtendedPrice"/>
          <PropertyMapping property="ItemPriority" csProperty="ItemPriority"/>
          <PropertyMapping property="GiftMessage" csProperty="GiftMessage"/>
          <PropertyMapping property="GiftWrap" csProperty="GiftWrap"/>
        </PropertyMappings>
      </EntityMapping>
    </EntityMappings>
    <Properties>
      <Property name="ItemPriority" dataType="Integer" />
      <Property name="GiftMessage" dataType="String" />
      <Property name="GiftWrap" dataType="Boolean" />
    </Properties>
</CommerceEntity>

Properties

Property

Type

Description

BasketLevelDiscountAmount

decimal?

Gets or sets the basket level discount amount for a line item.

CatalogName

String

Gets or sets the name of the catalog with which the current line item is associated.

DateCreated

DateTime?

Gets or sets the date the commerce entity was created.

DateModified

DateTime?

Gets or sets the date the commerce entity was modified.

GiftMessage

String

Gets or sets if this item's gift message.

GiftWrap

bool?

Gets or sets a value indicating whether this item should be gift wrapped.

Id

String

Unique identifier of the commerce entity.

InventoryCondition

int?

ValueDescription
0InStock. SKU is in stock. Indicates that the quantity is in stock to meet the request.
1Preordered. SKU is pre-ordered. If a product or variant is considered "pre-ordered" by the Inventory System, the system always display the product, and a shopper can purchase the product on the site.
2Backordered. Stock-keeping unit (SKU) is back-ordered. If a product or variant is considered on back-order by the Inventory System, it may not be shown, may be shown as back-ordered and not available, or back-ordered but still available to order.
3OutOfStock. SKU is out of stock. Indicated when a SKU can no longer be sold due to quantity conditions, it has been disabled, or if it’s missing (depending on the site configuration).

InStockQuantity

decimal?

Gets or sets the in-stock quantity for the current line item.

ListPrice

decimal?

Gets or sets the current list price of the line item in the product catalog.

PlacedPrice

decimal?

Gets or sets the unit price of the line item at the time it was added to the basket.

ProductId

String

Gets or sets the identifier of the product associated with the current line item.

Quantity

decimal?

Gets or sets the number of units associated with the current line item.

ShippingAddressId

String

Gets or sets the shipping address identifier associated with the current line item.

ShippingMethodId

String

Gets or sets the shipping method identifier associated with the current line item.

Status

String

Gets or sets the status of the current line item.

ItemLevelDiscountAmount

decimal?

Gets or sets the sum of all line item-based discount amounts for a single line item.

ItemPriority

int?

Gets or sets the priority code of this item. Use in ShoppingList or GiftRegistry to set a priority for the items.

Total

decimal?

Gets or sets the total price of the current line item when it was added to the basket.

VariantId

String

Gets or sets the product variant identifier for the current line item.

Relationships

Property

Description

BasketLevelDiscounts

Gets the collection of basket-level discounts applied for the current LineItem.

ItemLevelDiscounts

Gets the collection of line item-level discounts applied to the current LineItem.

Supported Operations

Commerce Foundation Basket CommerceQuery

Commerce Foundation Basket CommerceUpdate

See Also

Other Resources

Developing with the Commerce Foundation Orders System

Commerce Foundation Basket