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

Vote:
 

Hi. 
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?

#179319
Jun 08, 2017 10:55
Vote:
 

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.

#179321
Jun 08, 2017 11:01
Vote:
 

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

#179322
Jun 08, 2017 11:05
Vote:
 

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

#179324
Jun 08, 2017 11:44
Vote:
 

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.

#179328
Jun 08, 2017 12:47
Vote:
 

A custom promotion engine seems an option in your case.

/K

#179332
Jun 08, 2017 13:28
Vote:
 

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.

#179346
Jun 08, 2017 15:39
Vote:
 

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

#179347
Jun 08, 2017 16:45
Vote:
 

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

#179382
Jun 09, 2017 10:50
Vote:
 

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

#179387
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.