Share via


Commerce Foundation Discount

Represents the result of a discount applied to a basket, shipment, or line item.

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="Discount">

        <EntityMappings>
          <EntityMapping
csType="Microsoft.CommerceServer.Runtime.Orders.DiscountApplicationRecord"
csAssembly="Microsoft.CommerceServer.Runtime, Version=6.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">

            <PropertyMappings>
              <PropertyMapping property="DisplayMessage" csProperty="BasketDisplayMessage"/>
              <PropertyMapping property="Amount" csProperty="DiscountAmount"/>
              <PropertyMapping property="Name" csProperty="DiscountName"/>
              <PropertyMapping property="Id" csProperty="DiscountId"/>
              <PropertyMapping property="Value" csProperty="DiscountValue"/>
              <PropertyMapping property="DiscountType" csProperty="TypeOfDiscount"/>
            </PropertyMappings>
          </EntityMapping>
        </EntityMappings>

        <Properties>
          <Property name="DiscountType" dataType="Integer" isStronglyTyped="true">
            <DisplayName value="Discount Type"/>
            <EnumeratedValues>
              <!-- Actual entries comes directly from the Orders system -->
            </EnumeratedValues>
          </Property>
        </Properties>
      </CommerceEntity>

Properties

Property

Type

Description

Amount

decimal?

Gets or sets the amount deducted.

DiscountType

int?

Gets or sets the meaning of the data stored in the Value property.

1 (Currency) - the Value is a specific dollar amount.

DisplayMessage

String

Gets or sets the text describing the discount applied.

Id

String

Gets or sets the id of the discount.

Name

String

Gets or sets the name of the discount.

Priority

int?

Gets or sets the discount priority rank.

PromoCode

String

Gets or sets the code that the discount is associated with.

Value

decimal?

Gets or sets the value of the discount.

Relationships

None.

Supported Operations

Commerce Foundation Basket CommerceQuery

See Also

Other Resources

Developing with the Commerce Foundation Orders System

Commerce Foundation Basket