Error executing template "Designs/identity_v2/eCom/Product/espresso.cshtml" System.ArgumentException: An item with the same key has already been added. at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at Co3.Espresso.Website.Models.FrontEnd.Ecommerce.EspressoProduct.get_VariantCombinations() at CompiledRazorTemplates.Dynamic.RazorEngine_64e1723cb683404b8e9565ab21caee82.Execute() in D:\dynamicweb.net\Solutions\id.espresso4.dk-e5\Files\Templates\Designs\identity_v2\eCom\Product\espresso.cshtml:line 247 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 Co3.Espresso.Website.TemplateBases.Paragraphs.Module 2 @using System.Web 3 @using Co3.Espresso.Base.Extensions 4 @using Co3.Espresso.Website.Models 5 @using Co3.Espresso.Website.Services 6 @using Co3.Espresso.Website.Models.FrontEnd 7 @using Co3.Espresso.Website.Models.FrontEnd.Settings 8 @using Co3.Espresso.Website.Models.FrontEnd.Ecommerce 9 @using Co3.Espresso.Website.Models.FrontEnd.Elements 10 @using Co3.Espresso.Website.Models.FrontEnd.Handlebars 11 @using Co3.ID.Dw.Helpers 12 @using Co3.ID.Dw.Models.Frontend.Ecommerce 13 @using Co3.ID.Dw.Models.Frontend.Users 14 @using Co3.ID.Dw.Services 15 @using Dynamicweb.Content.Items 16 @using Dynamicweb.Ecommerce.Products 17 @using Dynamicweb.Ecommerce.Products.Categories 18 @using Dynamicweb.Frontend 19 @using Dynamicweb.Security.UserManagement 20 @using Newtonsoft.Json 21 @using ProductService = Co3.Espresso.Website.Services.ProductService 22 @using RenderingService = Co3.Espresso.Website.Services.RenderingService 23 24 @{ 25 ShopType shopContext = SiteContext.CurrentSiteContext(); 26 User currentUser = PageView.Current().User; 27 bool isCustomerShop = (PageView.Current().Area.Item["IsCustomerShop"] != null && (bool)PageView.Current().Area.Item["IsCustomerShop"] == true); 28 29 IdentityProduct espressoProduct = (IdentityProduct) ProductService.Instance.GetEspressoProduct( 30 new ProductSettings() 31 { 32 Id = GetString("Ecom:Product.ID"), 33 VariantId = GetString("Ecom:Product.VariantID"), 34 PrimaryVariantId = GetString("Ecom:Product.DefaultVariantComboID") 35 } 36 ); 37 38 HttpContext.Current.Items["IdentityProduct"] = espressoProduct; 39 string relewiseRecommendationsSettings = PageView.Current().Area.Item["RelewiseProductDetailsRecommendations"]?.ToString(); 40 string relewiseShowRecommendations = PageView.Current().Area.Item["ShowRecommendations"]?.ToString(); 41 42 43 ScriptService.Instance.AddScript("identity.pdf"); 44 ScriptService.Instance.AddScript("identity.ui.popover"); 45 ScriptService.Instance.AddScript("identity.swiper"); 46 } 47 @RenderingService.Instance.SectionEnd() 48 49 <div class="e-product js-e-product" data-has-variants="@espressoProduct.HasVariants.ToString().ToLower()" data-product-id="@espressoProduct.Id" data-variant-id="@espressoProduct.VariantId"> 50 51 @RenderingService.Instance.SectionStart(new SectionSettings 52 { 53 Classes = new ClassList("e-section pb-0 px-0"), 54 ContainerClasses = new ClassList("container-fluid overflow-hidden p-0"), 55 OuterRowClasses = new ClassList("row"), 56 InnerRowClasses = new ClassList("row"), 57 }) 58 <div class="col-12"> 59 <div class="row"> 60 <div class="col-12 col-sm-4 px-sm-3"> 61 <div class="e-product-text-container"> 62 @if (!isCustomerShop) 63 { 64 <div class="d-block d-sm-none text-center no-gutters"> 65 @RenderingService.Instance.PartialView("ecom/product/partials/identity-part-genders.cshtml", espressoProduct) 66 </div> 67 } 68 <div class="identity-corner-brackets-container identity-corner-brackets-left border-primary @(!isCustomerShop ? "py-1 px-2" : string.Empty ) my-2 bracket-productname"> 69 <div class="identity-corner-brackets-wrapper border-primary"> 70 <h1 class="e-product-name font-weight-bold h2 mb-0 "> 71 @espressoProduct.Name 72 </h1> 73 <p class="lead font-weight-normal mb-0"> 74 @Translate("eCom Product - Product Number - Text", "Number") @espressoProduct.Number 75 </p> 76 </div> 77 </div> 78 @if (!isCustomerShop) 79 { 80 <div class="d-none d-sm-block no-gutters"> 81 @RenderingService.Instance.PartialView("ecom/product/partials/identity-part-genders.cshtml", espressoProduct) 82 </div> 83 } 84 <div class="js-identity-prices-container"> 85 @RenderingService.Instance.PartialView("ecom/product/partials/prices.cshtml", espressoProduct) 86 </div> 87 <div class="e-product-text mb-2 d-none d-sm-block"> 88 @{ 89 bool doTruncate = espressoProduct.DescriptionLong.StripHtml().Length > 180; 90 } 91 @RenderingService.Instance.SectionStart(new SectionSettings 92 { 93 Classes = new ClassList("identity-product-text js-identity-product-text p-0 m-0 position-relative"), 94 ContainerClasses = new ClassList("p-0 m-0"), 95 ContentClasses = new ClassList("col-12"), 96 Collapsible = doTruncate, 97 CollapseToggleTextCollapse = " ", 98 CollapseToggleTextExpand = " " 99 }) 100 <div class="col-12"> 101 @{ 102 string description = espressoProduct.DescriptionLong; 103 104 if (doTruncate) 105 { 106 string truncatedDescription = espressoProduct.DescriptionLong.StripHtml().Substring(0, Math.Min(180, espressoProduct.DescriptionLong.StripHtml().Length)); 107 108 description = string.Format("{0}...<span class='identity-inline-collapse-link'>{1}</span>", truncatedDescription, Translate("Product description - show more", "Vis mere")); 109 } 110 111 <div class="@(doTruncate ? "js-identity-product-description-truncated" : string.Empty)" data-full-text="@(doTruncate ? HttpUtility.HtmlAttributeEncode(espressoProduct.DescriptionLong) : string.Empty)" data-partial-text="@(doTruncate ? description : string.Empty)"> 112 @description 113 </div> 114 } 115 </div> 116 @RenderingService.Instance.SectionEnd() 117 </div> 118 @RenderingService.Instance.PartialView("ecom/product/partials/add-to-cart.cshtml", espressoProduct) 119 @if ( shopContext == ShopType.B2B ) 120 { 121 <a class="btn btn-primary position-relative mb-2 js-toggle-matrix-modal-btn" href="" data-toggle="modal" data-target=".js-e-product-matrix-modal"> 122 @Translate("eCom Product - Open Matrix - Button", "Vælg størrelser") 123 </a> 124 } else if (shopContext == ShopType.CustomerShop) 125 { 126 <a class="btn btn-primary position-relative mb-2 js-toggle-matrix-modal-btn js-toggle-matrix-modal-btn-customershop" href="#"> 127 @Translate("eCom Product - Open Matrix - Button", "Vælg størrelser") 128 </a> 129 } 130 <div class="row d-block d-sm-none"> 131 <div class="e-product-text mt-3 mb-4"> 132 <div class="col-12"> 133 @espressoProduct.DescriptionLong 134 </div> 135 </div> 136 </div> 137 @if (shopContext == ShopType.B2B && isCustomerShop == false) 138 { 139 <div class="e-product-downloads"> 140 @RenderingService.Instance.PartialView("ecom/product/partials/part-downloads.cshtml", espressoProduct) 141 </div> 142 } 143 @if ((shopContext != ShopType.B2B && shopContext != ShopType.CustomerShop) && PageView.Current().IsBasketEnabled()) 144 { 145 <div class="e-product-delivery font-weight-bold mb-2 text-heading"> 146 @RenderingService.Instance.PartialView("ecom/product/partials/delivery-info.cshtml", espressoProduct) 147 </div> 148 } 149 150 </div> 151 </div> 152 <div class="col-12 col-sm-1"></div> 153 <div class="col-12 col-sm-7 order-first"> 154 <div class="e-product-image-container js-e-product-images"> 155 @RenderingService.Instance.PartialView("ecom/product/partials/images_swiper.cshtml", espressoProduct) 156 </div> 157 </div> 158 159 </div> 160 </div> 161 @RenderingService.Instance.SectionEnd() 162 163 @{ 164 int uspPageContentPageId; 165 int.TryParse(PageView.Current().CurrentParagraph.Item["USPPageId"]?.ToString(), out uspPageContentPageId); 166 } 167 @if (uspPageContentPageId > 0 && shopContext == ShopType.B2B) 168 { 169 @RenderingService.Instance.SectionStart(new SectionSettings 170 { 171 Classes = new ClassList("e-section p-section mx-auto py-0"), 172 ContentClasses = new ClassList("col-12 col-lg-8 col-xl-7 mx-auto") 173 }) 174 <div class="row"> 175 @RenderPageContent(uspPageContentPageId) 176 </div> 177 @RenderingService.Instance.SectionEnd() 178 179 } 180 @RenderingService.Instance.SectionStart(new SectionSettings 181 { 182 Classes = new ClassList("e-section p-section mx-auto py-0"), 183 ContentClasses = new ClassList("col-12 mx-auto"), 184 InnerRowClasses = new ClassList("row js-identity-specifications-container identity-specifications-container"), 185 186 187 }) 188 189 190 191 @RenderingService.Instance.SectionEnd() 192 @{ 193 int detailsPageContetPageId; 194 195 int.TryParse(PageView.Current().Area.Item["ProductDetailsPage"]?.ToString(), out detailsPageContetPageId); 196 } 197 198 199 @if (detailsPageContetPageId > 0) 200 { 201 @RenderingService.Instance.SectionStart(new SectionSettings 202 { 203 Classes = new ClassList("e-section p-section mx-auto py-0"), 204 ContentClasses = new ClassList("col-12 col-lg-8 col-xl-7 mx-auto") 205 }) 206 <div class="row"> 207 @RenderPageContent(detailsPageContetPageId) 208 </div> 209 @RenderingService.Instance.SectionEnd() 210 } 211 212 213 214 215 @if (relewiseShowRecommendations == "True" && string.IsNullOrEmpty(relewiseRecommendationsSettings) == false) 216 { 217 @RenderingService.Instance.SectionStart(new SectionSettings 218 { 219 Classes = new ClassList("e-section py-1"), 220 ContentClasses = new ClassList("col-12 mx-auto"), 221 InnerRowClasses = new ClassList("row js-identity-recommendations-container"), 222 }) 223 224 @RenderingService.Instance.SectionEnd() 225 } 226 227 228 229 @if (shopContext == ShopType.B2B) 230 { 231 @RenderingService.Instance.PartialView("eCom/Product/partials/part-product-matrix.cshtml", espressoProduct) 232 } else if (shopContext == ShopType.CustomerShop) 233 { 234 <div class="js-identity-customershop-matrix-modal-placeholder" data-product-id="@espressoProduct.Id" data-variant-id="@espressoProduct.VariantId" data-brand-code="@espressoProduct.BrandCode"></div> 235 } 236 237 @RenderingService.Instance.PartialView("ecom/product/partials/identity-part-sizeguide-modal.cshtml", espressoProduct) 238 @RenderingService.Instance.PartialView("ecom/product/partials/identity-part-deliveryinfo-modal.cshtml", espressoProduct) 239 240 @RenderingService.Instance.PartialView("ecom/product/partials/metadata.cshtml", espressoProduct) 241 @RenderingService.Instance.PartialView("ecom/product/partials/gtm-tracking.cshtml", espressoProduct) 242 243 <code class="js-e-breadcrumb-item-append" data-link="@HttpUtility.HtmlAttributeEncode(espressoProduct.Link)" data-text="@HttpUtility.HtmlAttributeEncode(espressoProduct.Name)"></code> 244 245 <script> 246 e4.data.set( '@(espressoProduct.Id)_VariantCombinationTree', JSON.parse('@HttpUtility.JavaScriptStringEncode(Co3.Espresso.Website.Services.JsonService.Instance.ToJson(espressoProduct.VariantCombinationTree))') ); 247 e4.data.set( '@(espressoProduct.Id)_VariantCombinationIds', JSON.parse('@HttpUtility.JavaScriptStringEncode(Co3.Espresso.Website.Services.JsonService.Instance.ToJson(espressoProduct.VariantCombinations.Keys))') ); 248 e4.data.set( '@(espressoProduct.Id)_PdfData', JSON.parse('@HttpUtility.JavaScriptStringEncode(RenderingService.Instance.PartialView("ecom/product/partials/part-pdf-data.cshtml", espressoProduct))') ); 249 </script> 250 251 </div> 252 @RenderingService.Instance.SectionStart(new SectionSettings())
Oświadczenie o odpowiedzialności społecznej, por. art. 99a duńskiej ustawy o składaniu rocznych sprawozdań finansowych.
Zobacz nasz raport dot. odpowiedzialności tutaj