PARIS BAMBOO BENCH 100X30.5X44CM - GRAY
0228471
In stock
Shop our Living Room Range: Sofas, Tables, Armchairs, Recliner Sofa Chairs, Stools, Bean Bags, TV Units
Error executing template "Designs/Swift/Paragraph/MerchantListingStructuredData__ProductListPage.cshtml" System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. at System.ThrowHelper.ThrowKeyNotFoundException() at System.Collections.Generic.Dictionary`2.get_Item(TKey key) at CompiledRazorTemplates.Dynamic.RazorEngine_f4570c7d222145d9aadbf69ce78ddca9.Execute() in D:\dynamicweb.net\Solutions\Nextech\superhome.cloud.dynamicweb-cms.com\Files\Templates\Designs\Swift\Paragraph\MerchantListingStructuredData__ProductListPage.cshtml:line 57 at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader) at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer) at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter) at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template) at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template) at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 @using Dynamicweb.Ecommerce.ProductCatalog 3 @using Dynamicweb.Ecommerce.CustomerExperienceCenter.Favorites 4 @using System.Linq 5 @using Dynamicweb.Core 6 @using System.Web 7 @{ bool isDetailPage = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString.Get("ProductID")); 8 ProductListViewModel productList = new ProductListViewModel(); 9 if (Dynamicweb.Context.Current.Items.Contains("ProductList")) 10 { 11 productList = (ProductListViewModel)Dynamicweb.Context.Current.Items["ProductList"]; 12 } 13 } 14 15 16 @*if (!isDetailPage)*@ 17 @if (!isDetailPage && productList != null && productList.Products != null) 18 { 19 IEnumerable<MediaViewModel> assetsList = new MediaViewModel[] { }; 20 21 @SnippetStart("MerchantlistingJSON") string siteLanguage = Pageview.Area.CultureInfo.Name; 22 Uri url = Dynamicweb.Context.Current.Request.Url; 23 string hostName = url.Host; // domain.com/da-dk or domain.com/en-us 24 string delimit = ""; 25 int count = 1; 26 <script type="application/ld+json"> 27 { 28 "@@context": "https://schema.org", 29 "@@type": "ItemList", 30 "itemListElement": [@foreach (ProductViewModel product in productList.Products) 31 {<text>@delimit 32 { 33 "@@type": "ListItem", 34 "position": "@(count++)", 35 "item": { 36 "@@type": "Product", 37 "name": "@product.Name", 38 "image": @if (product.DefaultImage.Value != null && !string.IsNullOrEmpty(product.DefaultImage.Value.ToString())) 39 {<text>[ 40 @{ 41 //assetsList = assetsList.Union(product.ImagePatternImages); 42 assetsList = product.ImagePatternImages; 43 var allImages = new List<string> { product.DefaultImage.Value }; 44 allImages.AddRange(assetsList.Select(a => a.Value)); 45 46 for (int i = 0; i < allImages.Count; i++) 47 { 48 <text>"@url.Scheme://@hostName@allImages[i]"</text> if (i < allImages.Count - 1) {<text>,</text>}<text></text> 49 } 50 } 51 ]</text>} else { <text>"@url.Scheme://@hostName/Files/Images/missing_image.jpg"</text>}, 52 "description": "@HttpUtility.JavaScriptStringEncode(product.ShortDescription)", 53 "sku": "@product.Number", 54 "mpn": "@product.Number", 55 "brand": { 56 "@@type": "Brand", 57 "name": "@product.ProductFields["Brand"].Value" 58 }, 59 "offers": { 60 "@@type": "Offer", 61 "url": @{var defaultGroupId = product.PrimaryOrDefaultGroup.Id;var selectedDetailsPage = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(defaultGroupId).Meta.PrimaryPage;selectedDetailsPage = !string.IsNullOrEmpty(selectedDetailsPage) ? selectedDetailsPage : $"Default.aspx?ID={GetPageIdByNavigationTag("ProductDetailPage").ToString()}"; string productDetailLink = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl($"{selectedDetailsPage}&GroupID={defaultGroupId}&ProductID={product.Id}");} "@url.Scheme://@hostName@productDetailLink", 62 "priceCurrency": "@product.Price.CurrencyCode", 63 "price": @product.Price.PriceWithoutVat, 64 "itemCondition": "https://schema.org/NewCondition", 65 "availability": @{double? currentStockLevel = product.StockLevel;string stockStateLabel = currentStockLevel > 0 ? Translate("InStock") : Translate("OutOfStock");}"https://schema.org/@stockStateLabel" 66 } 67 } 68 }</text>delimit = ","; 69 } 70 ] 71 } 72 </script> 73 @SnippetEnd("MerchantlistingJSON") } 74 else if (Pageview.IsVisualEditorMode) 75 { 76 <div class="alert alert-warning">@Translate("No products available")</div>}