Shim-pack GIST PFPP, 5um, 4.6 x 75mm LC Column

Shim-pack GIST PFPP, 5um, 4.6 x 75mm LC Column

Error executing template "Designs/Swift/Paragraph/Swift_ProductSpecification.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 Dynamicweb.Ecommerce.Products.GroupRelation.GetGroupRelationsByChildId(String childId)
   at Dynamicweb.Ecommerce.ProductCategoryFieldService.GetCategoriesFromGroups(List`1 categories, HashSet`1& idsHash, IEnumerable`1 groups, Int32 currentLevel, Int32 minLevel, Nullable`1 maxLevel)
   at Dynamicweb.Ecommerce.ProductCategoryFieldService.GetInheritedCategories(IEnumerable`1 groups, Boolean includeProductProperties)
   at Dynamicweb.Ecommerce.ProductCatalog.ViewEngine.GetFieldDisplayGroupValues(ProductViewModelSettings settings, Product product, String languageID, Lazy`1 productIds)
   at Dynamicweb.Ecommerce.ProductCatalog.ViewEngine.<>c__DisplayClass3_1.<BulkCreateView>b__60()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at CompiledRazorTemplates.Dynamic.RazorEngine_af4ccbf92bb0460daf594ab67bdc3ea3.Execute() in F:\Domains\Sites\dev-szu.mydwsite3.com\Files\Templates\Designs\Swift\Paragraph\Swift_ProductSpecification.cshtml:line 29
   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 4 @{ 5 ProductViewModel product = null; 6 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 7 { 8 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"]; 9 } 10 else if (Pageview.Page.Item["DummyProduct"] != null && Pageview.IsVisualEditorMode) 11 { 12 var pageViewModel = Dynamicweb.Frontend.ContentViewModelFactory.CreatePageInfoViewModel(Pageview.Page); 13 ProductListViewModel productList = pageViewModel.Item.GetValue("DummyProduct") != null ? pageViewModel.Item.GetValue("DummyProduct") as ProductListViewModel : new ProductListViewModel(); 14 15 if (productList?.Products is object) 16 { 17 product = productList.Products[0]; 18 } 19 } 20 } 21 22 @if (product is object) 23 { 24 IEnumerable<string> selectedDisplayGroupIds = Model.Item.GetRawValueString("DisplayGroups").Split(',').ToList(); 25 List<CategoryFieldViewModel> displayGroups = new List<CategoryFieldViewModel>(); 26 27 foreach (var selection in selectedDisplayGroupIds) 28 { 29 foreach (CategoryFieldViewModel group in product.FieldDisplayGroups.Values) 30 { 31 if (selection == group.Id) 32 { 33 int fieldsWithNoValueOrZero = 0; 34 35 foreach (var field in group.Fields) 36 { 37 if (string.IsNullOrEmpty(field.Value.Value.ToString())) 38 { 39 fieldsWithNoValueOrZero++; 40 } 41 } 42 43 if (fieldsWithNoValueOrZero != group.Fields.Count) 44 { 45 displayGroups.Add(group); 46 } 47 } 48 } 49 } 50 51 bool showProductFields = Model.Item.GetBoolean("ProductFields"); 52 53 bool hideTitle = Model.Item.GetBoolean("HideTitle"); 54 55 string theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? " theme " + Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : ""; 56 57 string titleFontSize = Model.Item.GetRawValueString("TitleFontSize", "display-4"); 58 59 string contentPadding = Model.Item.GetRawValueString("ContentPadding", ""); 60 contentPadding = contentPadding == "none" ? string.Empty : contentPadding; 61 contentPadding = contentPadding == "small" ? " p-2 p-md-3" : contentPadding; 62 contentPadding = contentPadding == "large" ? " p-4 p-md-5" : contentPadding; 63 64 string layout = Model.Item.GetRawValueString("Layout", "list"); 65 string size = Model.Item.GetRawValueString("Size", "full"); 66 string gaps = size == "full" ? " gap-4" : " gap-2"; 67 68 69 if (Pageview.IsVisualEditorMode && displayGroups.Count() == 0) 70 { 71 product.ProductFields.Clear(); 72 product.ProductFields.Add(Translate("Width"), new FieldValueViewModel { Name = Translate("Width"), Value = "99cm" }); 73 product.ProductFields.Add(Translate("Height"), new FieldValueViewModel { Name = Translate("Height"), Value = "195cm" }); 74 showProductFields = true; 75 } 76 77 if (layout == "commas") 78 { 79 gaps = size == "full" ? " gap-4" : " gap-2"; 80 81 } 82 83 <div class="h-100@(theme)@(contentPadding) item_@Model.Item.SystemName.ToLower()"> 84 <div class="grid@(gaps)"> 85 @if ((product.ProductFields != null && Model.Item.GetBoolean("ProductFields")) || (product.ProductCategories != null && Model.Item.GetBoolean("CategoryFields")) || (displayGroups.Count != 0)) 86 { 87 if (!hideTitle) 88 { 89 <h2 class="g-col-12 @titleFontSize">@Model.Item.GetString("Title")</h2> 90 } 91 } 92 93 @if (displayGroups.Count != 0) 94 { 95 if (layout != "accordion") 96 { 97 foreach (var group in displayGroups) 98 { 99 bool hideHeader = Model.Item.GetBoolean("HideGroupHeaders"); 100 101 if (!hideHeader) 102 { 103 <h4 class="g-col-12 h4 mb-0">@group.Name</h4> 104 } 105 106 { @RenderFieldsFromList(group.Fields, layout) } 107 108 } 109 } 110 else 111 { 112 <div class="g-col-12"> 113 <div class="accordion accordion-flush w-100" id="Specifications_@Model.ID"> 114 @foreach (var group in displayGroups) 115 { 116 <div class="accordion-item"> 117 <h2 class="accordion-header" id="SpecificationHeading_@group.Id"> 118 <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#SpecificationItem_@group.Id" aria-expanded="false" aria-controls="SpecificationItem_@group.Id"> 119 @group.Name 120 </button> 121 </h2> 122 <div id="SpecificationItem_@group.Id" class="accordion-collapse collapse" aria-labelledby="SpecificationHeading_@group.Id" data-bs-parent="#Specifications_@Model.ID"> 123 <div class="accordion-body"> 124 @{ @RenderFieldsFromList(group.Fields, "list") } 125 </div> 126 </div> 127 </div> 128 } 129 </div> 130 </div> 131 } 132 } 133 134 @if (product.ProductFields != null && showProductFields) 135 { 136 if (product.ProductFields.Count > 0) 137 { 138 if (layout != "accordion") 139 { 140 {@RenderFieldsFromList(product.ProductFields, layout) } 141 } 142 else 143 { 144 <div class="g-col-12"> 145 <div class="accordion accordion-flush w-100" id="Specifications_@Model.ID"> 146 <div class="accordion-item"> 147 <h2 class="accordion-header" id="SpecificationHeading_@Model.ID"> 148 <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#SpecificationItem_@Model.ID" aria-expanded="false" aria-controls="SpecificationItem_@Model.ID"> 149 @Translate("Specifications") 150 </button> 151 </h2> 152 <div id="SpecificationItem_@Model.ID" class="accordion-collapse" aria-labelledby="SpecificationHeading_@Model.ID" data-bs-parent="#Specifications_@Model.ID"> 153 <div class="accordion-body"> 154 @{ @RenderFieldsFromList(product.ProductFields, "List") } 155 </div> 156 </div> 157 </div> 158 </div> 159 </div> 160 } 161 } 162 } 163 164 @if (product.ProductCategories != null && Model.Item.GetBoolean("CategoryFields")) 165 { 166 if (product.ProductCategories.Count > 0) 167 { 168 if (layout != "accordion") 169 { 170 foreach (var group in product.ProductCategories) 171 { 172 CategoryFieldViewModel category = group.Value; 173 bool hideHeader = Model.Item.GetBoolean("HideGroupHeaders"); 174 175 if (!hideHeader) 176 { 177 <h4 class="g-col-12 h4 mb-0">@group.Value.Name</h4> 178 } 179 180 { @RenderFieldsFromList(category.Fields, layout) } 181 } 182 } 183 else 184 { 185 <div class="g-col-12"> 186 <div class="accordion accordion-flush w-100" id="Specifications_@Model.ID"> 187 @foreach (var group in product.ProductCategories) 188 { 189 CategoryFieldViewModel category = group.Value; 190 191 <div class="accordion-item"> 192 <h2 class="accordion-header" id="SpecificationHeading_@group.Value.Id"> 193 <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#SpecificationItem_@group.Value.Id" aria-expanded="false" aria-controls="SpecificationItem_@group.Value.Id"> 194 @group.Value.Name 195 </button> 196 </h2> 197 <div id="SpecificationItem_@group.Value.Id" class="accordion-collapse" aria-labelledby="SpecificationHeading_@group.Value.Id" data-bs-parent="#Specifications_@Model.ID"> 198 <div class="accordion-body"> 199 @{ @RenderFieldsFromList(category.Fields, "list") } 200 </div> 201 </div> 202 </div> 203 } 204 </div> 205 </div> 206 } 207 } 208 } 209 </div> 210 </div> 211 } 212 else if (Pageview.IsVisualEditorMode) 213 { 214 <div class="alert alert-warning m-0">@Translate("No products available")</div> 215 } 216 217 @helper RenderFieldsFromList(Dictionary<string, FieldValueViewModel> fields, string layout) 218 { 219 string size = Model.Item.GetRawValueString("Size", "full"); 220 string gaps = size != "full" ? " gap-1" : string.Empty; 221 bool hideFieldLabels = Model.Item.GetBoolean("HideFieldLabels"); 222 bool hideFieldsWithZeroValue = Model.Item.GetBoolean("HideFieldsWithZeroValue"); 223 224 if (layout == "columns") 225 { 226 <div class="g-col-12"> 227 <div class="grid@(gaps)"> 228 @foreach (var field in fields) 229 { 230 {@RenderField(field.Value, layout)} 231 } 232 </div> 233 </div> 234 } 235 if (layout == "list") 236 { 237 <div class="g-col-12"> 238 <dl class="grid@(gaps)"> 239 @foreach (var field in fields) 240 { 241 {@RenderField(field.Value, layout)} 242 } 243 </dl> 244 </div> 245 } 246 if (layout == "table") 247 { 248 string tableSize = size == "full" ? "" : " table-sm"; 249 <div class="g-col-12 table-responsive"> 250 <table class="table @(tableSize)"> 251 @foreach (var field in fields) 252 { 253 {@RenderField(field.Value, layout)} 254 } 255 </table> 256 </div> 257 } 258 if (layout == "bullets") 259 { 260 string listSize = size == "full" ? "" : "m-0 p-0 lh-1 fs-7 opacity-75"; 261 string listStyle = size == "full" ? "" : "style=\"list-style-position: inside\""; 262 <div class="g-col-12"> 263 <ul class="@listSize" @listStyle> 264 @foreach (var field in fields) 265 { 266 {@RenderField(field.Value, layout)} 267 } 268 </ul> 269 </div> 270 } 271 if (layout == "commas") 272 { 273 List<string> featuresList = new List<string>(); 274 275 foreach (var field in fields) 276 { 277 string firstListItemValue = string.Empty; //Hack to support field type providers with a single value 278 279 if (field.Value?.Value != null) 280 { 281 if (field.Value.Value.GetType() == typeof(System.Collections.Generic.List<FieldOptionValueViewModel>)) 282 { 283 System.Collections.Generic.List<FieldOptionValueViewModel> values = field.Value.Value as System.Collections.Generic.List<FieldOptionValueViewModel>; 284 285 //Hack to support field type providers with a single value 286 if (values.FirstOrDefault() != null) 287 { 288 firstListItemValue = values.FirstOrDefault().Value; 289 } 290 } 291 } 292 293 if (!hideFieldsWithZeroValue || (firstListItemValue != "0" && firstListItemValue != "0.0" && field.Value.Value.ToString() != "0" && field.Value.Value.ToString() != "0.0")) 294 { 295 if (field.Value.Value is object && !string.IsNullOrEmpty(field.Value.Value.ToString())) 296 { 297 if (field.Value.Value.GetType() == typeof(System.Collections.Generic.List<FieldOptionValueViewModel>)) 298 { 299 List<string> options = new List<string>(); 300 foreach (FieldOptionValueViewModel option in field.Value.Value as System.Collections.Generic.List<FieldOptionValueViewModel>) 301 { 302 if (!string.IsNullOrWhiteSpace(option.Value)) 303 { 304 if ((option.Value.ToString().Contains("#") || option.Value.StartsWith("/Files/", StringComparison.OrdinalIgnoreCase)) && (Translate(field.Value.Name) == Translate("Color") || Translate(field.Value.Name) == Translate("Colour"))) 305 { 306 string colorSpan = "<span class=\"colorbox-sm\" style=\"background-color: " + option.Value + "\"></span>"; 307 if (option.Value.StartsWith("/Files/", StringComparison.OrdinalIgnoreCase)) 308 { 309 colorSpan = $"<img src=\"/Admin/Public/GetImage.ashx?width=16&height=16&image={option.Value}\">"; 310 } 311 options.Add(colorSpan); 312 } 313 else if (!string.IsNullOrEmpty(option.Value)) 314 { 315 options.Add(option.Name); 316 } 317 } 318 } 319 string optionsString = (string.Join(", ", options.Select(x => x.ToString()).ToArray())); 320 if ((Translate(field.Value.Name) == Translate("Color") || Translate(field.Value.Name) == Translate("Colour"))) 321 { 322 optionsString = (string.Join(" ", options.Select(x => x.ToString()).ToArray())); 323 } 324 325 if (!string.IsNullOrEmpty(optionsString)) 326 { 327 if (!hideFieldLabels) 328 { 329 featuresList.Add(field.Value.Name + ": " + optionsString); 330 } 331 else 332 { 333 featuresList.Add(optionsString); 334 } 335 } 336 } 337 else 338 { 339 if (!string.IsNullOrWhiteSpace(field.Value.Value.ToString())) 340 { 341 if ((field.Value.Value.ToString().Contains("#") || field.Value.Value.ToString().StartsWith("/Files/", StringComparison.OrdinalIgnoreCase)) && (Translate(field.Value.Name) == Translate("Color") || Translate(field.Value.Name) == Translate("Colour"))) 342 { 343 string colorSpan = "<span class=\"colorbox-sm\" style=\"background-color: " + field.Value.Value + "\"></span>"; 344 if(field.Value.Value.ToString().StartsWith("/Files/", StringComparison.OrdinalIgnoreCase)) 345 { 346 colorSpan = $"<img src=\"/Admin/Public/GetImage.ashx?width=16&height=16&image={field.Value.Value}\">"; 347 } 348 349 if (!hideFieldLabels) 350 { 351 featuresList.Add(field.Value.Name + ": " + colorSpan); 352 } 353 else 354 { 355 featuresList.Add(colorSpan); 356 } 357 } 358 else 359 { 360 if (!hideFieldLabels) 361 { 362 featuresList.Add(field.Value.Name + ": " + field.Value.Value.ToString()); 363 } 364 else 365 { 366 featuresList.Add(field.Value.Value.ToString()); 367 } 368 } 369 } 370 } 371 } 372 } 373 } 374 375 string featuresString = (string.Join(", ", featuresList.Select(x => x.ToString()).ToArray())); 376 377 <div class="g-col-12 opacity-75 fs-7">@featuresString</div> 378 } 379 } 380 381 @helper RenderField(FieldValueViewModel field, string layout) 382 { 383 string size = Model.Item.GetRawValueString("Size", "full"); 384 string fieldValue = field?.Value != null ? field.Value.ToString() : ""; 385 bool hideFieldLabels = Model.Item.GetBoolean("HideFieldLabels"); 386 bool noValues = false; 387 string firstListItemValue = string.Empty; //Hack to support field type providers with a single value 388 bool hideFieldsWithZeroValue = Model.Item.GetBoolean("HideFieldsWithZeroValue"); 389 390 if (!string.IsNullOrEmpty(fieldValue)) 391 { 392 if (field.Value.GetType() == typeof(System.Collections.Generic.List<FieldOptionValueViewModel>)) 393 { 394 System.Collections.Generic.List<FieldOptionValueViewModel> values = field.Value as System.Collections.Generic.List<FieldOptionValueViewModel>; 395 noValues = values.Count > 0 ? false : true; 396 397 //Hack to support field type providers with a single value 398 if (values.FirstOrDefault() != null) 399 { 400 firstListItemValue = values.FirstOrDefault().Value; 401 } 402 } 403 } 404 405 object fieldRawValue = field.Value; 406 bool isDateTime = fieldRawValue != null && (fieldRawValue.GetType().ToString().Equals("System.DateTime") || fieldRawValue.GetType().ToString().Equals("System.Date")); 407 bool isDateTimeValid = isDateTime && field.Value != null && Dynamicweb.Core.Converter.ToDateTime(field.Value).Year != 2999; //Avoid Null dates on standard DW Fields 408 409 if (!string.IsNullOrEmpty(fieldValue) && noValues == false && (!isDateTime || isDateTimeValid)) 410 { 411 if (!hideFieldsWithZeroValue || (firstListItemValue != "0" && firstListItemValue != "0.0" && field.Value.ToString() != "0" && field.Value.ToString() != "0.0")) 412 { 413 if (layout == "columns") 414 { 415 <div class="grid g-col-6 g-col-lg-4 gap-1"> 416 @if (!hideFieldLabels) 417 { 418 <dt class="g-col-12 g-col-lg-4">@field.Name</dt> 419 } 420 <dd class="g-col-12 g-col-lg-8 mb-0 text-break"> 421 @{ @RenderFieldValue(field) } 422 </dd> 423 </div> 424 } 425 if (layout == "list") 426 { 427 if (!hideFieldLabels) 428 { 429 <dt class="g-col-4">@field.Name</dt> 430 } 431 <dd class="g-col-8 mb-0 text-break"> 432 @{ @RenderFieldValue(field) } 433 </dd> 434 } 435 if (layout == "table") 436 { 437 <tr> 438 @if (!hideFieldLabels) 439 { 440 <td style="width: 35%;" scope="row">@field.Name</td> 441 } 442 <td class="text-break"> 443 @{ @RenderFieldValue(field) } 444 </td> 445 </tr> 446 } 447 if (layout == "bullets") 448 { 449 <li> 450 @if (!hideFieldLabels) 451 { 452 <strong>@field.Name</strong> 453 } 454 <span> 455 @{ @RenderFieldValue(field) } 456 </span> 457 </li> 458 } 459 } 460 } 461 } 462 463 @helper RenderFieldValue(FieldValueViewModel field) 464 { 465 string fieldValue = field?.Value != null ? field.Value.ToString() : ""; 466 467 bool isLink = field?.Type == "Link"; 468 bool isColor = false; 469 bool isBrandName = field?.SystemName == "Brand_name"; 470 471 fieldValue = fieldValue == "False" ? Translate("No") : fieldValue; 472 fieldValue = fieldValue == "True" ? Translate("Yes") : fieldValue; 473 474 475 if (field.Value.GetType() == typeof(System.Collections.Generic.List<Dynamicweb.Ecommerce.ProductCatalog.FieldOptionValueViewModel>)) 476 { 477 int valueCount = 0; 478 System.Collections.Generic.List<FieldOptionValueViewModel> values = field.Value as System.Collections.Generic.List<FieldOptionValueViewModel>; 479 int totalValues = values.Count; 480 481 foreach (FieldOptionValueViewModel option in values) 482 { 483 if (!string.IsNullOrEmpty(option.Value)) 484 { 485 if (option.Value.StartsWith("#", StringComparison.OrdinalIgnoreCase) || option.Value.StartsWith("/Files/", StringComparison.OrdinalIgnoreCase)) 486 { 487 isColor = true; 488 } 489 } 490 491 if (!isColor) 492 { 493 @option.Name 494 } 495 else 496 { 497 if (option.Value.StartsWith("/Files/", StringComparison.OrdinalIgnoreCase)) 498 { 499 <img src="/Admin/Public/GetImage.ashx?width=16&height=16&image=@option.Value" title="@option.Name"> 500 } 501 else 502 { 503 <span class="colorbox-sm" style="background-color: @option.Value" title="@option.Name"></span> 504 } 505 } 506 507 if (valueCount != totalValues && valueCount < (totalValues - 1)) 508 { 509 if (isColor) 510 { 511 <text> </text> 512 } 513 else 514 { 515 <text>, </text> 516 } 517 } 518 valueCount++; 519 } 520 } 521 else if (field.Value.GetType().ToString().Equals("System.DateTime") || field.Value.GetType().ToString().Equals("System.Date")) 522 { 523 @DateTime.Parse(field.Value.ToString()).ToShortDateString() 524 } 525 else 526 { 527 if (!string.IsNullOrEmpty(fieldValue)) 528 { 529 if (fieldValue.StartsWith("#", StringComparison.OrdinalIgnoreCase) || fieldValue.StartsWith("/Files/", StringComparison.OrdinalIgnoreCase)) 530 { 531 isColor = true; 532 } 533 } 534 535 if (!isColor) 536 { 537 if (isLink) 538 { 539 string linktTitle = !fieldValue.Contains("aspx") ? fieldValue : Translate("Go to link"); 540 string target = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && fieldValue.Contains("http") ? "target=\"_blank\"" : string.Empty; 541 string rel = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && fieldValue.Contains("http") ? "rel=\"noopener\"" : string.Empty; 542 543 <a href="@field.Value" title="@field.Name" @target @rel>@linktTitle</a> 544 } 545 else if (isBrandName) 546 { 547 <span itemprop="brand" itemtype="https://schema.org/Brand" itemscope> 548 <span itemprop="name">@fieldValue</span> 549 </span> 550 } 551 else 552 { 553 @fieldValue 554 } 555 556 } 557 else 558 { 559 if (fieldValue.StartsWith("/Files/", StringComparison.OrdinalIgnoreCase)) 560 { 561 <img src="/Admin/Public/GetImage.ashx?width=16&height=16&image=@fieldValue"> 562 } 563 else 564 { 565 <span class="colorbox-sm" style="background-color: @fieldValue"></span> 566 } 567 } 568 } 569 } 570

Part Number:

227-30867-04
Shim-pack GIST PFPP is ideal for highly polar basic compounds as it shows strong rentention for this analytes. It exhibits excellent stability in high aqueous eluent and is suitable for LCMS analysis. This column has end-capping, a carbon load of 10%, a pore sizer of 10nm, surface area of 350 m2/g, and a pH range of 2 - 7.5. USP L43.

Part Number:

227-30867-04

Sign in to order

You are not allowed to see prices or add to cart. Please sign in, in order to start your order.

Sign in

Error executing template "Designs/Swift/Paragraph/Swift_ProductFieldDisplayGroups.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 Dynamicweb.Ecommerce.Products.GroupRelation.GetGroupRelationsByChildId(String childId)
   at Dynamicweb.Ecommerce.ProductCategoryFieldService.GetCategoriesFromGroups(List`1 categories, HashSet`1& idsHash, IEnumerable`1 groups, Int32 currentLevel, Int32 minLevel, Nullable`1 maxLevel)
   at Dynamicweb.Ecommerce.ProductCategoryFieldService.GetInheritedCategories(IEnumerable`1 groups, Boolean includeProductProperties)
   at Dynamicweb.Ecommerce.ProductCatalog.ViewEngine.GetFieldDisplayGroupValues(ProductViewModelSettings settings, Product product, String languageID, Lazy`1 productIds)
   at Dynamicweb.Ecommerce.ProductCatalog.ViewEngine.<>c__DisplayClass3_1.<BulkCreateView>b__60()
   at System.Lazy`1.CreateValue()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Lazy`1.get_Value()
   at Dynamicweb.Ecommerce.ProductCatalog.ViewEngine.CreateProductFieldGroupsView(ProductViewModel model, IEnumerable`1 groupSystemNames, Boolean hideZeroValues)
   at Dynamicweb.Ecommerce.ProductCatalog.ProductViewModelExtensions.GetProductDisplayGroupFieldsByGroupSystemNames(ProductViewModel productModel, IEnumerable`1 groupSystemNames, Boolean hideZeroValues)
   at CompiledRazorTemplates.Dynamic.RazorEngine_b3cdf75a924a45ed878c4d0c9ee9695e.GetDisplayGroups(ProductViewModel product) in F:\Domains\Sites\dev-szu.mydwsite3.com\Files\Templates\Designs\Swift\Paragraph\Swift_ProductFieldDisplayGroups.cshtml:line 23
   at CompiledRazorTemplates.Dynamic.RazorEngine_b3cdf75a924a45ed878c4d0c9ee9695e.Execute() in F:\Domains\Sites\dev-szu.mydwsite3.com\Files\Templates\Designs\Swift\Paragraph\Swift_ProductFieldDisplayGroups.cshtml:line 49
   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 4 @functions { 5 6 ProductViewModel GetProduct() 7 { 8 ProductViewModel product = null; 9 10 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 11 { 12 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"]; 13 } 14 15 return product; 16 } 17 18 List<FieldGroupViewModel> GetDisplayGroups(ProductViewModel product) 19 { 20 21 bool hideFieldsWithZeroValue = Model.Item.GetBoolean("HideFieldsWithZeroValue"); 22 var selectedDisplayGroupSystemName = Model.Item.GetList("DisplayGroups")?.GetRawValue().OfType<string>(); 23 var displayGroups = product.GetProductDisplayGroupFieldsByGroupSystemNames(selectedDisplayGroupSystemName, hideFieldsWithZeroValue); 24 25 return displayGroups.ToList(); 26 } 27 28 public static string FirstCharToUpper(string input) 29 { 30 return input[0].ToString().ToUpper() + input.Substring(1); 31 } 32 } 33 34 @{ 35 ProductViewModel product = GetProduct(); 36 37 if (product is object) 38 { 39 40 string theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? " theme " + Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : ""; 41 string contentPadding = Model.Item.GetRawValueString("ContentPadding", ""); 42 contentPadding = contentPadding == "none" ? string.Empty : contentPadding; 43 contentPadding = contentPadding == "small" ? " p-2 p-md-3" : contentPadding; 44 contentPadding = contentPadding == "large" ? " p-4 p-md-5" : contentPadding; 45 46 string size = "compact"; 47 string gapCss = size == "full" ? " gap-4" : " gap-2"; 48 49 var displayGroups = GetDisplayGroups(product); 50 51 var templateParams = new Dictionary<string, object> 52 { 53 { "Groups", displayGroups }, 54 { "Size", size }, 55 { "HideGroupHeaders", Model.Item.GetBoolean("HideGroupHeaders") }, 56 { "HideTitle", Model.Item.GetBoolean("HideTitle") } 57 }; 58 59 string templateLayout = Model.Item.GetRawValueString("Layout", "list"); 60 string templateLayoutPath = $"Components/Specifications/{FirstCharToUpper(templateLayout)}.cshtml"; 61 62 <div class="h-100@(theme)@(contentPadding) item_@Model.Item.SystemName.ToLower()"> 63 <div class="grid@(gapCss)"> 64 @RenderPartial(templateLayoutPath, Model, templateParams) 65 </div> 66 </div> 67 68 } 69 else 70 { 71 <div class="alert alert-warning m-0">@Translate("Product Specification will be shown here if any")</div> 72 } 73 } 74
By clicking 'Accept All' you consent that we may collect information about you for various purposes, including: Statistics and Marketing