Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Amount specified on LineItem by customer and then discounts applied...


I am working on a project where I need for the customer to be able to specify the price he/she is prepared to pay per LineItem where the catalog price is used as a lower limit. This is to be done only for select products. 
The discounts and promotion engine are then to be applied, making it possible for the customer to enter an amount that is then lowered by a discount (e.g. a percentage). 
How can I do this when the IPromotionEngine, IPlacedPriceProcessor etc all calculate their prices based on the price of the catalog. In the promotion engine etc there are no way of knowing which LineItem the price is calculated for and thus no way of obtaining the price from the LineItem instead of from the catalog.
How can I do this? Can I still use the promotion engine or do I need to perform the discounts entirely custom? 
What is your recommendation?

Jun 08, 2017 10:55

I'm not seeing the big picture here, but why don't you apply every discount first, then allow the customer to set the price based on that value? Then you can set the PlacedPrice to the LineItem if the price set is valid.

Jun 08, 2017 11:01

I need the discounts to be applied to the price placed by the customer.

Jun 08, 2017 11:05

That might be exactly what the DefaultLineItemCalculator is for...

Jun 08, 2017 11:44

Nope. DefaultLineItemCalculator just aggregates the calculated values from what I can see.
The problem with having the discount being calculated by the promotion engine etc is that the calculations, discount limits and percentages are calculated based on the catalog price.

Jun 08, 2017 12:47

A custom promotion engine seems an option in your case.


Jun 08, 2017 13:28

Are you certain the promotion engine is calculating based on the catalog price?

I was under the impression the cart is updated with the catalog price in a seperate step in the workflow prior to the discount calculations.

I would save the entered price to a custom meta field on the lineitem and attempt to write my own IPlacedPriceProcessor, the processor would then validate the custom meta price is larger than the catalog price and in that case set the PlacedPrice to the custom meta one.

Jun 08, 2017 15:39

I'm also missing the big picture a bit, but maybe you can use the solution Maris blogged about for adding a manual discount?

Jun 08, 2017 16:45

How do I best go about feeding a custom price into the discount/promotion calculation?

Jun 09, 2017 10:50

It has to be set as the PlacedPrice on the ILineItem.

Jun 09, 2017 12:14
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.