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_8a07fdb883be4ba19fd3f39843ff1ab4.Execute() in E:\Dynamicweb.NET\Solutions\elkarainwear.espresso4.dk\files\Templates\Designs\elkarainwear\eCom\Product\elka-productdetails.cshtml:line 19at 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 ElkaProduct espressoProduct = (ElkaProduct)ProductService.Instance.GetEspressoProduct( 20 new ProductSettings() 21 { 22 Id = GetString( "Ecom:Product.ID" ), 23 VariantId = GetString( "Ecom:Product.VariantID" ), 24 PrimaryVariantId = GetString( "Ecom:Product.DefaultVariantComboID" ), 25 EmbeddedInModelList = false 26 } 27 ); 28 @* 29 ProductImageService imageService = new ProductImageService(); 30 Product p = new ProductService().GetProductById( GetString( "Ecom:Product.ID" ), GetString( "Ecom:Product.VariantID" ), true ); 31 *@ 32 } 33 34 @RenderingService.Instance.SectionEnd() 35 36 <div class="e-product js-e-product" data-has-variants="@espressoProduct.HasVariants.ToString().ToLower()" data-product-id="@espressoProduct.Id" data-variant-id="@espressoProduct.VariantId"> 37 38 @RenderingService.Instance.SectionStart( new SectionSettings 39 { 40 Classes = new ClassList( "e-section pb-2" ) 41 } ) 42 <div class="col-12"> 43 <div class="row"> 44 <div class="col-12 col-sm-5"> 45 <div class="e-product-text-container"> 46 <div class="e-product-text mb-2"> 47 @RenderingService.Instance.PartialView( "ecom/product/partials/part-field-display-group-basic.cshtml", espressoProduct ) 48 </div> 49 <h1 class="e-product-name mb-0 mt-0"> 50 @espressoProduct.Name 51 </h1> 52 <p class="small"> 53 @Translate( "Elka - Product Details - Display Group - Basic - ElkaModelNo - Text", "ART." ) <span class="js-elka-art-number">@espressoProduct.ArtNumber</span> 54 </p> 55 @if ( isUserAuthenticated ) 56 { 57 <p class="e-product-price h2 mb-1 mt-0"> 58 <span>@Translate( "Elka - Product - Price - Netto - Text", "Netto" ) </span> 59 @espressoProduct.Price.Format() 60 </p> 61 } 62 @RenderingService.Instance.PartialView( "ecom/product/partials/add-to-cart.cshtml", espressoProduct ) 63 </div> 64 </div> 65 <div class="col-12 col-sm-7 order-first"> 66 @RenderingService.Instance.PartialView( "ecom/product/partials/images.cshtml", espressoProduct ) 67 </div> 68 </div> 69 </div> 70 71 @RenderingService.Instance.SectionEnd() 72 73 @if ( !string.IsNullOrEmpty( espressoProduct.DescriptionLong ) ) 74 { 75 @RenderingService.Instance.SectionStart( new SectionSettings 76 { 77 Classes = new ClassList( "e-section bg-light elka-custom-productdetails-specs pt-2 pb-2" ), 78 ContentClasses = new ClassList( "col-12 col-md-10 col-lg-8 mx-auto is-md" ), 79 Collapsible = false 80 } ) 81 <div class="col-12"> 82 <h2>@Translate("Elka - Product Details - Description - Header", "Description")</h2> 83 @espressoProduct.DescriptionLong 84 </div> 85 @RenderingService.Instance.SectionEnd() 86 } 87 88 @* Video *@ 89 @RenderingService.Instance.PartialView("ecom/product/partials/part-field-display-group-video.cshtml", espressoProduct) 90 @* Specifications *@ 91 @RenderingService.Instance.PartialView("ecom/product/partials/part-field-display-group-spec.cshtml", espressoProduct) 92 @* Certificates *@ 93 @RenderingService.Instance.PartialView("ecom/product/partials/part-field-display-group-cert.cshtml", espressoProduct) 94 <hr/> 95 @* Maintenance *@ 96 @RenderingService.Instance.PartialView("ecom/product/partials/part-field-display-group-maintenance.cshtml", espressoProduct) 97 @* Downloads *@ 98 @RenderingService.Instance.PartialView("ecom/product/partials/part-field-display-group-downloads.cshtml", espressoProduct) 99100 @* Brand *@101 @RenderingService.Instance.PartialView("ecom/product/partials/part-field-display-group-brand.cshtml", espressoProduct)102103 @* Info *@104 @{105 if ( int.TryParse( PageView.Current().Area.Item[ "HistoryPage" ].ToString(), out historyPageID ) )106 {107 @RenderPageContent( historyPageID )108 }109 }110111112 @*113114 @if ( espressoProduct.RelatedGroups.ContainsKey( "RELGRP2" ) && espressoProduct.RelatedGroups[ "RELGRP2" ].Products.Any() )115 {116 @RenderingService.Instance.SectionStart( new SectionSettings117 {118 Classes = new ClassList( "e-section py-2 bg-light" )119 } )120 @RenderingService.Instance.PartialView( "ecom/product/partials/related-products.cshtml", espressoProduct.RelatedGroups[ "RELGRP2" ] )121 @RenderingService.Instance.SectionEnd()122 }123124 @if ( espressoProduct.CustomersWhoBoughtThisItemAlsoBought != null && espressoProduct.CustomersWhoBoughtThisItemAlsoBought.Products.Any() )125 {126 @RenderingService.Instance.SectionStart( new SectionSettings127 {128 Classes = new ClassList( "e-section py-2" )129 } )130 @RenderingService.Instance.PartialView( "ecom/product/partials/related-products.cshtml", espressoProduct.CustomersWhoBoughtThisItemAlsoBought )131 @RenderingService.Instance.SectionEnd()132 }133 @if ( espressoProduct.RelatedGroups.ContainsKey( "RELGRP4" ) && espressoProduct.RelatedGroups[ "RELGRP4" ].Products.Any() )134 {135 @RenderingService.Instance.SectionStart( new SectionSettings136 {137 Classes = new ClassList( "e-section py-2 bg-light" )138 } )139 @RenderingService.Instance.PartialView( "ecom/product/partials/related-products.cshtml", espressoProduct.RelatedGroups[ "RELGRP4" ] )140 @RenderingService.Instance.SectionEnd()141 }142143 @if ( espressoProduct.YouHaveSeenTheseProducts != null && espressoProduct.YouHaveSeenTheseProducts.Products.Any() )144 {145 @RenderingService.Instance.SectionStart( new SectionSettings146 {147 Classes = new ClassList( "e-section py-2" )148 } )149 @RenderingService.Instance.PartialView( "ecom/product/partials/related-products.cshtml", espressoProduct.YouHaveSeenTheseProducts )150 @RenderingService.Instance.SectionEnd()151 }152 *@153 @RenderingService.Instance.SectionEnd()154 @RenderingService.Instance.PartialView("ecom/product/partials/part-product-matrix.cshtml", espressoProduct)155 @RenderingService.Instance.PartialView("ecom/product/partials/part-product-matrix-cart.cshtml", espressoProduct)156 @RenderingService.Instance.PartialView( "ecom/product/partials/metadata.cshtml", espressoProduct )157 @RenderingService.Instance.PartialView( "ecom/product/partials/gtm-tracking.cshtml", espressoProduct )158159 <code class="js-e-breadcrumb-item-append" data-link="@HttpUtility.HtmlAttributeEncode( espressoProduct.Link )" data-text="@HttpUtility.HtmlAttributeEncode( espressoProduct.Name )"></code>160161 <script>162 e4.data.set( '@(espressoProduct.Id)_VariantCombinationTree', JSON.parse('@HttpUtility.JavaScriptStringEncode( JsonService.Instance.ToJson( espressoProduct.VariantCombinationTree ) )') );163 e4.data.set( '@(espressoProduct.Id)_VariantCombinationIds', JSON.parse('@HttpUtility.JavaScriptStringEncode( JsonService.Instance.ToJson( espressoProduct.VariantCombinations.Keys ) )') );164 </script>165166 </div>167 @RenderingService.Instance.SectionStart( new SectionSettings() )168
keyboard_arrow_up