Developer forum

Forum » Ecommerce - Standard features » Location of variant prices

Location of variant prices

Kurt Moskjær Andersen
Kurt Moskjær Andersen
Reply

Hi,

I need to output the prices of each of the variants of a product, but always get an empty result (zero).

I iterate the Product.Prices for the specific product, but everything is empty. I've also tried using the Dynamicweb.Ecommerce.Prices.PriceMatrix, but cannot find any examples in the API-documentation for DW9 on how to output the prices correctly.

Best regards
Kurt Moskjaer Andersen


Replies

 
Nicolai Pedersen
Reply

Hi Kurt

You can call Price.getPrices(productid) and get all the price records. If you use any of the other parts of price API you might only get prices valid in the context (currency, quantity etc.)

In the product template, you also have a prices loop.

BR Nicolai

 
Kurt Moskjær Andersen
Kurt Moskjær Andersen
Reply

I found the solution.
When I iterate through the VariantCombination, I can get the price using VariantCombination.Product.Price

Thank you for your help.

Best regards
Kurt

 

You must be logged in to post in the forum