Developer forum

Forum » Development » Live Integration PriceProvider and ProductViewModel

Live Integration PriceProvider and ProductViewModel

Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi,

 

We have a custom Live Integration (extended on top of the standard one) to handle some of our common needs. We've done this years ago and it's working just fine with template tags and whenever we instantiate a Dynamicweb.Ecommerce.Products.Product object

 

Moving to Swift, we're doing webapi calls that use the ProductViewModel, and similar to what happened with the Stock (https://doc.dynamicweb.com/forum/development/development/stocklevelprovider-not-used-in-productviewmodel) the live response for multiple Prices are not working with the webapi/ProductViewModel.

 

The way it was implemented was through a PriceProvider (attached for reference), which makes us think the problem is the same, but it might not be.

 

So what we're trying to figure out is:

  • Does anything need to change in the ProductViewModel to make sure the PriceProviders are honored?
    OR
  • Do we need to make any type of change so that the live response populates the PriceListViewModel (that's used in a ProductViewModel)?

 

Best Regards,

Nuno Aguiar


Replies

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

Hi Nuno,

"the live response for multiple Prices are not working with the webapi/ProductViewModel"

The prices in PriceListViewModel which is exposed by ProductViewModel.Prices comes from Product.Prices and that will return a collection of all the prices for the given product id in the price matrix. I can't see that we have made any changes related to that.

Did that ever work with live integration? How?

There is currently no method on PriceProvider which can return a collection of prices with information about the conditions for those prices (like quantity).
I think what you are asking for is a new feature. Correct me if I'm wrong.

/Morten

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Morten,

 

This is how it currently works https://dev.azure.com/dynamicwebsoftware/Dynamicweb/_git/Dynamicweb?path=/src/22%20-%20Providers/LiveIntegration/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/TemplateExtenders/ProductTemplateExtender.cs

 

I mispoke about having this available when instantiating a product using the API (it's because the Rapido "feeds" actually use template tags).

 

So, I guess it is a new feature request, so that the ProductViewModel can have live prices. Not sure how complicated that is, but we were surprised by this limitation close to the end of the project :\

 

Any help would be highly appreciated.

 

Best Regards,

Nuno Aguiar

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Morten,

 

We have a launch on November 8th where this is needed to be working. Is it something that we can do? Would it be a matter of updating the ProductListViewModel in the ProcessResponse?

 

Best Regards,

Nuno Aguiar

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

Hi Nuno,

This has been registered as feature request #10273
I can't tell you when/if this is going to be implemented.

For now I guess you'll have to expose this information through a regular page rendering (maybe make it api-ish, by returning prices as json) or a custom api controller.

/Morten

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Morten,

 

Understood. It's great that you guys have some vision into the issue at least. We'll see what we can do for now until an official way can be supported by Dynamicweb.

 

In the meanwhile we'll implement some sort of workaround, but I want to avoid as little "throw away code" as possible and revert to whatever solution we get in the future, since Live Integration is a critical feature of most our projects Fingers-crossed...

 

Best Regards,

Nuno Aguiar

 

You must be logged in to post in the forum