Developer forum

Forum » Development » PriceProvider call 2 times when user logged in and second time Pricecontext.customer=null

PriceProvider call 2 times when user logged in and second time Pricecontext.customer=null

Shiwanka Chathuranga
Reply

PriceProvider call 2 times when product detail request and user logged in, second time Pricecontext.customer=null 

v 9.17.2

* First time

 

Seond Time 

 

any clue what could be the case?

 


Replies

 
Shiwanka Chathuranga
Reply
This post has been marked as an answer

I found the solution

we are creating custom ProductViewModel and for the settings we are not passing userId

    ProductViewModelSettings productSetting = new ProductViewModelSettings
    {
        LanguageId = Dynamicweb.Ecommerce.Common.Context.LanguageID,
        CurrencyCode = Dynamicweb.Ecommerce.Common.Context.Currency.Code,
        CountryCode = Dynamicweb.Ecommerce.Common.Context.Country.Code2,
        ShopId = Pageview.Area.EcomShopId,
       
UserId= uersId
    };

ProductViewModel variantProd = ViewModelFactory.CreateView(productSetting, product.Id, variantId);

Issue is solved 

Votes for this answer: 1

 

You must be logged in to post in the forum