22 July 2022
Enhancement
CartsPricingGraphQL

You can now set a price mode on a CustomLineItem that controls whether Cart Discounts should be applied to them by Composable Commerce or not. Use this if you want to control application of Cart Discounts for each Custom Line Item in the Cart individually. For backwards compatibility, Standard is the default price mode for newly created Custom Line Items, that allows application of Cart Discounts. For cases where Cart Discounts should not be considered on a Custom Line Item, you can change its price mode to External via new update action. You can still overwrite the price for a Custom Line Item via Change CustomLineItem Money update action.

Changes:

  • [API] Added field priceMode to CustomLineItem.
  • [API] Added Change CustomLineItem Price Mode update action to Carts.
  • [GraphQL API] Added the following types to the GraphQL schema: ChangeCartCustomLineItemPriceMode, CustomLineItemPriceMode.
  • [GraphQL API] Changed the CartUpdateAction type:
    • Input field changeCustomLineItemPriceMode was added to CartUpdateAction type
  • [GraphQL API] Changed the CustomLineItem type:
    • Added the priceMode field to the CustomLineItem type.
  • [GraphQL API] Changed the TypeDefinition type:
    • TypeDefinition type description is changed

The following changes were introduced in terms of GraphQL SDL:

extend type CustomLineItem {
priceMode: CustomLineItemPriceMode!
}
extend input CartUpdateAction {
changeCustomLineItemPriceMode: ChangeCartCustomLineItemPriceMode
}
input ChangeCartCustomLineItemPriceMode {
customLineItemId: String!
mode: CustomLineItemPriceMode!
}
enum CustomLineItemPriceMode {
"Cart discounts are deactivated for the custom line items with this price mode."
External
"This is the default mode."
Standard
}