Developer forum

Forum » Development » Bug when the PriceProvider is called after upgrading to 9.13.11

Bug when the PriceProvider is called after upgrading to 9.13.11

Emil Dumitrescu


After upgrading to 9.13.11 we saw that the prices weren't retrieved in cart anymore using the price provider, while in the product list or product detail everything was fine. After debugging we saw that for the price provider call in the cart context, Dynamicweb passes an empty user to the price provider:

 PriceRaw FindPrice(Product product, double quantity, string variantId, International.Currency currency, string unitId, User user)

The user argument is null, but only when it is in a cart context (like adding to cart), otherwise everything it's fine.

We patched it by using in the price provider the following line at the start of the method:

 user = user ?? User.GetCurrentExtranetUser();

Please fix this as a lot of existing solutions will suffer from this bug.




Morten Bengtson Dynamicweb Employee
Morten Bengtson

Hi Emil,

I can't reproduce that issue. It should only occur if the order doesn't have a valid user id set in Order.CustomerAccessUserId (EcomOrders.OrderCustomerAccessUserId in the database).
Does this problem occur when using the shopping cart app on a page or in some other context?
Are you using impersonation? Are you using our live integration?
Please check for build warnings in your custom code and see if you are using any obsolete methods in our API.

Best regards,

Emil Dumitrescu

Hello Morten,

Thanks for the response.

It's a standard cart module and the user is not impersonated. It's from an old live integration template based project. The method is indeed marked as obsolete, and now it's a newer one, PriceRaw FindPrice(PriceContext context, PriceProductSelection selection), the problem with existing one is that it behaves bad just in this context, in cart, otherwise it works fine. I guess we will have to migrate to the new method on all of our solutions, to not have to use that patch.




You must be logged in to post in the forum