"If provide a line item discount of 20 % when spent amount is more than 2000 (incl. VAT) another 20 % is taken off all products. Even previously discounted ones. I have tried playing around with sorting order and exclusion rules, but no luck."
- I believe this is the way to go. The sorting order has to be in falling percentage: Product C, Product B, Spend 2000, Product A. Also the Spend 2000 promotion has to excluded the other three.
What I am guessing you are missing is that you have to enforce entry level exclusion:
_promotionEngine.Run(cart, new PromotionEngineSettings { ExclusionLevel = ExclusionLevel.Unit });
The default is ExclusionLevel.Order. Unit was introduced a while back to support the use cases we at avensia had from our customers.
Ah now i remember, it is this all over again:
https://world.episerver.com/forum/developer-forum/Episerver-Commerce/Thread-Container/2019/5/multiple-promotions-apply-to-only-items-that-dont-already-have-a-promotion/#204497
I took the time and wrote up a feature request:
https://world.episerver.com/forum/developer-forum/Feature-requests/Thread-Container/2019/9/spend-for-amount-promotion-with-unit-level-exclusion/
Please upvote it if you would like episerver to implement it. ^^
Hi Toke,
I'm not sure I understand your scenario correctly and you still interest in this case.
If you just want discount for those items once time (I mean it will not apply combine with other promotion), then why did you setup an order level promotion? That 100% take a discount for whole order.
It should be Spend amount for items promotion type, which have a property like DiscountTarget. Then you can customize a little bit in the processor, to filter that all target items should not apply any promotion before.
/Tuan
Hi, Tuan.
If we setup an order level promotion it will be multiplied with a line promotion and that is not what we want to. The question is that if it is possible to have such setup with promotions from the box. From the support team we get an advice to have something like that:
cart.ApplyDiscounts(_promotionEngine, new PromotionEngineSettings
{
ExclusionLevel = ExclusionLevel.Unit,
RequestedStatuses = RequestFulfillmentStatus.Fulfilled
})
But seems like it does not change something.
So the biggest discount of the first item will be applied (order discount) but others will stay the same (line discounts). As i understand from your post it is not possible from the box to have such setup.
Hi
Say I have the following active discount types:
Line item discounts
Buy Products for Discount on All Selections
Buy Products for Discount on All Selections
Buy Products for Discount on All Selections
With one of each products the cart now looks something like this:
I also have another discount which gives 20 % off the entire order if the spent amount is more than 2000 including VAT:
Order discounts
Spend for Discount on Order
Because I always want to provide the best (lowest) possible price I want the 10 % line item discount to be replaced with a 20 % off that item. The products which get 25 % and 30 % off should remain as their discounts are better than the 20 % provided by the order campaign.
I have tried a few different setups, but I am not able to fully acheive what I want:
This is as expected as it returns the sum of all line items OrderDiscountValue, but it is not what I want.
If I do that, and set the EntryDiscountValue = OrderDiscountValue I sort of get what I want, but I'm unsure how this will affect any other cart totals retrievals down the line fx. when I create summary for order email etc.
Rough code from trying that out:
Has anyone had to implement something similar to my use case? Or perhaps someone can point me towards are proper approach?