Share via


Commerce Foundation DiscountFilter

This Microsoft Multi-Channel Commerce Foundation commerce entity represents the Commerce Server's DiscountCriteriaFilter and DiscountItemCollection classes that you use to query for simple discounts (as defined by Commerce Server) that are applicable to a specific product or category.

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="DiscountFilter">
    <DisplayName value="Discount Filter"/>
    <Description value="Defines which discout definitions related to a catalog entity should be selected during a query."/>
    <Properties>
      <Property name="ContextName" dataType="String">
        <DisplayName value="Context Name"/>
        <Description value="Specifies the context from which discount definitions should be selected.  This should be the name of a Commerce Server discounts cache."/>
      </Property>
      <Property name="FilterOnAward" dataType="Boolean">
        <DisplayName value="Filter On Award"/>
        <Description value="If true, discount definitions that specify the target catalog entity as an award will be selected."/>
      </Property>
      <Property name="FilterOnCondition" dataType="Boolean">
        <DisplayName value="Filter On Condition"/>
        <Description value="If true, discount definitions that specify the target catalog entity as a condition will be selected."/>
      </Property>
      <Property name="IncludeDiscountsWithEligibilityRequirements" dataType="Boolean">
        <DisplayName value="Include Discounts with Eligibility Requirements"/>
        <Description value="If true, discounts definitions that have eligibility requirements will be selected.  Otherwise, discounts definitions with eligibility requirements will be omitted."/>
      </Property>
      <Property name="IncludeDiscountsWithPromoCodes" dataType="Boolean">
        <DisplayName value="Include Discounts with Promotion Codes"/>
        <Description value="If true, discounts definitions that require a promotion code will be selected.  Otherwise, discounts definitions that require promotion codes will be omitted."/>
      </Property>
      <Property name="IncludeInactiveDiscounts" dataType="Boolean">
        <DisplayName value="Include Inactive Discounts"/>
        <Description value="If true, discounts definitions that are not currently valid will be selected.  Otherwise, discounts definitions that are not currently valid will be omitted."/>
      </Property>
    </Properties>
</CommerceEntity>

Properties

Property

Type

Description

ContextName

String

Identifies the Commerce Server cache from which discounts will be selected.

FilterOnAward

bool?

Indicates whether discounts that include the specified product or category, as an award, should be selected.

FilterOnCondition

bool?

Indicates whether discounts that include the specified product or category, as a condition, should be selected.

IncludeDiscountsWithEligibilityRequirements

bool?

Indicates whether discounts that contain eligibility requirements should be selected.

IncludeDiscountsWithPromoCodes

bool?

Indicates whether discounts that require a promotion code should be selected.

IncludeInactiveDiscounts

bool?

Indicates whether discounts that are not currently active (due to start/end date restrictions) should be selected.

Relationships

None.

Supported Operations

The discount filter does not directly support operations, but can be used as the search model for a CommerceQueryRelatedITem<DiscountDefinition, CommerceModelSearch<DiscountFilter>> in the following operations:

Commerce Foundation Category CommerceQuery

Commerce Foundation Product CommerceQuery

See Also

Other Resources

Developing with the Commerce Foundation Marketing System