Kurv (0)

Din kurv er tom

Du har ikke tilføjet nogen produkter endnu

Exception in template (Designs\Bricks\eCom/Productlist/ProductList.cshtml): System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at CompiledRazorTemplates.Dynamic.acbafbfced.Execute()
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context)
   at RazorEngine.Templating.TemplateService.Run(ITemplate template, DynamicViewBag viewBag)
   at RazorEngine.Templating.TemplateService.Parse(String razorTemplate, Object model, DynamicViewBag viewBag, String cacheName)
   at RazorEngine.Razor.Parse[T](String razorTemplate, T model, DynamicViewBag viewBag, String cacheName)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()
@{ var subgroup = GetLoop("Subgroups"); var products = GetLoop("Products"); var root = GetGlobalValue("Global:Pageview.Url"); var rootGroup = "/" + root.Split(new [] {"/"}, StringSplitOptions.None)[1] + "/" + root.Split(new [] {"/"}, StringSplitOptions.None)[2]; var activeClass = (root == rootGroup) ? "is-active" : ""; var isUser = ( GetGlobalValue("Global:Extranet.UserID") == "0" ) ? false : true; List<string> productArrayList = new List<string>(); } @{ var breadcrumbProductName = GetString("Ecom:Product.Name"); } <div class="page-section--wide breadcrumbs__container"> <nav class="page-section__container"> <ul class="breadcrumbs"> <li class="breadcrumbs__list"> <a class="breadcrumbs__item" href="/">@Translate("breadcrumbRootName")</a> </li> @RenderNavigation(new { template = "breadcrumb.xslt", expandmode = "pathonly", id = "breadcrumb" }) @if( breadcrumbProductName != "" ) { <li class="breadcrumbs__list"> <a class="breadcrumbs__item">> @breadcrumbProductName</a> </li> } </ul> </nav> </div> <div class="page-section--wide product-list__container"> <section class="page-section__container"> <article class="product-list__group"> @if(!string.IsNullOrEmpty(@GetString("Ecom:Group:Field.customHeadline.Value.Clean"))){ <h1>@GetString("Ecom:Group:Field.customHeadline.Value.Clean")</h1> }else{ <h1>@GetString("Ecom:Group.Name")</h1> } <span class="product-list__group--text">@GetString("Ecom:Group.Description")</span> </article> <article class="teaser"> <h4 class="teaser__headline">@Translate("eComTeaserHeadline")</h4> <a class="teaser__phone" href="tel:@Translate("eComTeaserPhoneValue")">@Translate("eComTeaserPhoneDisplay").Replace(" ", "&nbsp;")</a> <span class="teaser__text">@Translate("eComTeaserText1")</span> <span class="teaser__text">@Translate("eComTeaserText2")</span> </article> </section> </div> <div class="page-section--wide background--septenary"> <section class="page-section__container product-list__categories"> <a class="product-list__button @activeClass" href="@rootGroup">@Translate("eComGroupButton","Alle")</a> @RenderNavigation(new { template = "categories.xslt", expandmode = "all", id = "categories" }) </section> <section class="page-section__container"> @if( subgroup.Any() ) { foreach( var i in subgroup ) { <text> @foreach( var item in GetLoop("Products") ){ if( item.GetString("Ecom:Product.PrimaryOrFirstGroupID")==i.GetString("Ecom:Group.ID") ){ string link = @item.GetString("Ecom:Product.LinkGroup.Clean"); string productName = @item.GetString("Ecom:Product.Name"); //bool unavailableOnline = Convert.ToBoolean( item.GetString("Ecom:Product:Field.unavailableonline.Value") ); bool unavailableOnline = item.GetBoolean("Ecom:Product:Field.unavailableonline.Value"); string images = "/Files/Images/Products/" + @item.GetString("Ecom:Product.Number").Replace("/", "").Replace(".", "").Replace(",", "") + "_1.jpg"; <text> @if( !productArrayList.Exists(x => x == item.GetString("Ecom:Product.Number") ) ) { <text> <a class="product-list" href="@link"> <div class="product-list__image-container"> <img class="product-list__image" src="/Admin/Public/getImage.ashx?Image=@images&amp;height=160&amp;width=160&amp;crop=5&altFmImage_path=/Files/Templates/Designs/Bricks/assets/images/noimage.gif" alt="@productName"> </div> <div class="product-list__text-container"> <h4 class="product-list__headline">@(productName.Length > 37 ? productName.Substring(0, 37) + "..." : productName)</h4> <span class="product-list__number">@Translate("eComProductNumber"): @item.GetString("Ecom:Product.Number")</span> @if( isUser && !unavailableOnline){ if(!item.GetBoolean("Ecom:Product.Price.IsZero")){ <span class="product-list__price">@item.GetString("Ecom:Product.Price.PriceWithoutVAT") @item.GetString("Ecom:Product.Price.Currency.Code")</span> }else{ <span class="product-list__price">@Translate("eComAskForPrice","Ring for pris")</span> } } else if (unavailableOnline && isUser){ <span class="product-list__price">@Translate("eComProductListTeaser")</span> } </div> </a> </text> } </text> productArrayList.Add(@item.GetString("Ecom:Product.Number")); } } </text> } } @* If no subgroups loop products *@ else { foreach( var i in GetLoop("Products") ) { @* The foreach variabel name must be "i" *@ string productName = i.GetString("Ecom:Product.Name"); bool unavailable = i.GetBoolean("Ecom:Product:Field.unavailableonline"); string price = "&nbsp;"; string number = i.GetString("Ecom:Product.Number"); string images = "/Files/Images/Products/" + number.Replace("/", "").Replace(".", "").Replace(",", "") + "_1.jpg"; string link = GetString("Ecom:Product.RelatedCount").Any() ? i.GetString("Ecom:Product.Link.Clean") + "&GroupID=" + i.GetString("Ecom:Product.PrimaryOrFirstGroupID") : i.GetString("Ecom:Product.LinkGroup.Clean"); <a class="product-list" href="@link"> <div class="product-list__image-container"> <img class="product-list__image" src="/Admin/Public/getImage.ashx?Image=@images&amp;height=160&amp;crop=5&altFmImage_path=/Files/Templates/Designs/Bricks/assets/images/noimage.gif" alt="@productName"> </div> <div class="product-list__text-container"> <h4 class="product-list__headline">@(productName.Length > 37 ? productName.Substring(0, 37) + "..." : productName)</h4> <span class="product-list__number">@Translate("eComProductNumber"): @number</span> @if( isUser && !unavailable && i.GetInteger("Ecom:Product.Price.PricePIP") > 0 ) { <span class="product-list__price">@i.GetString("Ecom:Product.Price.PriceWithoutVAT") @i.GetString("Ecom:Product.Price.Currency.Code")</span> } @if (isUser && unavailable) { <span class="product-list__price">@Translate("eComProductListTeaser")</span> } </div> </a> } } </section> </div> <div class="page-section--wide"> <section class="page-section__container"> <article class="product-list__seo-text"> <h1 class="product-list__seo-headline">@GetString("Ecom:Group:Field.seoheadline.Value.Clean")</h1> <p>@GetString("Ecom:Group:Field.seotext.Value.Clean")</p> </article> <img class="product-list__seo-image" src="@GetString("Ecom:Group:Field.seoimage.Clean")"> </section> </div>

Denne hjemmeside bruger cookies til trafikmåling og optimering af indhold. Læs mere

Luk
Clemco Nyhedsbrev