diff --git a/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Cache/ResponseCache.cs b/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Cache/ResponseCache.cs index 50ca201..096ae4a 100644 --- a/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Cache/ResponseCache.cs +++ b/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Cache/ResponseCache.cs @@ -205,6 +205,7 @@ public static bool IsProductInCache(ResponseCacheLevel productCacheLevel, string if (cachedProductInfo.TryGetValue(productIdentifier, out var productInfo)) { + if (productInfo is null) return true; return Equals(currency.Code, productInfo["CurrencyCode"]); } } diff --git a/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Dynamicweb.Ecommerce.DynamicwebLiveIntegration.csproj b/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Dynamicweb.Ecommerce.DynamicwebLiveIntegration.csproj index f3646fa..6888e21 100644 --- a/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Dynamicweb.Ecommerce.DynamicwebLiveIntegration.csproj +++ b/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Dynamicweb.Ecommerce.DynamicwebLiveIntegration.csproj @@ -1,6 +1,6 @@  - 10.4.26 + 10.4.27 1.0.0.0 Live Integration Live Integration diff --git a/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Products/ProductManager.cs b/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Products/ProductManager.cs index 9e7b6b0..8286d38 100644 --- a/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Products/ProductManager.cs +++ b/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Products/ProductManager.cs @@ -212,7 +212,7 @@ private static bool FetchProductInfosInternal(List produc // Parse the response Dictionary prices = ProcessResponse(settings, response, logger, context); - if (prices != null && prices.Count > 0) + if (prices != null) { if (updateCache) { @@ -225,7 +225,14 @@ private static bool FetchProductInfosInternal(List produc cachedProductInfos.Remove(productKey); cachedProductInfos.Add(productKey, prices[productKey]); } - } + // Cache empty values for products that were in the request but were not returned in the response + + foreach (var priceProductSelection in productsForRequest) + { + var productIdentifier = ProductProvider.GetProductIdentifier(settings, priceProductSelection.Product, priceProductSelection.UnitId); + cachedProductInfos.TryAdd(productIdentifier, null); + } + } } } else