Error executing template "Designs/elkarainwear/eCom/Product/elka-productdetails.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:\Projects\espresso\Co3.Espresso.Website\Models\FrontEnd\Ecommerce\EspressoProduct.cs:line 655at Co3.Espresso.Website.Services.ProductService.GetEspressoProduct(ProductSettings settings) in C:\Projects\espresso\Co3.Espresso.Website\Services\ProductService.cs:line 159at CompiledRazorTemplates.Dynamic.RazorEngine_440a5d1c181f4d718102f98adb647130.Execute() in E:\Dynamicweb.NET\Solutions\elkarainwear.espresso4.dk\files\Templates\Designs\elkarainwear\eCom\Product\elka-productdetails.cshtml:line 21at 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 2 @using System.Web 3 @using Co3.Elka.Dw.Models.Frontend.Ecommerce 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.Handlebars 10 @using Dynamicweb.Ecommerce.Products 11 @using Dynamicweb.Frontend 12 @using Dynamicweb.Security.UserManagement 13 @using ProductService = Co3.Espresso.Website.Services.ProductService 14 15 @{ 16 bool isUserAuthenticated = User.IsExtranetUserLoggedIn(); 17 int historyPageID = 0; 18 19 Product dwMainProduct = new ProductService().GetProductById( GetString( "Ecom:Product.ID" ), string.Empty, false ); 20 21 ElkaProduct espressoProduct = (ElkaProduct)ProductService.Instance.GetEspressoProduct( 22 new ProductSettings() 23 { 24 Id = GetString( "Ecom:Product.ID" ), 25 VariantId = GetString( "Ecom:Product.VariantID" ), 26 PrimaryVariantId = GetString( "Ecom:Product.DefaultVariantComboID" ), 27 EmbeddedInModelList = false 28 } 29 ); 30 @* 31 ProductImageService imageService = new ProductImageService(); 32 Product p = new ProductService().GetProductById( GetString( "Ecom:Product.ID" ), GetString( "Ecom:Product.VariantID" ), true ); 33 *@ 34 } 35 36 @RenderingService.Instance.SectionEnd() 37 38 <div class="e-product js-e-product" data-has-variants="@espressoProduct.HasVariants.ToString().ToLower()" data-product-id="@espressoProduct.Id" data-variant-id="@espressoProduct.VariantId"> 39 40 @RenderingService.Instance.SectionStart( new SectionSettings 41 { 42 Classes = new ClassList( "e-section pb-2" ) 43 } ) 44 <div class="col-12"> 45 <div class="row"> 46 <div class="col-12 col-sm-5"> 47 <div class="e-product-text-container"> 48 <div class="e-product-text mb-2"> 49 @RenderingService.Instance.PartialView( "ecom/product/partials/part-field-display-group-basic.cshtml", espressoProduct ) 50 </div> 51 52 <h1 class="e-product-name mb-0 mt-0"> 53 @espressoProduct.Name 54 </h1> 55 <p class="small"> 56 @Translate( "Elka - Product Details - Display Group - Basic - ElkaModelNo - Text", "ART." ) <span class="js-elka-art-number">@espressoProduct.ArtNumber</span> 57 </p> 58 <div class="e-product-text mb-2"> 59 @RenderingService.Instance.PartialView( "ecom/product/partials/part-field-display-group-symbols.cshtml", espressoProduct ) 60 </div> 61 62 @if ( isUserAuthenticated ) 63 { 64 <p class="e-product-price h2 mb-1 mt-0"> 65 <span>@Translate( "Elka - Product - Price - Netto - Text", "Netto" ) </span> 66 <span class="js-e-product-price-formatted">@espressoProduct.Price.Format()</span> 67 </p> 68 } 69 @RenderingService.Instance.PartialView( "ecom/product/partials/add-to-cart.cshtml", espressoProduct ) 70 71 </div> 72 </div> 73 <div class="col-12 col-sm-7 order-first"> 74 @RenderingService.Instance.PartialView( "ecom/product/partials/images.cshtml", espressoProduct ) 75 </div> 76 </div> 77 </div> 78 79 @RenderingService.Instance.SectionEnd() 80 81 @if ( !string.IsNullOrEmpty( dwMainProduct.LongDescription ) ) 82 { 83 @RenderingService.Instance.SectionStart( new SectionSettings 84 { 85 Classes = new ClassList( "e-section bg-light elka-custom-productdetails-specs pt-2 pb-2" ), 86 ContentClasses = new ClassList( "col-12 col-md-10 col-lg-8 mx-auto is-md" ), 87 Collapsible = false 88 } ) 89 <div class="col-12"> 90 <h2>@Translate("Elka - Product Details - Description - Header", "Description")</h2> 91 @dwMainProduct.LongDescription 92 </div> 93 @RenderingService.Instance.SectionEnd() 94 } 95 96 97 98 99 @* Video *@100 @RenderingService.Instance.PartialView("ecom/product/partials/part-field-display-group-video.cshtml", espressoProduct)101 @* Specifications *@102 @RenderingService.Instance.PartialView("ecom/product/partials/part-field-display-group-spec.cshtml", espressoProduct)103 @* Certificates *@104 @RenderingService.Instance.PartialView("ecom/product/partials/part-field-display-group-cert.cshtml", espressoProduct)105 <hr/>106 @* Maintenance *@107 @RenderingService.Instance.PartialView("ecom/product/partials/part-field-display-group-maintenance.cshtml", espressoProduct)108 @* Downloads *@109 @RenderingService.Instance.PartialView("ecom/product/partials/part-field-display-group-downloads.cshtml", espressoProduct)110111 @* Brand *@112 @RenderingService.Instance.PartialView("ecom/product/partials/part-field-display-group-brand.cshtml", espressoProduct)113114 @* Info *@115 @{116 if ( int.TryParse( PageView.Current().Area.Item[ "HistoryPage" ].ToString(), out historyPageID ) )117 {118 @RenderPageContent( historyPageID )119 }120 }121122123 @*124125 @if ( espressoProduct.RelatedGroups.ContainsKey( "RELGRP2" ) && espressoProduct.RelatedGroups[ "RELGRP2" ].Products.Any() )126 {127 @RenderingService.Instance.SectionStart( new SectionSettings128 {129 Classes = new ClassList( "e-section py-2 bg-light" )130 } )131 @RenderingService.Instance.PartialView( "ecom/product/partials/related-products.cshtml", espressoProduct.RelatedGroups[ "RELGRP2" ] )132 @RenderingService.Instance.SectionEnd()133 }134135 @if ( espressoProduct.CustomersWhoBoughtThisItemAlsoBought != null && espressoProduct.CustomersWhoBoughtThisItemAlsoBought.Products.Any() )136 {137 @RenderingService.Instance.SectionStart( new SectionSettings138 {139 Classes = new ClassList( "e-section py-2" )140 } )141 @RenderingService.Instance.PartialView( "ecom/product/partials/related-products.cshtml", espressoProduct.CustomersWhoBoughtThisItemAlsoBought )142 @RenderingService.Instance.SectionEnd()143 }144 @if ( espressoProduct.RelatedGroups.ContainsKey( "RELGRP4" ) && espressoProduct.RelatedGroups[ "RELGRP4" ].Products.Any() )145 {146 @RenderingService.Instance.SectionStart( new SectionSettings147 {148 Classes = new ClassList( "e-section py-2 bg-light" )149 } )150 @RenderingService.Instance.PartialView( "ecom/product/partials/related-products.cshtml", espressoProduct.RelatedGroups[ "RELGRP4" ] )151 @RenderingService.Instance.SectionEnd()152 }153154 @if ( espressoProduct.YouHaveSeenTheseProducts != null && espressoProduct.YouHaveSeenTheseProducts.Products.Any() )155 {156 @RenderingService.Instance.SectionStart( new SectionSettings157 {158 Classes = new ClassList( "e-section py-2" )159 } )160 @RenderingService.Instance.PartialView( "ecom/product/partials/related-products.cshtml", espressoProduct.YouHaveSeenTheseProducts )161 @RenderingService.Instance.SectionEnd()162 }163 *@164 @RenderingService.Instance.SectionEnd()165 @RenderingService.Instance.PartialView("ecom/product/partials/part-product-matrix.cshtml", espressoProduct)166 @RenderingService.Instance.PartialView("ecom/product/partials/part-product-matrix-cart.cshtml", espressoProduct)167 @RenderingService.Instance.PartialView( "ecom/product/partials/metadata.cshtml", espressoProduct )168 @RenderingService.Instance.PartialView( "ecom/product/partials/gtm-tracking.cshtml", espressoProduct )169170 <code class="js-e-breadcrumb-item-append" data-link="@HttpUtility.HtmlAttributeEncode( espressoProduct.Link )" data-text="@HttpUtility.HtmlAttributeEncode( espressoProduct.Name )"></code>171172 <script>173 e4.data.set( '@(espressoProduct.Id)_VariantCombinationTree', JSON.parse('@HttpUtility.JavaScriptStringEncode( JsonService.Instance.ToJson( espressoProduct.VariantCombinationTree ) )') );174 e4.data.set( '@(espressoProduct.Id)_VariantCombinationIds', JSON.parse('@HttpUtility.JavaScriptStringEncode( JsonService.Instance.ToJson( espressoProduct.VariantCombinations.Keys ) )') );175 </script>176177 </div>178 @RenderingService.Instance.SectionStart( new SectionSettings() )179
keyboard_arrow_up