Rental
Inga produkter valda

Din orderlista är tom

Exception in template (Designs\SkanskaMaskin\eCom/Productlist/ProductList.cshtml): System.InvalidOperationException: Cannot access child value on Newtonsoft.Json.Linq.JValue.
   at Newtonsoft.Json.Linq.JToken.get_Item(Object key)
   at CompiledRazorTemplates.Dynamic.aebdfecbcedbcc.CreateBreadcrumbObject(Boolean skiplast)
   at CompiledRazorTemplates.Dynamic.aebdfecbcedbcc.Execute()
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context)
   at RazorEngine.Razor.Parse[T](String razorTemplate, T model, String cacheName)
   at Dynamicweb.Rendering.Template.Output()
@inherits RazorTemplateBase<RazorTemplateModel<Template>> @using Dynamicweb.Rendering; @using Newtonsoft.Json @using Softgear.SkanskaMaskin.Data.Business @using Softgear.SkanskaMaskin.Data.Entities.Product @using Newtonsoft.Json; @using Newtonsoft.Json.Linq; @using System.Xml; @using Softgear.SkanskaMaskin.Data.Entities.Common @using Dynamicweb; @functions{ public Breadcrumb CreateBreadcrumbObject(bool skiplast = true) { /* Navigering */ var navigationData = RenderNavigation(new { template = "breadcrumb-navigation.xslt", id = "breadcrumb" }); var doc = new XmlDocument(); doc.LoadXml(navigationData.Trim()); var json = JObject.Parse(JsonConvert.SerializeXmlNode(doc)); var breadCrumb = new Breadcrumb {items = new List<Link>()}; if (json["nav"]["items"].Type.ToString() == "Array") { for (int i = 0; i < json["nav"]["items"].Count(); i++) { breadCrumb.items.Add(new Link { text = json["nav"]["items"][i]["text"].ToString(), href = json["nav"]["items"][i]["href"].ToString() }); } } else { breadCrumb.items.Add(new Link { text = json["nav"]["items"]["text"].ToString(), href = json["nav"]["items"]["href"].ToString() }); } return breadCrumb; } } @{ var url = Dynamicweb.Frontend.PageView.Current().SearchFriendlyUrl; var groupHeading = GetString("Ecom:Group.Name"); var hbh = new HandleBarsHelper(); } <div class="Stack"> <div class="Container"> @{ string breadCrumb = ""; if (url.ToLower().StartsWith("/sok?q=")) { groupHeading = Translate("sokresultat", "Sökresultat"); } else { breadCrumb = @hbh.render("breadcrumb/index.hbs", CreateBreadcrumbObject()); } if (GetLoop("Childgroups").Count <= 0) { @breadCrumb <div class="CategoryList-intro CategoryList-intro--1"> <div class="Grid"> <div class="Grid-cell u-sizeFull"> <div class="Type Type--push"> <h1> @groupHeading </h1> </div> </div> <div class="Grid-cell u-md-size1of2 u-lg-size1of2"> <div class="Type Type--push"> @GetString("Ecom:Group.Description") </div> </div> </div> </div> } } </div> <div class="Container"> <div class="EntryGrid" data-controller="entry-grid" data-header-selector=".Header" data-url="@url"> <div class="Grid Grid--equalHeight Grid--withGutter Grid--push js-entryGrid"> @{ foreach (var productItem in GetLoop("Products")) { var mainImageUrl = WebHelper.getCdnImageUrl(productItem.GetString("Ecom:Product.Number")); var panel = WebHelper.crateProductPanel(productItem); var productComponent = new ProductComponent { href = productItem.GetString("Ecom:Product.LinkGroup.Clean"), image = new Softgear.SkanskaMaskin.Data.Entities.Product.Image { src = mainImageUrl }, tag = productItem.GetString("Ecom:Product.Number"), heading = productItem.GetString("Ecom:Product.Name"), sub = productItem.GetString("Ecom:Product.ShortDescription").Replace("<p>", "").Replace("</p>", ""), panel = panel, }; hbh = new HandleBarsHelper(); hbh.registerHelper("json", JsonConvert.SerializeObject(panel)); <div class="Grid-cell u-md-size1of3 u-lg-size1of4 js-entryGridItem"> @hbh.render("product/index.hbs", productComponent) </div> } } </div> </div> </div> </div> @{ if (GetInteger("Ecom:ProductList.TotalPages") > 1) { <div class="Stack"> <div class="Container Stack--tn"> @{ var pageList = new List<object>(); hbh = new HandleBarsHelper(); foreach (var pageItem in GetLoop("Ecom:ProductList.Pages")) { pageList.Add( new { href = pageItem.GetString("Ecom:ProductList.Pages.Page.Url"), active = pageItem.GetBoolean("Ecom:ProductList.Pages.Page.IsCurrent"), text = pageItem.GetString("Ecom:ProductList.Pages.Page.Number") } ); } var pagingData = new { items = pageList.ToArray() }; @hbh.render("pagination/index.hbs", pagingData); } </div> </div> } }