# B2B Customer Price modification

**URL:** <https://forum.litium.com/t/b2b-customer-price-modification/2875>\
**Category:** Questions\
**Tags:** litium-8\
**Created:** [March 7, 2023, 6:01pm UTC](https://forum.litium.com/t/b2b-customer-price-modification/2875 "2023-03-07T18:01:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martin.Brandt](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/martin.brandt/32/974_2.png) [@Martin.Brandt](https://forum.litium.com/u/Martin.Brandt)\
**Post date:** [March 7, 2023, 6:01pm UTC](https://forum.litium.com/t/b2b-customer-price-modification/2875/1 "2023-03-07T18:01:42Z")

</div>

Hello,

I need to build some custom price logic. On the customer I have a field, lets say 5 which means this customer has 5% reduction from the standard pricelist. It is not a campaign, and should not be displayed as such.

A general B2B pricelist for market “Sweden” will allow this reduction to take place.  
A pricelist for just this customer is already reduced and should not allow the reduction in price.

I have some CustomData stored on the PriceList to tell me if a reduction is allowed for this pricelist or not.

Is there any way to achieve this in Litium 8, other than implementing my own PriceCalculator (not decorator)?

I don’t think I can do it with a decorator, because the prices returned from standard PriceCalculator does not say from which price list they came, which is what i need to be able to determine if I am allowed to modify the price or not.

I have trouble decompiling the standard PriceCalculatorImpl into working code, so I will have to ask for the source code from Litium to be able to make my own.

Before I do that, could there be another way?

Litium version: 8

---

<div class="post-metadata">

**Author:** ![utku](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/utku/32/62_2.png) [@utku](https://forum.litium.com/u/utku)\
**Post date:** [March 7, 2023, 8:45pm UTC](https://forum.litium.com/t/b2b-customer-price-modification/2875/2 "2023-03-07T20:45:16Z")

</div>

In the decorator you can use parents GetPriceLists method and find from which price list the price is collected. Can it be a solution?

---

<div class="post-metadata">

**Author:** ![Martin.Brandt](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/martin.brandt/32/974_2.png) [@Martin.Brandt](https://forum.litium.com/u/Martin.Brandt)\
**Post date:** [March 7, 2023, 9:01pm UTC](https://forum.litium.com/t/b2b-customer-price-modification/2875/3 "2023-03-07T21:01:03Z")

</div>

I don’t think so. That method would return more than one valid price list.

Say if the channel has a general B2B price list for all customers, and then ontop of that this customer has their own pricelist with cheaper prices.

Would not the GetPriceLists() return both of them, because they are both valid/active for customer?

---

<div class="post-metadata">

**Author:** ![utku](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/utku/32/62_2.png) [@utku](https://forum.litium.com/u/utku)\
**Post date:** [March 7, 2023, 9:02pm UTC](https://forum.litium.com/t/b2b-customer-price-modification/2875/4 "2023-03-07T21:02:40Z")

</div>

Yes but you can compare the price that you get and the price that these price lists have and find which price list is used for the calculation.

---

<div class="post-metadata">

**Author:** ![Martin.Brandt](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/martin.brandt/32/974_2.png) [@Martin.Brandt](https://forum.litium.com/u/Martin.Brandt)\
**Post date:** [March 7, 2023, 9:05pm UTC](https://forum.litium.com/t/b2b-customer-price-modification/2875/5 "2023-03-07T21:05:19Z")

</div>

Hm… I will have to think about that one, thanks for the idea!

I will compare the pros and cons of that vs the full implementation. I start work on this next week so I have some time to decide 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/litium/original/1X/12eddac3b8b661de1db86af10ac8151b571e6fb9.png) [@system](https://forum.litium.com/u/system)\
**Post date:** [April 4, 2023, 9:06pm UTC](https://forum.litium.com/t/b2b-customer-price-modification/2875/6 "2023-04-04T21:06:00Z")

</div>

Closed on April 4, 2023, 9:06pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
