Freigeben über


Commerce Foundation DiscountDefinition

A Commerce Server 2009 discount definition is the equivalent of a discount in Commerce Server Core Systems. It contains information about how and when a discount can be applied to 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="DiscountDefinition">
    <DisplayName value="Discount Definition"/>
    <Description value="Represents the data that defines how and when a discount can be applied to a purchase order."/>
    <Properties>
      <Property name="Id" dataType="String">
        <DisplayName value="Id"/>
        <Description value="The unique id of the discount definition."/>
      </Property>
      <Property name="ParentId" dataType="String">
        <DisplayName value="Parent Id"/>
        <Description value="The id of the parent campaign of this discount definition."/>
      </Property>
      <Property name="DateModified" dataType="DateTime">
        <DisplayName value="Date Modified"/>
        <Description value="The date and time at which this entity was last modified."/>
      </Property>
      <Property name="Name" dataType="String">
        <DisplayName value="Name"/>
        <Description value="The programatic name of the discount definition."/>
      </Property>
      <Property name="BasketDisplay" dataType="String">
        <DisplayName value="Basket Display"/>
        <Description value="The content that will describe the discount to shoppers when it is applied to a basket."/>
      </Property>
      <Property name="StartDate" dataType="DateTime">
        <DisplayName value="Start Date"/>
        <Description value="The date and time at which this discount definition becomes valid"/>
      </Property>
      <Property name="EndDate" dataType="DateTime">
        <DisplayName value="End Date"/>
        <Description value="The date and time at which this discount definition becomes void"/>
      </Property>
      <Property name="OfferType" dataType="String">
        <DisplayName value="Offer Type"/>
        <Description value="Defines what type of entity this discount can be applied to."/>
      </Property>
      <Property name="Value" dataType="Decimal">
        <DisplayName value="Value"/>
        <Description value="Specifies the currency or percentage value of the discount"/>
      </Property>
      <Property name="ValueType" dataType="Integer">
        <DisplayName value="Value Type"/>
        <Description value="Specifies whether the Value property is a currency or currency ammount."/>
        <EnumeratedValues>
          <!-- Actual entries comes directly from the Orders system -->
        </EnumeratedValues>
      </Property>
    </Properties>
</CommerceEntity>

Properties

Property

Type

Description

BasketDisplay

String

Text that describes the discount in the request user interface culture (OperationContext.CurrentInstance.RequestContext.UserUILocale).

DateModified

DateTime?

Date the discount definition was last modified (in UTC). It is the caller’s responsibility to convert this value to local time, if necessary.

EndDate

DateTime?

Date and time at which the discount promotion ends (in UTC).

Id

String

Unique ID of the discount definition.

Name

String

Name of the discount.

OfferType

String

String that describes the type of discount that is being offered to the shopper. The following are valid discount types:

  • Shipping_Discount

  • OrderLevelDiscount

  • LineItemDiscount

  • User-defined string for custom order level discounts

ParentId

String

Unique ID for the discount definition's parent.

StartDate

DateTime?

Date and time at which the discount promotion begins (in UTC).

Value

Decimal

Currency or percentage value of the discount.

ValueType

int?

Value that indicates the meaning of the discounts Value member. Possible values include:

1 - which represents a currency value

Relationships

None.

Supported Operations

This object does not directly support operations, but can be retrieved through a CommerceQueryRleatedItem<DiscountDefinition> or CommerceQueryRelatedItem<DiscountDefinition, CommerceModelSearch<DiscountFilter>> as a RelatedOperation to the following queries:

Commerce Foundation Category CommerceQuery

Commerce Foundation Product CommerceQuery

See Also

Other Resources

Developing with the Commerce Foundation Marketing System

Commerce Foundation Category CommerceQuery

Commerce Foundation Product CommerceQuery