Error executing template "Designs/lilly/eCom/Product/espresso_AK.cshtml" System.Exception: _dynamicwebProduct has variants and is not embedded in a list and VariantId or PrimaryVariantId is null/empty. Settings are: {"Product":null,"Id":"PROD3112","LanguageId":null,"VariantId":"","PrimaryVariantId":"","EmbeddedInModelList":false} at Co3.Espresso.Website.Models.FrontEnd.Ecommerce.EspressoProduct.Populate(ProductSettings settings) at Co3.Espresso.Website.Services.ProductService.GetEspressoProduct(ProductSettings settings) at CompiledRazorTemplates.Dynamic.RazorEngine_5a8b9bbac300460d945832eff7c383fa.Execute() in E:\dynamicweb.net\SolutionsCustom\lilly.ci.espresso4.dk\Files\Templates\Designs\lilly\eCom\Product\espresso_AK.cshtml:line 20 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.Services 5 @using Co3.Espresso.Website.Models.FrontEnd 6 @using Co3.Espresso.Website.Models.FrontEnd.Settings 7 @using Co3.Espresso.Website.Models.FrontEnd.Ecommerce 8 @using Co3.Espresso.Website.Models.FrontEnd.Handlebars 9 @using Co3.Lilly.Website.Models.Frontend.Ecommerce 10 @using Co3.Lilly.Website.Services 11 @using Dynamicweb.Core 12 @using Dynamicweb.Ecommerce.Common 13 @using Dynamicweb.Ecommerce.Products 14 @using Dynamicweb.Security.UserManagement 15 @using Group = Dynamicweb.Security.UserManagement.Group 16 @using ProductService = Co3.Espresso.Website.Services.ProductService 17 18 @{ 19 bool isUserAuthenticated = User.IsExtranetUserLoggedIn(); 20 LillyProduct espressoProduct = (LillyProduct) ProductService.Instance.GetEspressoProduct( 21 new ProductSettings() 22 { 23 Id = GetString( "Ecom:Product.ID" ), 24 VariantId = GetString( "Ecom:Product.VariantID" ), 25 PrimaryVariantId = GetString( "Ecom:Product.DefaultVariantComboID" ) 26 } 27 ); 28 string jsDataPropertyPath = espressoProduct.Id; 29 30 /*espressoProduct.RelatedGroups.Add( espressoProduct.LillyProductsInThisGroup.Id, espressoProduct.LillyProductsInThisGroup );*/ 31 espressoProduct.RelatedGroups.Add( espressoProduct.WhatAboutTheseProducts.Id, espressoProduct.WhatAboutTheseProducts ); 32 espressoProduct.RelatedGroups.Add( espressoProduct.CustomersWhoSawThisAlsoSaw.Id, espressoProduct.CustomersWhoSawThisAlsoSaw ); 33 espressoProduct.RelatedGroups.Add( espressoProduct.CustomersWhoBoughtThisItemAlsoBought.Id, espressoProduct.CustomersWhoBoughtThisItemAlsoBought ); 34 espressoProduct.RelatedGroups.Add( espressoProduct.YouHaveSeenTheseProducts.Id, espressoProduct.YouHaveSeenTheseProducts ); 35 } 36 37 @RenderingService.Instance.SectionEnd() 38 39 40 41 <div class="e-product js-e-product" data-product-id="@espressoProduct.Id" data-has-variants="@espressoProduct.HasVariants.ToString().ToLower()" data-variant-id="@espressoProduct.VariantId"> 42 43 @RenderingService.Instance.SectionStart( new SectionSettings 44 { 45 Classes = new ClassList( "e-section lilly-product-section" ) 46 } ) 47 <div class="col-12"> 48 <div class="row"> 49 <div class="col-12 col-sm-6 p-2 p-lg-6 mt-6 mt-sm-3"> 50 <div class="e-product-text-container py-lg-2"> 51 <h4 class="mb-1"> 52 @Translate( "eCom Product - Product Number - Text", "Number" ) @espressoProduct.Number 53 </h4> 54 <h1 class="e-product-name mt-0 mb-1 h2"> 55 @espressoProduct.Name <span class="@LillyProductService.Instance.HidePrices()">@espressoProduct.Price.Format()</span> 56 </h1> 57 @if ( espressoProduct.ShowBeforePrice && @espressoProduct.BeforePrice.Value > 0 && espressoProduct.BeforePrice.Value > espressoProduct.Price.Value ) 58 { 59 <span class="@LillyProductService.Instance.HidePrices() text-muted" style="text-decoration: line-through;"> 60 @espressoProduct.BeforePrice.Format() 61 </span> 62 } 63 64 <p></p> 65 66 <div class="e-product-text mb-2 p-0 col-12 col-lg-9"> 67 @espressoProduct.DescriptionLong 68 </div> 69 70 <hr class="mt-3 mb-0" /> 71 72 <div class="@LillyProductService.Instance.HideBuyButton()"> 73 <div class="d-flex"> 74 @RenderingService.Instance.PartialView( "ecom/product/partials/add-to-cart.cshtml", espressoProduct ) 75 </div> 76 </div> 77 78 @if ( isUserAuthenticated ) 79 { 80 81 if ( espressoProduct.IsPreorder == true ) 82 { 83 84 <div class="mb-2 js-lilly-preorder-info d-none"> 85 86 <span class="d-flex h4 small w-100"> 87 @Translate( "Preorder", "Preorder" ) <i class="font-weight-bold material-icons material-icons-fixed" style="font-size: 1.25em;">done</i> 88 </span> 89 90 <span class="d-flex small w-100"> 91 @Translate( "Preorder delivery text", "2-3 weeks delivery" ) 92 </span> 93 94 @if ( espressoProduct.PreorderDeliveryDate > DateTime.MinValue ) 95 { 96 if ( espressoProduct.PreorderDeliveryDate > DateTime.Today ) 97 { 98 <span class="d-flex small w-100">@Translate( "Expected delivery date", "Expected delivery date" ): @espressoProduct.PreorderDeliveryDateFormatted</span> 99 } 100 } 101102 </div> 103 } 104 } 105106 @RenderingService.Instance.PartialView( "ecom/product/partials/add-to-favorites.cshtml", espressoProduct ) 107 @* } *@ 108 </div> 109 <a class="hidden-sm-down js-p-banner-next-section-link p-banner-next-section-link text-primary" style="left: 1.85em;" href=""> 110 <i class="material-icons p-banner-next-section-link-icon">keyboard_arrow_down</i> 111 </a> 112 </div> 113114 <div class="col-12 col-sm-6 order-first"> 115 @RenderingService.Instance.PartialView( "ecom/product/partials/images.cshtml", espressoProduct ) 116 </div> 117 </div> 118 </div> 119 @RenderingService.Instance.SectionEnd() 120121122 @if ( LillyProductService.Instance.IsB2B != true ) 123 { 124 @RenderingService.Instance.SectionStart( new SectionSettings 125 { 126 Classes = new ClassList( "col-12 pt-5" ), 127 ContentClasses = new ClassList( "col-12" ), 128 Collapsible = false 129 } ) 130131 @RenderingService.Instance.SectionEnd() 132 } 133134 @foreach ( KeyValuePair<string, EspressoProductList> relatedGroup in espressoProduct.RelatedGroups ) 135 { 136 if ( relatedGroup.Value.Products.Any() ) 137 { 138139 HandlebarsProductListItemTemplate handlebarsProductListItemTemplate = HandlebarsService.Instance.GetProductListItemTemplate( new HandlebarsProductListItemTemplateSettings() ); 140 string handlebarsTemplateName = string.Format( "{0}-{1}", espressoProduct.Id, "related-group" ).ToLower(); 141 string jsonSrc = string.Format( "{0}.{1}", jsDataPropertyPath, "relatedGroups" ); 142143 @RenderingService.Instance.SectionStart( new SectionSettings 144 { 145 Classes = new ClassList( "e-section py-2" ) 146 } ) 147 <div class="col-12"> 148 <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"> 149 <script class="js-e-handlebars-tmpl-@handlebarsTemplateName" type="text/x-handlebars-template"> 150 <div class="e-productlist-header"> 151 <p class="h2 text-center">{{name}}</p> 152 </div> 153 <div class="e-productlist-main"> 154 <div class="row"> 155 <div class="col-12"> 156 <div class="e-productlist"> 157 {{#if products}} 158 <div class="row justify-content-center"> 159 {{#each products}} 160 @RenderingService.Instance.PartialView( "ecom/productlist/partials/item.cshtml", handlebarsProductListItemTemplate ) 161 {{/each}} 162 </div> 163 {{/if}} 164 </div> 165 </div> 166 </div> 167 </div> 168 </script> 169170 </div> 171 </div> 172 @RenderingService.Instance.SectionEnd() 173 } 174 } 175176177 @RenderingService.Instance.PartialView( "ecom/product/partials/metadata.cshtml", espressoProduct ) 178 @RenderingService.Instance.PartialView( "ecom/product/partials/gtm-tracking.cshtml", espressoProduct ) 179180 <code class="js-e-breadcrumb-item-append" data-text="@HttpUtility.HtmlAttributeEncode( espressoProduct.Name )" data-link="@HttpUtility.HtmlAttributeEncode( espressoProduct.Link )"></code> 181182 <script> 183 e4.data.set( '@jsDataPropertyPath', JSON.parse('@HttpUtility.JavaScriptStringEncode( JsonService.Instance.ToJson( espressoProduct ) )') ) 184185 @*e4.data.set( '@jsDataPropertyPath', JSON.parse('@HttpUtility.JavaScriptStringEncode( JsonService.Instance.ToJson( new 186 { 187 beforePrice = espressoProduct.BeforePrice, 188 IsPreorder = espressoProduct.IsPreorder, 189 PreorderDeliveryDate = espressoProduct.PreorderDeliveryDate, 190 PreorderDeliveryDateFormatted = espressoProduct.PreorderDeliveryDateFormatted, 191 QuickorderProductNumber = espressoProduct.QuickorderProductNumber, 192 ShowBeforePrice = espressoProduct.ShowBeforePrice, 193 //customersWhoBoughtThisItemAlsoBought = espressoProduct.CustomersWhoBoughtThisItemAlsoBought, 194 customersWhoSawThisAlsoSaw = espressoProduct.CustomersWhoSawThisAlsoSaw, 195 descriptionLong = espressoProduct.DescriptionLong, 196 descriptionOneLine = espressoProduct.DescriptionOneLine, 197 descriptionShort = espressoProduct.DescriptionShort, 198 hasVariants = espressoProduct.HasVariants, 199 id = espressoProduct.Id, 200 imageCarouselVideoCount = espressoProduct.ImageCarouselVideoCount, 201 imageDetails = espressoProduct.ImageDetails, 202 imagePrimary = espressoProduct.ImagePrimary, 203 isVariant = espressoProduct.IsVariant, 204 isVariantMaster = espressoProduct.IsVariantMaster, 205 lillyProductsInThisGroup = espressoProduct.LillyProductsInThisGroup, 206 link = espressoProduct.Link, 207 name = espressoProduct.Name, 208 number = espressoProduct.Number, 209 price = espressoProduct.Price, 210 //relatedGroups = espressoProduct.RelatedGroups, 211 stock = espressoProduct.Stock, 212 variantCombinationTree = espressoProduct.VariantCombinationTree, 213 variantCombinations = espressoProduct.VariantCombinations, 214 variantGroups = espressoProduct.VariantGroups, 215 variantId = espressoProduct.VariantId, 216 variantSelectedOption = espressoProduct.VariantSelectedOption, 217 vimeoVideoPlayerEmbedUrl = espressoProduct.VimeoVideoPlayerEmbedUrl, 218 whatAboutTheseProducts = espressoProduct.WhatAboutTheseProducts, 219 youHaveSeenTheseProducts = espressoProduct.YouHaveSeenTheseProducts 220 }) )') )*@ 221 </script> 222223224 </div> 225 @RenderingService.Instance.SectionStart( new SectionSettings() ) 226