Developer forum

Forum » Swift » How to get Informative Prices using ProductViewModel?

How to get Informative Prices using ProductViewModel?

Pedro Meias
Pedro Meias
Reply

Hi,

We have a Product with the Following Price Matrix

37 USD , IsInformative = False
38 USD, IsInformative = True
46 USD, IsInformative = False
44 USD, IsInformative = False

Using a ProductViewModel

Product.Prices will give us a list containing only Prices that are not informative (3)

Product.PriceInformative property will return a PriceViewModel with Price = 0

Is there a way to get the Informative price described in example using the ProductViewModel?

Thank you.


Replies

 
Oleg Rodionov Dynamicweb Employee
Oleg Rodionov
Reply

Hi,

I was not able to reproduce the issue using dwapi request on last DW9.13.4 admin. Please, find attachment for details.

BR, Oleg QA

2022-04-08_12-22-42.png 2022-04-08_12-23-24.png 2022-04-08_12-24-01.png 2022-04-08_12-24-36.png 2022-04-08_12-25-19.png
 
Pedro Meias
Pedro Meias
Reply

Hi Oleg,

I am using 9.12.0, so that could be the cause why my PriceInformative is returning an empty object.

From what I a seeing on your screenshot, you are only receiving one Price Informative. What if we have more that one?

Example - We can multiple informative prices depending on dates and/or quantities,

 

 
Nicolai Pedersen
Reply
This post has been marked as an answer

They will not be available on the viewmodel. 

You can query the prices direction using Price.GetPrices that will give you a list for a product - or a variant - in all or specified currencies.

BR Nicolai

Votes for this answer: 1
 
Nicolai Pedersen
Reply

Quantity prices could also just be a regular price (not informative) - then they will show up on the .Prices property on the productviewmodel.

 
Pedro Meias
Pedro Meias
Reply

Hi Nicolai,

Thank you for the explanation. I was able to get the Prices using Price.GetPrices.

Sorry, I recently joined DWNA and got confused on what to expect with Product.PriceInformative

 

You must be logged in to post in the forum