Developer forum

Forum » Ecommerce - Standard features » GetDiscounts does not return discounted price

GetDiscounts does not return discounted price

Mikkel Belchuke
Mikkel Belchuke
Reply

Hi. 

I'm trying to implement discount price in an item, that uses the Product type picker. 

From the item, I'm getting the productId, which I then uses to to extract information from the ProductService. 

I then uses "productbyid.GetPrice(currenctyCode, countryCode).Price" to get the price and "productbyid.GetDiscounts(currency, country, "", "").Price" to get the discountet price, though I get the exact same price. 

The product should have a discount on 10%, which works fine when I use TemplateTags. 

 

Am I missing something?


Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Mikkel

You need the GetPrice and the GetDiscountMatrix from the product and subtract them from eachother using priceinfos subtract method.

BR Nicolai

Votes for this answer: 2
 
Mikkel Belchuke
Mikkel Belchuke
Reply

Thank you Nicolai!

 

You must be logged in to post in the forum