Hi,
We use a product catalog for our product overview. On the template we use the following code to loop through the products:
var products = GetLoop("Products");
if (products.Count > 0)
{
foreach (var product in products)
{
@if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product.ImageSmall.Default.Clean")))
{
<img src="@product.GetValue("Ecom:Product.ImageSmall.Default.Clean")" class="img-responsive" />
}
}
}
When i try to print just the product name it works fine, but as soon as i try to print the image or the TemplateTags i see the following error:
An error occurred while attaching module (Dynamicweb.Frontend.Content)
System.InvalidOperationException: Initialization has not completed yet. The InitializationComplete method must be invoked before Dispose is invoked.
at System.Runtime.Caching.ChangeMonitor.Dispose()
at Dynamicweb.Caching.FileChangeMonitor..ctor(IEnumerable`1 paths)
at Dynamicweb.Caching.MemoryCacheManager.ConvertCachePolicy(CacheItemPolicy policy)
at Dynamicweb.Caching.MemoryCacheManager.Set(String key, Object cacheItem, CacheItemPolicy policy)
at Dynamicweb.Ecommerce.Products.ProductImageService.FileExists(String filePath)
at Dynamicweb.Ecommerce.Products.ProductImageService.GetProductImage(String imagePath, String imageSize)
at Dynamicweb.Ecommerce.Frontend.Renderer.RenderImagePatternItemShared(ImagePattern image, String imageFile, String productNumber, Template template, String tagPrefix)
at Dynamicweb.Ecommerce.Frontend.Renderer.RenderImagePatterns(IList`1 imagePatterns, Product product, Template template, String tagPrefix, ProductCatalogSettings paragraphSettings, Shop shop, RenderingContext renderingContext)
at Dynamicweb.Ecommerce.Frontend.Renderer.RenderProduct(Product product, Boolean extendedProperties, Template template, Int32 loopCounter, Boolean renderRelated, String productUrl, Int32 quantity, Int32 wishListId, Boolean renderPublicList, Boolean isRecursiveCall, Lazy`1 categoryFieldSorting, Int32 orderLineOfProductCount, RenderingContext renderingContext, String unitId)
at Dynamicweb.Ecommerce.Frontend.Renderer.RenderProducts(ProductCollection products, Template parentTemplate, String loopName, Int32 loopCounter, Boolean renderRelatedProducts, Boolean renderRelatedLists, Boolean isRecursive, RenderingContext renderingContext)
at Dynamicweb.Ecommerce.Frontend.Renderer.RenderProductsWithContext(ProductCollection products, Template parentTemplate, RenderingContext renderingContext)
at Dynamicweb.Ecommerce.Frontend.Renderer.RenderProducts(ProductCollection products)
at Dynamicweb.Ecommerce.Frontend.Frontend.ListProducts(ProductCollection products, String groupsIdent, Boolean hasBeenSorted)
at Dynamicweb.Ecommerce.Frontend.Frontend.List(String groups)
at Dynamicweb.Ecommerce.Frontend.Frontend.EcomRender()
at Dynamicweb.Ecommerce.Frontend.Frontend.GetContent()
at Dynamicweb.Frontend.Content.GetModuleOutput(Paragraph paragraph, PageView pageview)