Developer forum

Forum » Dynamicweb 9.0 Upgrade issues » HandlePricesExclusively in 9.8

HandlePricesExclusively in 9.8

Anders Ebdrup
Anders Ebdrup
Reply

Dear Dynamicweb,

 

After upgrading a solution to 9.8 it seems like the property: HandlePricesExclusively does not have effect in our custom priceprovider, as Dynamicweb now tries to calculate the price for every single product.

Will you please try to look into this?

 

Best regards, Anders


Replies

 
Nicolai Pedersen
Reply

Hi Anders

We will have a look at it.

A quick peak at the priceprovider and pricemanager history does not indicate any change related to this property since 9.7.

Can you maybe provide a bit more information or your code related to this?

Thanks, Nicolai

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply
This post has been marked as an answer

Hi Anders,

I have looked into this, but was unable to reproduce the issue that you describe.

When using the following custom provider then the default price provider is not called.

public class ExclusivePriceProvider : PriceProvider
{
    public override bool HandlePricesExclusively => true;

    public override PriceRaw FindPrice(Product product, double quantity, string variantId, Currency currency, string unitId, User user, double quantityAllVariants, string shopId)
    {
        if(string.Equals(product.Number, "PriceNull"))
            return null;

        return new PriceRaw(1000, currency);
    }
}

This works as expected.

Can you provide more details about the issue? Where do you see wrong prices? 

How is your price provider implemented? Is it never being called?

Best regards,
Morten

Votes for this answer: 1
 
Anders Ebdrup
Anders Ebdrup
Reply

Dear Morten,

 

I am sorry for the confusing, and it is working as expected. We have localized the changed behaviour to our change to using viewmodels on the productlist where prices was not preloaded as expected.

 

Sorry.

 

Best regards, Anders

 
Martin Vang
Martin Vang
Reply

Hi Anders,

Can you please provide an example of how you use the viewmodels? Any productlistviewmodel should behave in the same way that our normal product catalog preloads product prices (eg. bulk). So if the prices are not preloaded, I would assume that you're using the viewmodels in a way that is different from what we expect (which just means, that we need to support it better).

BR

Martin

 

 
Anders Ebdrup
Anders Ebdrup
Reply

Dear Martin,

 

This was caused by a lot of custom code that was not rewritten, so for now, this is not relevant.

 

Best regards, Anders

 

You must be logged in to post in the forum