Developer forum

Forum » Ecommerce - Standard features » Price discount

Price discount

Paul Nilsson
Reply

Im using the PriceProvider to get the price of a product when the user opens a product page.

This woks fine, but at the same time I also whant to set a discount (if there is one) for the same product and also a price without discount.

I want to do it at the same time as I get set the price so I don't have to call the web servise twice to get the prices and discount.

Can I set a discount for a product in the PriceProvider and how?

The discounts are different on all products and customers so nothing can be saved on the product it selfe in e-com.

 

 


Replies

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer

Hi Paul

Discounts needs to be handled by the discount provider.

But what you can do, is which ever of the 2 being called first, will look up in the webservice and store the result on HttpContext.Items collection:https://msdn.microsoft.com/en-us/library/system.web.httpcontext.items%28v=vs.110%29.aspx

It is a simple key/value that exists only for this request and is perfekt for storing data you need in 2 pieces of code, but not store on memory for long.

BR Nicolai

Votes for this answer: 1

 

You must be logged in to post in the forum