Developer forum

Forum » Development » How to get the Price object of applied price

How to get the Price object of applied price

Gaëtan Di Caro
Reply

Hello,

I know I can get a product price using this method :

var defaultPriceProvider = new DefaultPriceProvider();

var userPrice = defaultPriceProvider.FindPrice(product, quantity, variantId, currency, unitId, user);

 

However, this only gives me a PriceRaw object. How to I get the actual Price object that is being used there ? Specifically, I need to know if this price is the result of a UserGroup-specific price or not.

 

Thank you.


Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi GaĆ«tan

You cannot - not easily anyways.

You can get all price records from Price.GetPrices(ProductID) and do some magic maybe??

BR Nicolai

Votes for this answer: 1
 
Gaëtan Di Caro
Reply

Alright, I drew an ASCII Pentagram and cast the price finding spell in my code and it worked.

Thanks !

 

Before that I worked around it by doing some tests on the amount itself and the different prices of the product.

 

You must be logged in to post in the forum