Error executing template "Designs/lilly/eCom/Product/espresso.cshtml"System.Exception: Product is not embedded in a list and does not have a variant id or a primary variant idat Co3.Espresso.Website.Models.FrontEnd.Ecommerce.EspressoProduct.Populate(ProductSettings settings) in C:\git\Espresso\Co3.Espresso.Website\Models\FrontEnd\Ecommerce\EspressoProduct.cs:line 635at Co3.Espresso.Website.Services.ProductService.GetEspressoProduct(ProductSettings settings) in C:\git\Espresso\Co3.Espresso.Website\Services\ProductService.cs:line 159at CompiledRazorTemplates.Dynamic.RazorEngine_ee5e33fb263d44e58b358a87e30631ca.Execute() in E:\dynamicweb.net\SolutionsCustom\lilly.espresso4.dk\files\Templates\Designs\lilly\eCom\Product\espresso.cshtml:line 20at 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.b__0(TextWriter writer)at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @inherits Co3.Espresso.Website.TemplateBases.Paragraphs.Module@using System.Web@using Co3.Espresso.Base.Extensions@using Co3.Espresso.Website.Services@using Co3.Espresso.Website.Models.FrontEnd@using Co3.Espresso.Website.Models.FrontEnd.Settings@using Co3.Espresso.Website.Models.FrontEnd.Ecommerce@using Co3.Espresso.Website.Models.FrontEnd.Handlebars@using Co3.Lilly.Website.Models.Frontend.Ecommerce@using Co3.Lilly.Website.Services@using Dynamicweb.Core@using Dynamicweb.Ecommerce.Common@using Dynamicweb.Ecommerce.Products@using Dynamicweb.Security.UserManagement@using Group = Dynamicweb.Security.UserManagement.Group@using ProductService = Co3.Espresso.Website.Services.ProductService@{bool isUserAuthenticated = User.IsExtranetUserLoggedIn();LillyProduct espressoProduct = (LillyProduct) ProductService.Instance.GetEspressoProduct(new ProductSettings(){Id = GetString( "Ecom:Product.ID" ),VariantId = GetString( "Ecom:Product.VariantID" ),PrimaryVariantId = GetString( "Ecom:Product.DefaultVariantComboID" )});string jsDataPropertyPath = espressoProduct.Id;/*espressoProduct.RelatedGroups.Add( espressoProduct.LillyProductsInThisGroup.Id, espressoProduct.LillyProductsInThisGroup );*/espressoProduct.RelatedGroups.Add( espressoProduct.WhatAboutTheseProducts.Id, espressoProduct.WhatAboutTheseProducts );espressoProduct.RelatedGroups.Add( espressoProduct.CustomersWhoSawThisAlsoSaw.Id, espressoProduct.CustomersWhoSawThisAlsoSaw );espressoProduct.RelatedGroups.Add( espressoProduct.CustomersWhoBoughtThisItemAlsoBought.Id, espressoProduct.CustomersWhoBoughtThisItemAlsoBought );espressoProduct.RelatedGroups.Add( espressoProduct.YouHaveSeenTheseProducts.Id, espressoProduct.YouHaveSeenTheseProducts );}@RenderingService.Instance.SectionEnd()<div class="e-product js-e-product" data-product-id="@espressoProduct.Id" data-has-variants="@espressoProduct.HasVariants.ToString().ToLower()" data-variant-id="@espressoProduct.VariantId">@RenderingService.Instance.SectionStart( new SectionSettings{Classes = new ClassList( "e-section lilly-product-section" )} )<div class="col-12"><div class="row"><div class="col-12 col-sm-6 p-2 p-lg-6 mt-6 mt-sm-3"><div class="e-product-text-container py-lg-2"><h4 class="mb-1">@Translate( "eCom Product - Product Number - Text", "Number" ) @espressoProduct.Number</h4><h1 class="e-product-name mt-0 mb-1 h2">@espressoProduct.Name <span class="@LillyProductService.Instance.HidePrices()">@espressoProduct.Price.Format()</span></h1>@if ( @espressoProduct.BeforePrice.Value > 0 && espressoProduct.BeforePrice.Value > espressoProduct.Price.Value ){<span class="@LillyProductService.Instance.HidePrices() text-muted" style="text-decoration: line-through;">@espressoProduct.BeforePrice.Format()</span>}<p></p><div class="e-product-text mb-2 p-0 col-12 col-lg-9">@espressoProduct.DescriptionLong</div><hr class="mt-3 mb-0" /><div class="@LillyProductService.Instance.HideBuyButton()"><div class="d-flex">@RenderingService.Instance.PartialView( "ecom/product/partials/add-to-cart.cshtml", espressoProduct )</div></div>@if ( isUserAuthenticated ){if ( espressoProduct.IsPreorder == true ){<div class="mb-2 js-lilly-preorder-info d-none"><span class="d-flex h4 small w-100">@Translate( "Preorder", "Preorder" ) <i class="font-weight-bold material-icons material-icons-fixed" style="font-size: 1.25em;">done</i></span><span class="d-flex small w-100">@Translate( "Preorder delivery text", "2-3 weeks delivery" )</span>@if ( espressoProduct.PreorderDeliveryDate > DateTime.MinValue ){if ( espressoProduct.PreorderDeliveryDate > DateTime.Today ){<span class="d-flex small w-100">@Translate( "Expected delivery date", "Expected delivery date" ): @espressoProduct.PreorderDeliveryDateFormatted</span>}}</div>}}@RenderingService.Instance.PartialView( "ecom/product/partials/add-to-favorites.cshtml", espressoProduct )@* } *@</div><a class="hidden-sm-down js-p-banner-next-section-link p-banner-next-section-link text-primary" style="left: 1.85em;" href=""><i class="material-icons p-banner-next-section-link-icon">keyboard_arrow_down</i></a></div><div class="col-12 col-sm-6 order-first">@RenderingService.Instance.PartialView( "ecom/product/partials/images.cshtml", espressoProduct )</div></div></div>@RenderingService.Instance.SectionEnd()@RenderingService.Instance.SectionStart( new SectionSettings{Classes = new ClassList( "col-12 pt-5" ),ContentClasses = new ClassList( "col-12" ),Collapsible = false} )<p><a href="/book-en-tid" class="arrow-right text-secondary h2">@Translate( "Book en tid i din LILLY butik","Book en tid i din LILLY butik" )</a></p>@RenderingService.Instance.SectionEnd()@foreach ( KeyValuePair<string, EspressoProductList> relatedGroup in espressoProduct.RelatedGroups ){if ( relatedGroup.Value.Products.Any() ){HandlebarsProductListItemTemplate handlebarsProductListItemTemplate = HandlebarsService.Instance.GetProductListItemTemplate( new HandlebarsProductListItemTemplateSettings() );string handlebarsTemplateName = string.Format( "{0}-{1}", espressoProduct.Id, "related-group" ).ToLower();string jsonSrc = string.Format( "{0}.{1}", jsDataPropertyPath, "relatedGroups" );@RenderingService.Instance.SectionStart( new SectionSettings{Classes = new ClassList( "e-section py-2" )} )<div class="col-12"><div class="e-productlist js-e-jsonpublisher" data-json-src="@jsonSrc" data-json-src-prop="@relatedGroup.Key" data-json-template-prop="" data-json-item-count="3" data-template-helpers="compare" data-json-item-count-prop="products" data-template=".js-e-handlebars-tmpl-@handlebarsTemplateName"><script class="js-e-handlebars-tmpl-@handlebarsTemplateName" type="text/x-handlebars-template"><div class="e-productlist-header"><p class="h2 text-center">{{name}}</p></div><div class="e-productlist-main"><div class="row"><div class="col-12"><div class="e-productlist">{{#if products}}<div class="row justify-content-center">{{#each products}}@RenderingService.Instance.PartialView( "ecom/productlist/partials/item.cshtml", handlebarsProductListItemTemplate ){{/each}}</div>{{/if}}</div></div></div></div></script></div></div>@RenderingService.Instance.SectionEnd()}}@RenderingService.Instance.PartialView( "ecom/product/partials/metadata.cshtml", espressoProduct )@RenderingService.Instance.PartialView( "ecom/product/partials/gtm-tracking.cshtml", espressoProduct )<code class="js-e-breadcrumb-item-append" data-text="@HttpUtility.HtmlAttributeEncode( espressoProduct.Name )" data-link="@HttpUtility.HtmlAttributeEncode( espressoProduct.Link )"></code><script>e4.data.set( '@jsDataPropertyPath', JSON.parse('@HttpUtility.JavaScriptStringEncode( JsonService.Instance.ToJson( espressoProduct ) )') )</script></div>@RenderingService.Instance.SectionStart( new SectionSettings() )
keyboard_arrow_up