Error executing template "Designs/identity_v2/eCom/Product/espresso.cshtml" Newtonsoft.Json.JsonSerializationException: Error getting value from 'PriceWithoutVat' on 'Co3.ID.Dw.Models.Frontend.Ecommerce.IdentityProduct'. ---> System.Data.SqlClient.SqlException: Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception: The wait operation timed out --- End of inner exception stack trace --- at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at Co3.ID.Dw.DAL.Repositories.ProductRepository.GetPrices(String priceGroup, String currency, Dictionary`2 prices, Product[] products) at Co3.ID.Dw.DAL.Repositories.ProductRepository.GetB2CPrices(Product[] products, String currency, String priceGroup, String command) at Co3.ID.Dw.Providers.PriceProvider.FindPrice(Product product, Double quantity, String variantID, Currency currency, String unitID, User user) at Co3.Espresso.Dw.PriceProviders.EspressoDefaultPriceProvider.FindPrice(Product product, Double quantity, String variantId, Currency currency, String unitId, User user) in C:\Data\Development\git\espresso4dw9-solution\Co3.Espresso.Dynamicweb\PriceProviders\PriceProvider.cs:line 155 at Dynamicweb.Ecommerce.Prices.PriceProvider.FindPrice(PriceContext context, PriceProductSelection selection) at Dynamicweb.Ecommerce.Prices.PriceManager.FindPriceInternal(PriceProvider provider, PriceContext context, PriceProductSelection selection, Boolean isInformative) at Dynamicweb.Ecommerce.Prices.PriceManager.FindPrice(PriceContext context, PriceProductSelection selection, Boolean isInformative) at Dynamicweb.Ecommerce.Prices.PriceManager.GetPrice(PriceContext context, Product product, String unitId, Int64 stockLocationId) at Dynamicweb.Ecommerce.Prices.PriceManager.GetPrice(Product product, String currencyCode, String countryCode, String unitId, Int32 userId, String shopId, StockLocation stockLocation) at Co3.ID.Dw.Models.Frontend.Ecommerce.IdentityProduct.GetPriceWithoutVat() at GetPriceWithoutVat(Object ) at Newtonsoft.Json.Serialization.DynamicValueProvider.GetValue(Object target) --- End of inner exception stack trace --- at Newtonsoft.Json.Serialization.DynamicValueProvider.GetValue(Object target) at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CalculatePropertyValues(JsonWriter writer, Object value, JsonContainerContract contract, JsonProperty member, JsonProperty property, JsonContract& memberContract, Object& memberValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty) at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType) at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType) at Newtonsoft.Json.JsonConvert.SerializeObjectInternal(Object value, Type type, JsonSerializer jsonSerializer) at Newtonsoft.Json.JsonConvert.SerializeObject(Object value, JsonSerializerSettings settings) at CompiledRazorTemplates.Dynamic.RazorEngine_3db37e3a686041319d27bdcda62f9493.Execute() in D:\dynamicweb.net\Solutions\id.espresso4.dk-e5\Application\Files\Templates\Designs\identity_v2\eCom\Product\espresso.cshtml:line 37 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.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.Elements 10 @using Co3.Espresso.Website.Models.FrontEnd.Handlebars 11 @using Co3.ID.Dw.Helpers 12 @using Co3.ID.Dw.Models.Frontend.Ecommerce 13 @using Co3.ID.Dw.Models.Frontend.Users 14 @using Dynamicweb.Content.Items 15 @using Dynamicweb.Ecommerce.Products 16 @using Dynamicweb.Ecommerce.Products.Categories 17 @using Dynamicweb.Frontend 18 @using Dynamicweb.Security.UserManagement 19 @using ProductService = Co3.Espresso.Website.Services.ProductService 20 21 @{ 22 ShopType shopContext = SiteContext.CurrentSiteContext(); 23 User currentUser = PageView.Current().User; 24 bool isCustomerShop = (PageView.Current().Area.Item["IsCustomerShop"] != null && (bool)PageView.Current().Area.Item["IsCustomerShop"] == true); 25 string discountGroup = currentUser != null ? currentUser.GetCustomFieldValue< string >( "DiscountGroup" ) : string.Empty; 26 bool showPrices = !isCustomerShop || (isCustomerShop && UserContext.Current.CustomerShop.Settings.ShowPrices == true); 27 28 IdentityProduct espressoProduct = (IdentityProduct) ProductService.Instance.GetEspressoProduct( 29 new ProductSettings() 30 { 31 Id = GetString("Ecom:Product.ID"), 32 VariantId = GetString("Ecom:Product.VariantID"), 33 PrimaryVariantId = GetString("Ecom:Product.DefaultVariantComboID") 34 } 35 ); 36 37 <script>console.log("%cespressoProduct", "color:white;background:rebeccapurple;padding:5px;", @Newtonsoft.Json.JsonConvert.SerializeObject(espressoProduct, new Newtonsoft.Json.JsonSerializerSettings {ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore, PreserveReferencesHandling = Newtonsoft.Json.PreserveReferencesHandling.Objects}));</script> 38 39 // Add auto generated relation groups fra Dynamicweb to RelatedGroups dictionary, in order to access them the same way, as the custom related product groups. 40 espressoProduct.RelatedGroups.Add(espressoProduct.YouHaveSeenTheseProducts.Id, espressoProduct.YouHaveSeenTheseProducts); 41 42 43 // Related product groups are rendered in this order. 44 string[] relatedGroupIds = 45 { 46 "RELGRP6", 47 "YouHaveSeenTheseProducts", 48 }; 49 50 51 } 52 @RenderingService.Instance.SectionEnd() 53 54 <div class="e-product js-e-product" data-has-variants="@espressoProduct.HasVariants.ToString().ToLower()" data-product-id="@espressoProduct.Id" data-variant-id="@espressoProduct.VariantId"> 55 56 @RenderingService.Instance.SectionStart(new SectionSettings 57 { 58 Classes = new ClassList("e-section pb-0") 59 }) 60 <div class="col-12"> 61 <div class="row"> 62 <div class="col-12 col-sm-5"> 63 <div class="e-product-text-container"> 64 <div class="identity-corner-brackets-container identity-corner-brackets-left border-primary @(!isCustomerShop ? "py-1 px-2" : string.Empty ) my-2 bracket-productname"> 65 <div class="identity-corner-brackets-wrapper border-primary"> 66 <h1 class="e-product-name font-weight-bold h2 mb-0 "> 67 @espressoProduct.Name 68 </h1> 69 <p class="lead font-weight-normal mb-0"> 70 @Translate("eCom Product - Product Number - Text", "Number") @espressoProduct.Number 71 </p> 72 </div> 73 </div> 74 @RenderingService.Instance.PartialView("ecom/product/partials/prices.cshtml", espressoProduct) 75 <div class="e-product-text mb-2 d-none d-sm-block"> 76 @{ 77 bool doTruncate = espressoProduct.DescriptionLong.Length > 180; 78 } 79 @RenderingService.Instance.SectionStart(new SectionSettings 80 { 81 Classes = new ClassList("identity-product-text js-identity-product-text p-0 m-0 position-relative"), 82 ContainerClasses = new ClassList("p-0 m-0"), 83 ContentClasses = new ClassList("col-12"), 84 Collapsible = doTruncate, 85 CollapseToggleTextCollapse = " ", 86 CollapseToggleTextExpand = " " 87 }) 88 <div class="col-12"> 89 @{ 90 string description = espressoProduct.DescriptionLong; 91 92 if (doTruncate) 93 { 94 string truncatedDescription = espressoProduct.DescriptionLong.Substring(0, 180); 95 96 description = string.Format("{0}...<span class='identity-inline-collapse-link'>{1}</span>", truncatedDescription, Translate("Product description - show more", "Vis mere")); 97 } 98 99 <div class="@(doTruncate ? "js-identity-product-description-truncated" : string.Empty)" data-full-text="@(doTruncate ? HttpUtility.HtmlAttributeEncode(espressoProduct.DescriptionLong) : string.Empty)" data-partial-text="@(doTruncate ? description : string.Empty)"> 100 @description 101 </div> 102 } 103 </div> 104 @RenderingService.Instance.SectionEnd() 105 </div> 106 @RenderingService.Instance.PartialView("ecom/product/partials/add-to-cart.cshtml", espressoProduct) 107 @if ((shopContext == ShopType.B2B || shopContext == ShopType.CustomerShop)) 108 { 109 <a class="btn btn-primary position-relative mb-2 js-toggle-matrix-modal-btn" href="" data-toggle="modal" data-target=".js-e-product-matrix-modal"> 110 @Translate("eCom Product - Open Matrix - Button", "Vælg størrelser") 111 </a> 112 } 113 <div class="row d-block d-sm-none"> 114 <div class="e-product-text mt-3 mb-4"> 115 <div class="col-12"> 116 @espressoProduct.DescriptionLong 117 </div> 118 </div> 119 </div> 120 @if (shopContext == ShopType.B2B && isCustomerShop == false) 121 { 122 <div class="e-product-downloads"> 123 @RenderingService.Instance.PartialView("ecom/product/partials/part-downloads.cshtml", espressoProduct) 124 </div> 125 } 126 @if ((shopContext != ShopType.B2B && shopContext != ShopType.CustomerShop) && PageView.Current().IsBasketEnabled()) 127 { 128 <div class="e-product-delivery font-weight-bold mb-2 text-heading"> 129 @RenderingService.Instance.PartialView("ecom/product/partials/delivery-info.cshtml", espressoProduct) 130 </div> 131 } 132 133 </div> 134 </div> 135 <div class="col-12 col-sm-7 order-first"> 136 <div class="e-product-image-container js-e-product-images"> 137 @RenderingService.Instance.PartialView("ecom/product/partials/images_optimized.cshtml", espressoProduct) 138 </div> 139 <div class="js-e-product-modal-images"> 140 @RenderingService.Instance.PartialView("ecom/product/partials/images-modal_optimized.cshtml", espressoProduct) 141 </div> 142 143 144 </div> 145 146 </div> 147 </div> 148 @RenderingService.Instance.SectionEnd() 149 150 @{ 151 int uspPageContentPageId; 152 int.TryParse(PageView.Current().CurrentParagraph.Item["USPPageId"]?.ToString(), out uspPageContentPageId); 153 } 154 @if (uspPageContentPageId > 0 && shopContext == ShopType.B2B) 155 { 156 @RenderingService.Instance.SectionStart(new SectionSettings 157 { 158 Classes = new ClassList("e-section p-section mx-auto py-0"), 159 ContentClasses = new ClassList("col-12 col-lg-8 col-xl-7 mx-auto") 160 }) 161 <div class="row"> 162 @RenderPageContent(uspPageContentPageId) 163 </div> 164 @RenderingService.Instance.SectionEnd() 165 166 } 167 @RenderingService.Instance.SectionStart(new SectionSettings 168 { 169 Classes = new ClassList("e-section p-section mx-auto py-0"), 170 ContentClasses = new ClassList("col-12 col-lg-8 col-xl-7 mx-auto"), 171 InnerRowClasses = new ClassList("row js-identity-specifications-container"), 172 173 174 }) 175 @RenderingService.Instance.PartialView("ecom/product/partials/identity-part-specifications-v2.cshtml", espressoProduct) 176 @RenderingService.Instance.SectionEnd() 177 @{ 178 int detailsPageContetPageId; 179 180 int.TryParse(PageView.Current().Area.Item["ProductDetailsPage"]?.ToString(), out detailsPageContetPageId); 181 } 182 183 <div class="js-render-page-content" data-page-id="@detailsPageContetPageId"> 184 <div class="identity-variant-loader js-identity-variant-loader position-relative pb-1 pt-6"> 185 @RenderingService.Instance.PartialView( "_partials/loading-spinner.cshtml" ) 186 </div> 187 </div> 188 189 @if (shopContext != ShopType.CustomerShop) 190 { 191 if (espressoProduct.RelatedGroups.ContainsKey("RELGRP6") && espressoProduct.RelatedGroups["RELGRP6"].Products.Any()) 192 { 193 @RenderingService.Instance.SectionStart(new SectionSettings 194 { 195 Classes = new ClassList("e-section py-1 js-e-productlist") 196 }) 197 @RenderingService.Instance.PartialView("ecom/product/partials/related-products.cshtml", espressoProduct.RelatedGroups["RELGRP6"]) 198 @RenderingService.Instance.SectionEnd() 199 } 200 201 if (espressoProduct.YouHaveSeenTheseProducts != null && espressoProduct.YouHaveSeenTheseProducts.Products.Any()) 202 { 203 @RenderingService.Instance.SectionStart(new SectionSettings 204 { 205 Classes = new ClassList("e-section py-1 js-e-productlist") 206 }) 207 @RenderingService.Instance.PartialView("ecom/product/partials/related-products.cshtml", espressoProduct.YouHaveSeenTheseProducts) 208 @RenderingService.Instance.SectionEnd() 209 } 210 } 211 212 213 214 @if (shopContext == ShopType.B2B || shopContext == ShopType.CustomerShop) 215 { 216 @RenderingService.Instance.PartialView("eCom/Product/partials/part-product-matrix.cshtml", espressoProduct) 217 } 218 219 @RenderingService.Instance.PartialView("ecom/product/partials/identity-part-sizeguide-modal.cshtml", espressoProduct) 220 @RenderingService.Instance.PartialView("ecom/product/partials/identity-part-deliveryinfo-modal.cshtml", espressoProduct) 221 222 @RenderingService.Instance.PartialView("ecom/product/partials/metadata.cshtml", espressoProduct) 223 @RenderingService.Instance.PartialView("ecom/product/partials/gtm-tracking.cshtml", espressoProduct) 224 225 <code class="js-e-breadcrumb-item-append" data-link="@HttpUtility.HtmlAttributeEncode(espressoProduct.Link)" data-text="@HttpUtility.HtmlAttributeEncode(espressoProduct.Name)"></code> 226 227 <script> 228 e4.data.set( '@(espressoProduct.Id)_VariantCombinationTree', JSON.parse('@HttpUtility.JavaScriptStringEncode(JsonService.Instance.ToJson(espressoProduct.VariantCombinationTree))') ); 229 e4.data.set( '@(espressoProduct.Id)_VariantCombinationIds', JSON.parse('@HttpUtility.JavaScriptStringEncode(JsonService.Instance.ToJson(espressoProduct.VariantCombinations.Keys))') ); 230 e4.data.set( '@(espressoProduct.Id)_PdfData', JSON.parse('@HttpUtility.JavaScriptStringEncode(RenderingService.Instance.PartialView("ecom/product/partials/part-pdf-data.cshtml", espressoProduct))') ); 231 </script> 232 233 </div> 234 @RenderingService.Instance.SectionStart(new SectionSettings()) 235 236
Redegørelse for samfundsansvar, jf. årsregnskabslovens § 99 a". ID® Ansvarlighedsrapport 2022/2023. Se her