Developer forum

Forum » Ecommerce - Standard features » ProductViewModel Prices property with live data?

ProductViewModel Prices property with live data?

Mario Santos Dynamicweb Employee
Mario Santos
Reply

Hi,

We are able to get the ProductViewModel price using live integration but seems the Prices property is always getting the default price provider data (EcomPrices table).

Has anyone came across this?

BR, Mario


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

ProductViewModel.Prices returns Product.Prices that are within the context scope (Currency, user etc). It should be the same as GetLoop("Product.Prices") loop in the old catalog frontend.

 
Mario Santos Dynamicweb Employee
Mario Santos
Reply

IIRC, LiveIntegration has a product template extender to override the GetLoop("Product.Prices") and without it the loop would reflect the EcomPrices records.

 
Søren Jakobsen
Reply

Hi,

I'm currently working on a swift 1.23.0 project with live-integration version 7.4.0.0 and we are receiving the EcomPrices table live from BC (see attached) but the Swift template Swift_ProductPriceTable.cshtml doesn't render the price matrix - looks like Product.Prices viewmodel doesn't contain any prices. It I hook the integration up in a solution running Rapido then the matrix gets rendered in GetLoop("Product.Prices") with template tags.

can you share the solution regarding this issue?

BR,

Søren

billede_(1).png
 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Søren

The live integration is using a template extender for the old product catalog to overwrite the price list for quantity prices - template extenders do not exist for viewmodel based template since there are no tags. The price for the product is delivered by the priceprovider and it does not support lookup of prices for the pricematrix.

The Prices property of the ProductViewmodel does therefore not get its information from live integration.

The only option to get that information is to extend or change the live integration to deliver the information in an extention method using the logic found in ProductTemplateExtender from the live integration project.

I am not sure we will add support for live multiple prices through the ProductViewModel.Price property as it could cause some serious performance issues (especially when exposed in the webapi) - but maybe through a build in extension for the product viewmodel.

BR Nicolai

 

You must be logged in to post in the forum