Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for support for cart discount target #469

Closed
hchan01 opened this issue Jan 17, 2024 · 2 comments · Fixed by #471
Closed

Request for support for cart discount target #469

hchan01 opened this issue Jan 17, 2024 · 2 comments · Fixed by #471
Assignees
Labels
enhancement New feature or request

Comments

@hchan01
Copy link

hchan01 commented Jan 17, 2024

Hello team. I am trying to add the following cart discount with target type "totalPrice":

resource "commercetools_cart_discount" "discount" {
name = {
en = "Discount"
}
description = {
en = "Discount"
}
value {
type = "relative"
permyriad = 10000
}
predicate = "custom.orderHeaderKey is defined"
target {
type = "totalPrice"
}
sort_order = "0.5"
}

I get this error when deploying:

Error: "totalPrice" not a valid value for "target.0.type"

I'm not sure if it is a recent addition but according to the CommerceTools docs https://docs.commercetools.com/api/projects/cartDiscounts#cartdiscounttarget, cart totalPrice is a supported target. I also tried manually creating this cart discount in the CommerceTools UI then queried for it, and the target is returned as:

"target": {
"type": "totalPrice"
},

Thanks in advance

@hchan01 hchan01 added enhancement New feature or request triage Needs triage labels Jan 17, 2024
@demeyerthom
Copy link
Member

Hi @hchan01

We are indeed missing the totalPrice as a target in the code. This should not be a difficult change, I will look into it

@hchan01
Copy link
Author

hchan01 commented Jan 19, 2024

Awesome, thanks @demeyerthom for the quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment