@gradientedge/commercetools-utils
    Preparing search index...

    Interface CartDiscountPatternTarget

    Pattern targets can be used to model Buy and Get discounts.

    Unlike [CartDiscountLineItemsTarget](#cartdiscountlineitemstarget) and [CartDiscountCustomLineItemsTarget](#cartdiscountcustomlineitemstarget), it does not apply to a (Custom) Line Item as a whole, but to individual units of a (Custom) Line Item. The discounts can apply multiple times on the same cart, but each unit can be discounted only once.
    
    interface CartDiscountPatternTarget {
        maxOccurrence?: number;
        selectionMode: SelectionMode;
        targetPattern: PatternComponent[];
        triggerPattern: PatternComponent[];
        type: "pattern";
    }

    Hierarchy (View Summary)

    Index

    Properties

    maxOccurrence?: number

    Maximum number of times the Discount can apply on a Cart.

    If empty or not set, the Discount will apply indefinitely.
    
    selectionMode: SelectionMode

    Determines which of the matching units of (Custom) Line Items are discounted.

    targetPattern: PatternComponent[]

    Defines the set of units of (Custom) Line Items in a Cart on which the Discount is applied.

    Based on the availability of matching units and the limits from the `triggerPattern` or `maxOccurrence`, the `targetPattern` can match multiple times.
    
    This array cannot be empty.
    
    triggerPattern: PatternComponent[]

    Defines the set of units of (Custom) Line Items in a Cart that trigger a discount application.

    Based on the availability of matching units, the `triggerPattern` can match multiple times, limiting the number of maximum times the discount will be applied.
    The units matched in the `triggerPattern` are excluded and not considered for the `targetPattern`.
    
    To further limit the discount application, set the `maxOccurrence`.
    
    type: "pattern"