Posted on 27/03/2024 17:12:29
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