Developer forum

Forum » Development » getProductPrice in user control

getProductPrice in user control

Dmitrij Jazel
Reply

Hello guys,

Have a question here, think it should be quite easy...

 

I have a UserConrol that if necessary must reach down to eCommerce and Get the price of a product by using it's productID.

I have tryed this:

var prod = Dynamicweb.eCommerce.Products.Product.GetProductByID(prodID);
string priceString = prod.Price.ToString();

And so I am getting wrong price because I am also extending PriceProvider, and so in order to get the correct price I must do some operations in price provider in order to get it right. Solution must use that PriceProvider,

And I cannot perform same calculations in UserConrol as I do in price provider.

 

So I have to find a way how can I "ask" ecom API to extract me the price if a single product on demand.

 

Any suggestions? :-)

 

 


Replies

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

Hi Dmitrij

 

You have to use the Pricemanagers Findprice:

http://developer.dynamicweb-cms.com/api8/#Dynamicweb~Dynamicweb.eCommerce.Prices.PriceManager~FindPrice.html

 

BR Nicolai

Votes for this answer: 1
 
Dmitrij Jazel
Reply

Excellent! :)

I will give it a try...

 

 

You must be logged in to post in the forum