labd / terraform-provider-commercetools

Terraform provider for commercetools
https://registry.terraform.io/providers/labd/commercetools/latest/docs
Mozilla Public License 2.0
64 stars 67 forks source link

commercetools_cart_discount to support stores #500

Open piran-cabiri opened 4 months ago

piran-cabiri commented 4 months ago

The commercetools_cart_discount creates cart discounts, but cannot be used to assign those discounts to particular stores.

In the commercetools API the CartDiscountDraft object takes an array of stores, and there are update cart discount actions to add and remove stores.

(There are also APIs for creating and updating a cart discount within a store, but I suggest these are less useful for Terraform.)

Currently, the commercetools terraform provider ignores the stores property of the cart discount, so these can be changed manually after creation and not noticed on updates.

demeyerthom commented 3 months ago

Hi @piran-cabiri thanks for reaching out!

That is indeed something we need to add. I have added this to our board, but it might take some time before I come around to it. Feel free to open a PR with the required changes if you need this quickly!