What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hi everyone. I have a question regarding `cart rule discounts`. I created 2 example percentage cart

UNYPGDYF7
UNYPGDYF7 Posts: 17 🧑🏻‍🚀 - Cadet

Hi everyone. I have a question regarding cart rule discounts.
I created 2 example percentage cart rule discounts, which are successfully applied to the given cart items.

If I increase the quantity of a cart item, the calculatedDiscounts will be applied twice, but with quantity 1. Why?
Is there a reason why the quantity number of a calculatedDiscount is not be increased?

Given: 2 products, 2 cart rules -> 4 applied calculated discounts with quantity 1
Expected: 2 products, 2 cart rules -> 2 applied calculated discounts with quantity 2

Comments

  • UNYPGDYF7
    UNYPGDYF7 Posts: 17 🧑🏻‍🚀 - Cadet

    😢

  • UNYPGDYF7
    UNYPGDYF7 Posts: 17 🧑🏻‍🚀 - Cadet

    Ok, I found it out by myself. It is a different, if the concrete product isQuantitySplittable=true or not.
    If the product is splittable, the customer can see the product in his cart with quantity 2 and two separate added discounts with quantity 1. But with complete order, Spryker will split them up in two separate order items in zed and each of them will get a discount.
    If the product is not splittable, the customer can also see the product in his cart with quantity 2, but with just one added discount with quantity 2. On complete order, you will have 1 order item in zed with quantity 2 and 1 calculated discount for that.

  • UNYPGDYF7
    UNYPGDYF7 Posts: 17 🧑🏻‍🚀 - Cadet

    But, and this is the tricky part, Spryker has different discount calculations for both cases.
    If splittable, the calculation is priority based and each discount is calculated on the result from the discount before.
    If not splittable, each discount is calculated each time on product price.

    For example:
    Splittable item with priorityIterationCalculation
    Example:

    • product A 100 €
      -> 10% discount on 100 € (-10 €) = 90€
      -> additional 20% discount on 90€ (-18 €) = 72 €

    Non splittable item without priorityIterationCalculation
    Example:

    • product A 100 €
      -> 10% discount on 100 € (-10 €) = 90€
      -> additional 20% discount on 100€ (-20 €) = 70 €
  • UNYPGDYF7
    UNYPGDYF7 Posts: 17 🧑🏻‍🚀 - Cadet

    Does anybody know, why the priorityIterationCalculation can not be done for splittable items?

  • Chemaclass
    Chemaclass Tech Lead Spryker Solution Partner Posts: 213 🧑🏻‍🚀 - Cadet

    Maybe @valerii.trots, @U01J6HSL9NG or @UQK3ZPJEN can bring some 💡 here?

  • Florian Krämer
    Florian Krämer Application Architect Sprykee Posts: 6 🧑🏻‍🚀 - Cadet

    It's either a bug or there is a reason for it that I'm not aware of. @jeremy.fourna might have an idea if this behavior is intended.

  • Florian Krämer
    Florian Krämer Application Architect Sprykee Posts: 6 🧑🏻‍🚀 - Cadet

    My expectation would also be that the result is the same.

  • Florian Krämer
    Florian Krämer Application Architect Sprykee Posts: 6 🧑🏻‍🚀 - Cadet

    How urgent is a fix to the problem for you?

  • Florian Krämer
    Florian Krämer Application Architect Sprykee Posts: 6 🧑🏻‍🚀 - Cadet

    You can report the problem through the Service Portal https://support.spryker.com/

  • Jeremy Fourna
    Jeremy Fourna Lead Product Manager Posts: 130 🧑🏻‍🚀 - Cadet

    @U01J6HSL9NG @UNYPGDYF7 this is indeed a bug, this is a use case our QA seems to have missed during the regression. We will take care of it.

  • UNYPGDYF7
    UNYPGDYF7 Posts: 17 🧑🏻‍🚀 - Cadet

    As I understood it correct, the fix is not so urgent.
    But it would be good to understand it or to have the possibility to choose, which calculation we want to have.
    We have several ways to work around this, but for now we will start with the existing solution.

  • UNYPGDYF7
    UNYPGDYF7 Posts: 17 🧑🏻‍🚀 - Cadet

    @jeremy.fourna do you think, that this is really a bug and also the non splittable version should have the prioritized iteration calculation?

  • Jeremy Fourna
    Jeremy Fourna Lead Product Manager Posts: 130 🧑🏻‍🚀 - Cadet

    All all products in the cart behave the same way against discounts, so nonsplittable will behave the same way as splittable products

  • UNYPGDYF7
    UNYPGDYF7 Posts: 17 🧑🏻‍🚀 - Cadet

    Uh ok... I assume that you will take care of it? Where will I see progress on this issue?

  • UNYPGDYF7
    UNYPGDYF7 Posts: 17 🧑🏻‍🚀 - Cadet

    There is no translation for the cart rule description at the moment, right? 😒

  • UNYPGDYF7
    UNYPGDYF7 Posts: 17 🧑🏻‍🚀 - Cadet

    We updated spryker-feature/order-management and that issue here 👆 is already fixed 🙂
    Thx @U01J6HSL9NG