All Release Notes

Added discount distribution modes for absolute Cart Discounts

22 August 2024
Composable Commerce
HTTP API
Enhancement
Pricing and DiscountsGraphQL

You can now choose how absolute discounts are applied to (Custom) Line Items in a Cart. Discounts can be distributed evenly or applied individually to each (Custom) Line Item, giving you more flexibility when creating promotions. Previously, discounts were only distributed proportionately to (Custom) Line Items.

Changes:

  • [API] Added DiscountApplicationMode to the Cart Discounts API.
  • [API] Added applicationMode field to CartDiscountValueAbsoluteDraft and CartDiscountValueAbsolute.
  • [GraphQL API] Added the following types to the GraphQL schema: AbsoluteCartDiscountValue, AbsoluteCartDiscountValueInput, and DiscountApplicationMode.
  • [GraphQL API] Added absoluteCart input field to the CartDiscountValueInput type.

The following changes were introduced in terms of GraphQL SDL:

extend input CartDiscountValueInput {
absoluteCart: AbsoluteCartDiscountValueInput
}
type AbsoluteCartDiscountValue implements CartDiscountValue {
money: [Money!]!
applicationMode: DiscountApplicationMode!
type: String!
}
input AbsoluteCartDiscountValueInput {
money: [MoneyInput!]!
applicationMode: DiscountApplicationMode!
}
enum DiscountApplicationMode {
ProportionateDistribution
EvenDistribution
IndividualApplication
}