Developer forum

Forum » Dynamicweb 9.0 Upgrade issues » Price provider not being hit

Price provider not being hit

Peter Leleulya
Reply

Hi there,

I have a price provider which returns a value based upon the current page.
Either a monthly rental price is returned or a buy price is returned. (rental price is a custom field on the product, but price is the actual Price.Price value)

Since upgrading from 9.3.x to 9.4 the price provider doesnt get hit on each page load ...

So when I open a rental page the price provider gets hit for all my products and rental prices are shown.
When I switch to a buy page the same products are shown, but the cached prices are shown and the price provider doesn't even get hit ...

Is there a way to overrule this? I need the price provider to fire every time when a product.Price.Price or GetString("Ecom:Product.Price.Price") is called !


Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Did you recompile your provider against 9.4? Maybe there are some breaking changes?

 
Peter Leleulya
Reply

The issue isn't the price provider.
The price provider works fine when it gets hit.
And it doesn't seem to be an issue with a depricated function or something ...

But there seems to be a very robust product.price.price caching added in 9.4 which causes that the price provider doesnt get hit when the Price of a product is requested for the same product in a product list template.

I have 2 pages with the same product list and index query output.
On page 1 I want product field X displayed when requesting Price.Price
On page 2 I want product field Y displayed when requesting Price.Price
My price provider handles this display value and worked fine up until upgrading to 9.4.

Whichever page I go to first gets the correct price displayed, when switching pages the price provider doesn't get hit and shows the wrong price!

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Peter

The .Price caching is the same as always - but the new productservice does a much better job at caching products so you do not get new instances all the time - so it is the product instance that is cached.

To solve your issue, I've added a Product.ClearPriceCache() method that you can call prior to showing prices to allow you to trigger your priceprovider more often.

TFS#46707, out with next 9.4 hotfix.

Hope this clarifies and helps you.

BR Nicolai

Votes for this answer: 1
 
Peter Leleulya
Reply

Superb! Thanks!

 

You must be logged in to post in the forum