Error executing template "Designs/Plus/eCom/Productlist/Grouplist.cshtml"System.NullReferenceException: Objektreferencen er ikke indstillet til en forekomst af et objekt.ved CompiledRazorTemplates.Dynamic.RazorEngine_00327b0ea0e148b5a1b2d4633d1a0b5e.Execute() i C:\inetpub\wwwroot\plus-live\Files\Templates\Designs\Plus\eCom\Productlist\Grouplist.cshtml:linje 421ved RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)ved RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)ved RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.b__0(TextWriter writer)ved RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)ved Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2 @using System.Web; 3 @using Dynamicweb.Rendering; 4 @using Plus.Files; 5 6 @functions{ 7 8 string[] facetMaterial = string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["Material"]) ? null : HttpContext.Current.Request.QueryString["Material"].Split(','); 9 string[] facetColor = string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["Color"]) ? null : HttpContext.Current.Request.QueryString["Color"].Split(','); 10 string[] facetWidth = string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["Width"]) ? null : HttpContext.Current.Request.QueryString["Width"].Split(','); 11 string[] facetHeight = string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["Height"]) ? null : HttpContext.Current.Request.QueryString["Height"].Split(','); 12 string[] facetLength = string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["Length"]) ? null : HttpContext.Current.Request.QueryString["Length"].Split(','); 13 string[] facetType = string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["Type"]) ? null : HttpContext.Current.Request.QueryString["Type"].Split(','); 14 15 16 List<string[]> facets = new List<string[]>(); 17 18 19 20 } 21 @{ 22 Dynamicweb.Ecommerce.Products.Group group = Dynamicweb.Ecommerce.Products.Group.GetGroupById(GetString("Ecom:Group.ID")); 23 } 24 25 26 @if (group != null && group.IsTopGroup) 27 { 28 string tempSelected = ""; 29 if (facetMaterial != null) { facets.Add(facetMaterial); tempSelected = "Material"; } 30 if (facetColor != null) { facets.Add(facetColor); tempSelected = "Color"; } 31 if (facetWidth != null) { facets.Add(facetWidth); tempSelected = "Width"; } 32 if (facetHeight != null) { facets.Add(facetHeight); tempSelected = "Height"; } 33 if (facetLength != null) { facets.Add(facetLength); tempSelected = "Length"; } 34 if (facetType != null) { facets.Add(facetType); tempSelected = "Type"; } 35 36 37 if (facets.Count == 1) 38 { 39 HttpContext.Current.Session["PrimaryFacet"] = tempSelected; 40 } 41 if (facets.Count == 0) 42 { 43 HttpContext.Current.Session["PrimaryFacet"] = ""; 44 } 45 46 string primaryFacet = HttpContext.Current.Session["PrimaryFacet"].ToString(); 47 48 List<RazorTemplateBase<RazorTemplateModel<Template>>.LoopItem> productGroups = GetLoop("Childgroups").Where(g => 49 (facetMaterial == null || (facetMaterial.Any() && g.GetString("Ecom:Group:Field.ProductMaterial").Split(',').Any(t => facetMaterial.Contains(t.ToString())))) 50 && (facetColor == null || (facetColor.Any() && g.GetString("Ecom:Group:Field.ProductColor").Split(',').Any(t => facetColor.Contains(t.ToString())))) 51 && (facetWidth == null || (facetWidth.Any() && g.GetString("Ecom:Group:Field.WidthCm").Split(',').Any(t => facetWidth.Contains(t.ToString())))) 52 && (facetHeight == null || (facetHeight.Any() && g.GetString("Ecom:Group:Field.HeightCm").Split(',').Any(t => facetHeight.Contains(t.ToString())))) 53 && (facetLength == null || (facetLength.Any() && g.GetString("Ecom:Group:Field.LengthCm").Split(',').Any(t => facetLength.Contains(t.ToString())))) 54 && (facetType == null || (facetType.Any() && g.GetString("Ecom:Group:Field.ProductType").Split(',').Any(t => facetType.Contains(t.ToString())))) 55 ).ToList(); 56 //ProductColor ProductMaterial WidthCm HeightCm LengthCm 57 58 var matList = string.Join(",", productGroups.Select(g => g.GetString("Ecom:Group:Field.ProductMaterial")).Distinct()).Split(',').Where(s => !string.IsNullOrEmpty(s)).Distinct(); 59 if (primaryFacet == "Material") 60 { 61 matList = string.Join(",", GetLoop("Childgroups").Select(g => g.GetString("Ecom:Group:Field.ProductMaterial")).Distinct()).Split(',').Where(s => !string.IsNullOrEmpty(s)).Distinct(); 62 } 63 var colList = string.Join(",", productGroups.Select(g => g.GetString("Ecom:Group:Field.ProductColor")).Distinct()).Split(',').Where(s => !string.IsNullOrEmpty(s)).Distinct(); 64 if (primaryFacet == "Color") 65 { 66 colList = string.Join(",", GetLoop("Childgroups").Select(g => g.GetString("Ecom:Group:Field.ProductColor")).Distinct()).Split(',').Where(s => !string.IsNullOrEmpty(s)).Distinct(); 67 } 68 var widthList = string.Join(",", productGroups.Select(g => g.GetString("Ecom:Group:Field.WidthCm")).Distinct()).Split(',').Where(s => !string.IsNullOrEmpty(s)).Distinct(); 69 if (primaryFacet == "Width") 70 { 71 widthList = string.Join(",", GetLoop("Childgroups").Select(g => g.GetString("Ecom:Group:Field.WidthCm")).Distinct()).Split(',').Where(s => !string.IsNullOrEmpty(s)).Distinct(); 72 } 73 widthList = widthList.Select(s => 74 { 75 int i = 0; 76 int.TryParse(s.Trim(), out i); 77 return i; 78 }).OrderByDescending(i => i).Distinct().Where(i => !i.Equals(0)).Select(i => i.ToString()); 79 80 var lengthList = string.Join(",", productGroups.Select(g => g.GetString("Ecom:Group:Field.LengthCm")).Distinct()).Split(',').Where(s => !string.IsNullOrEmpty(s)).Distinct(); 81 if (primaryFacet == "Length") 82 { 83 lengthList = string.Join(",", GetLoop("Childgroups").Select(g => g.GetString("Ecom:Group:Field.LengthCm")).Distinct()).Split(',').Where(s => !string.IsNullOrEmpty(s)).Distinct(); 84 } 85 lengthList = lengthList.Select(s => 86 { 87 int i = 0; 88 int.TryParse(s.Trim(), out i); 89 return i; 90 }).OrderByDescending(i => i).Distinct().Where(i => !i.Equals(0)).Select(i => i.ToString()); 91 92 var heightList = string.Join(",", productGroups.Select(g => g.GetString("Ecom:Group:Field.HeightCm")).Distinct()).Split(',').Where(s => !string.IsNullOrEmpty(s)).Distinct(); 93 if (primaryFacet == "Height") 94 { 95 heightList = string.Join(",", GetLoop("Childgroups").Select(g => g.GetString("Ecom:Group:Field.HeightCm")).Distinct()).Split(',').Where(s => !string.IsNullOrEmpty(s)).Distinct(); 96 } 97 heightList = heightList.Select(s => 98 { 99 int i = 0;100 int.TryParse(s.Trim(), out i);101 return i;102 }).OrderByDescending(i => i).Distinct().Where(i => !i.Equals(0)).Select(i => i.ToString());103104 var typeList = string.Join(",", productGroups.Select(g => g.GetString("Ecom:Group:Field.ProductType")).Distinct()).Split(',').Where(s => !string.IsNullOrEmpty(s)).Distinct();105 if (primaryFacet == "Type")106 {107 typeList = string.Join(",", GetLoop("Childgroups").Select(g => g.GetString("Ecom:Group:Field.ProductType")).Distinct()).Split(',').Where(s => !string.IsNullOrEmpty(s)).Distinct();108 }109110 int groupCount = productGroups.Count();111112113 //Breadcrumb114 string frontpageName = Pageview.Area.Item.FirstOrDefault(i => i.Key == "Frontpage_Name").Value.ToString();115 string frontpageLink = Pageview.Area.Item.FirstOrDefault(i => i.Key == "Base_Link").Value.ToString();116 <ul class="link-list link-list--breadcrumb">117 <nav class="breadcrumb">118 <div class="grid-container grid-container--site-width">119 <div class="grid-row ">120 <div class="grid-column ">121 <ul class="link-list link-list--breadcrumb">122 <li class="link-list__item ">123 <a property="url" class="link-list__link " href="@frontpageLink">124 @(frontpageName)125 </a>126 </li>127 <li class="link-list__item ">128 @GetString("Ecom:Group.Name")129 </li>130 </ul>131 </div>132 </div>133 </div>134 </nav>135 </ul>136 //Header137 if (!string.IsNullOrWhiteSpace(GetString("Ecom:Group:Field.groupHeader")))138 {139 <section class="grid-page-header ">140 <div class="grid-container grid-container--site-width">141 <div class="grid-row grid-row--two-columns ">142 <div class="grid-column ">143 <div class="grid-page-header__content">144 <h1 class="heading heading--main">@GetString("Ecom:Group:Field.groupHeader")</h1>145 </div>146 </div>147 <div class="grid-column ">148 @GetString("Ecom:Group:Field.groupLongDescription")149 </div>150 </div>151 </div>152 </section>153 }154 //Filter155 <section class="filter-bar">156 <div class="grid-container grid-container--site-width">157 <div class="filter-bar__inner">158159 <ul class="filter-bar__list" id="filter-bar__list" data-groupid="@GetString("Ecom:Group.ID")" data-path="@Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("default.aspx?id=" + Pageview.Area.Item.FirstOrDefault(i => i.Key == "GroupsFilterPageId").Value.ToString())">160 @if (typeList.Any())161 {162 <li class="filter-bar__item">163 <div class="filter filter--checkbox filter--default">164 <div class="filter__chosen">165 <span class="filter__default-header">@Translate("Vælg type", "Vælg type")</span>166 <span class="filter__chosen-header">@Translate("Type", "Type"): </span>167 <span class="filter__chosen-items"></span>168 </div>169 <div class="filter__options">170 <span class="filter__close"></span>171 <div class="filter__options-inner">172 <div class="filter__options-content">173 <div class="filter__options-header">@Translate("Vælg type", "Vælg type")</div>174 <ul class="filter__list">175 @foreach (var type in typeList)176 {177 <li class="filter__item">178 <input type="checkbox" onchange="updateGroupList()" name="Type" id="Type-@type" class="filter__input" value="@type" @(facetType != null && facetType.Contains(type) ? "checked=\"checked\"" : "")>179 <label for="Type-@type" class="filter__label">@Translate(type, type)</label>180 </li>181 }182 </ul>183 </div>184 </div>185 </div>186 </div>187 </li>188 }189 @if (matList.Any())190 {191 <li class="filter-bar__item">192 <div class="filter filter--checkbox filter--default">193 <div class="filter__chosen">194 <span class="filter__default-header">@Translate("Vælg materiale", "Vælg materiale")</span>195 <span class="filter__chosen-header">@Translate("Materiale", "Materiale"): </span>196 <span class="filter__chosen-items"></span>197 </div>198 <div class="filter__options">199 <span class="filter__close"></span>200 <div class="filter__options-inner">201 <div class="filter__options-content">202 <div class="filter__options-header">@Translate("Vælg materiale", "Vælg materiale")</div>203 <ul class="filter__list">204 @foreach (var mat in matList)205 {206 <li class="filter__item">207 <input type="checkbox" onchange="updateGroupList()" name="Material" id="Material-@mat" class="filter__input" value="@mat" @(facetMaterial != null && facetMaterial.Contains(mat) ? "checked=\"checked\"" : "")>208 <label for="Material-@mat" class="filter__label">@Translate(mat, mat)</label>209 </li>210 }211 </ul>212 </div>213 </div>214 </div>215 </div>216 </li>217 }218 @if (colList.Any())219 {220 <li class="filter-bar__item">221 <div class="filter filter--checkbox filter--default">222 <div class="filter__chosen">223 <span class="filter__default-header">@Translate("Vælg farve", "Vælg farve")</span>224 <span class="filter__chosen-header">@Translate("Farve", "Farve"): </span>225 <span class="filter__chosen-items"></span>226 </div>227 <div class="filter__options">228 <span class="filter__close"></span>229 <div class="filter__options-inner">230 <div class="filter__options-content">231 <div class="filter__options-header">@Translate("Vælg farve", "Vælg farve")</div>232 <ul class="filter__list">233 @foreach (var col in colList)234 {235 <li class="filter__item">236 <input type="checkbox" onchange="updateGroupList()" name="Color" id="Color-@col" class="filter__input" value="@col" @(facetColor != null && facetColor.Contains(col) ? "checked=\"checked\"" : "")>237 <label for="Color-@col" class="filter__label">@Translate(col, col)</label>238 </li>239 }240 </ul>241 </div>242 </div>243 </div>244 </div>245 </li>246 }247 @if (widthList.Any())248 {249 <li class="filter-bar__item">250 <div class="filter filter--checkbox filter--default">251 <div class="filter__chosen">252 <span class="filter__default-header">@Translate("Vælg bredde", "Vælg bredde")</span>253 <span class="filter__chosen-header">@Translate("Bredde", "Bredde"): </span>254 <span class="filter__chosen-items"></span>255 </div>256 <div class="filter__options">257 <span class="filter__close"></span>258 <div class="filter__options-inner">259 <div class="filter__options-content">260 <div class="filter__options-header">@Translate("Vælg bredde", "Vælg bredde")</div>261 <ul class="filter__list">262 @foreach (var width in widthList)263 {264 <li class="filter__item">265 <input type="checkbox" onchange="updateGroupList()" name="Width" id="Width-@width" class="filter__input" value="@width" @(facetWidth != null && facetWidth.Contains(width) ? "checked=\"checked\"" : "")>266 <label for="Width-@width" class="filter__label">@width</label>267 </li>268 }269 </ul>270 </div>271 </div>272 </div>273 </div>274 </li>275 }276 @if (heightList.Any())277 {278 <li class="filter-bar__item">279 <div class="filter filter--checkbox filter--default">280 <div class="filter__chosen">281 <span class="filter__default-header">@Translate("Vælg højde", "Vælg højde")</span>282 <span class="filter__chosen-header">@Translate("Højde", "Højde"): </span>283 <span class="filter__chosen-items"></span>284 </div>285 <div class="filter__options">286 <span class="filter__close"></span>287 <div class="filter__options-inner">288 <div class="filter__options-content">289 <div class="filter__options-header">@Translate("Vælg højde", "Vælg højde")</div>290 <ul class="filter__list">291 @foreach (var height in heightList)292 {293 <li class="filter__item">294 <input type="checkbox" onchange="updateGroupList()" name="Height" id="Height-@height" class="filter__input" value="@height" @(facetHeight != null && facetHeight.Contains(height) ? "checked=\"checked\"" : "")>295 <label for="Height-@height" class="filter__label">@height</label>296 </li>297 }298 </ul>299 </div>300 </div>301 </div>302 </div>303 </li>304 }305 @if (lengthList.Any())306 {307 <li class="filter-bar__item">308 <div class="filter filter--checkbox filter--default">309 <div class="filter__chosen">310 <span class="filter__default-header">@Translate("Vælg længde", "Vælg længde")</span>311 <span class="filter__chosen-header">@Translate("Længde", "Længde"): </span>312 <span class="filter__chosen-items"></span>313 </div>314 <div class="filter__options">315 <span class="filter__close"></span>316 <div class="filter__options-inner">317 <div class="filter__options-content">318 <div class="filter__options-header">@Translate("Vælg længde", "Vælg længde")</div>319 <ul class="filter__list">320 @foreach (var length in lengthList)321 {322 <li class="filter__item">323 <input type="checkbox" onchange="updateGroupList()" name="Length" id="Length-@length" class="filter__input" value="@length" @(facetLength != null && facetLength.Contains(length) ? "checked=\"checked\"" : "")>324 <label for="Length-@length" class="filter__label">@length</label>325 </li>326 }327 </ul>328 </div>329 </div>330 </div>331 </div>332 </li>333 }334 </ul>335336 <div class="filter-bar__result-info">337 <div class="filter-result-amount">@groupCount @Translate("produktserier", "produktserier")</div>338339 </div>340 </div>341 </div>342 </section>343 //Groups list344 <section class="list-cards-simple list-cards-simple--3cols">345 <div class="grid-container grid-container--site-width">346 <ul class="grid-row grid-row--three-columns-113333 list-cards-simple__list">347 @DisplayGroups(productGroups)348 </ul>349 </div>350 </section>351 }352 else353 {354 //Top image355 string topImage = GetString("Ecom:Group:Field.groupBannerImage.Clean").Replace(" ", "%20");356 if (!string.IsNullOrWhiteSpace(topImage))357 {358 <section class="full-width-banner full-width-banner--top">359 <div class="full-width-banner__fallback full-width-banner__fallback--mobile">360 <div class="full-width-banner__fallback-image" style="background-image: url(@topImage?mode=crop&width=767&quality=80);"></div>361 </div>362 <div class="full-width-banner__fallback full-width-banner__fallback--tablet">363 <div class="full-width-banner__fallback-image" style="background-image: url(@topImage?mode=crop&width=1199&quality=80);"></div>364 </div>365 <div class="full-width-banner__fallback full-width-banner__fallback--desktop">366 <div class="full-width-banner__fallback-image" style="background-image: url(@topImage?mode=crop&width=2000&quality=80);"></div>367 </div>368 <div class="full-width-banner__bg-holder">369 <div class="full-width-banner__bg lazyload" data-bgset="@topImage?mode=crop&amp;width&#x3D;575&quality=80 [(max-width: 575px)] | @topImage?mode=crop&amp;width&#x3D;767&quality=80 [(max-width: 767px)] | @topImage?mode=crop&amp;width&#x3D;991&quality=80 [(max-width: 991px)] | @topImage?mode=crop&amp;width&#x3D;1199&quality=80 [(max-width: 1199px)] | @topImage?mode=crop&amp;width&#x3D;1399&quality=80 [(max-width: 1399px)] | @topImage?mode=crop&amp;width&#x3D;1599&quality=80 [(max-width: 1599x)] | @topImage?mode=crop&amp;width&#x3D;2000&quality=80" data-sizes="auto"></div>370 </div>371 <div class="grid-container grid-container--site-width-fh">372 <div class="full-width-banner__content">373 <div class="grid-row grid-row--two-columns">374 <div class="grid-column">375 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:Group:Field.groupBannerPreHeader")))376 {377 <p class="preheading preheading--fw-banner">@GetString("Ecom:Group:Field.groupBannerPreHeader")</p>378 }379 <h1 class="heading heading--main heading--main-fw-banner-top">@GetString("Ecom:Group:Field.groupBannerHeader")</h1>380 <div class="body-text body-text--fw-banner-top">381 <p>@GetString("Ecom:Group:Field.GroupBannerText")</p>382 </div>383384385 @if (GetString("Ecom:Group:Field.groupBannerButton1Link") != "")386 {387 <a href="@GetString("Ecom:Group:Field.groupBannerButton1Link")" class="button button--fw-banner">388 <span class="button__text">@GetString("Ecom:Group:Field.groupBannerButton1Text")</span>389 </a>390 }391 @if (GetString("Ecom:Group:Field.groupBannerButton2Link") != "")392 {393 <a href="@GetString("Ecom:Group:Field.groupBannerButton2Link")" class="button button--arrow button--fw-banner">394 <span class="button__text">@GetString("Ecom:Group:Field.groupBannerButton2Text")</span><span class="arrow arrow--right "></span>395 </a>396 }397398399400 </div>401 </div>402 </div>403 </div>404 </section>405 }406 //Breadcrumb407 string productPageId = Pageview.Area.Item.FirstOrDefault(i => i.Key == "ProductPageId").Value.ToString();408 string frontpageName = Pageview.Area.Item.FirstOrDefault(i => i.Key == "Frontpage_Name").Value.ToString();409 string frontpageLink = Pageview.Area.Item.FirstOrDefault(i => i.Key == "Base_Link").Value.ToString();410 <ul class="link-list link-list--breadcrumb">411 <nav class="breadcrumb">412 <div class="grid-container grid-container--site-width">413 <div class="grid-row ">414 <div class="grid-column ">415 <ul class="link-list link-list--breadcrumb">416 <li class="link-list__item ">417 <a property="url" class="link-list__link " href="@frontpageLink">418 @(frontpageName)419 </a>420 </li>421 @foreach (var subGroup in group.ParentGroups)422 {423 string groupLink = "Default.aspx?ID=" + productPageId + "&GroupID=" + subGroup.Id;424 <li class="link-list__item ">425 <a property="url" class="link-list__link " href="@groupLink">426 @subGroup.Name427 </a>428 </li>429 }430 <li class="link-list__item ">431 @GetString("Ecom:Group.Name")432 </li>433 </ul>434 </div>435 </div>436 </div>437 </nav>438 </ul>439440441 //Downloads442 if (Dynamicweb.Security.UserManagement.User.IsExtranetUserLoggedIn())443 {444 <section class="downloads">445 <div class="grid-container grid-container--site-width">446447 <ul class="downloads-list">448 <li class="downloads-list__item">449 <input type="hidden" id="productsIDs" value="@string.Join(",", group.Products.Select(p => p.Id).ToArray())" />450 <label for="selectCustomFileNameTypes" class="downloads-list__label">@Translate("Hent billeder for alle produkter i gruppen (zip-fil)", "Hent billeder for alle produkter i gruppen (.zip-fil):")</label>451 <div class="select-custom">452 <input type="checkbox" class="select-custom__check" id="selectCustomFileNameTypes" />453 <label for="selectCustomFileNameTypes" class="select-custom__selected-item" title="@Translate("Vælg type af filnavn", "Vælg type af filnavn")">454 <span class="select-custom__selected-item-text">455 @Translate("Vælg type af filnavn", "Vælg type af filnavn") <span class="select-custom__icon">456 <svg class="select-custom__svg"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/icons/icons.svg#arrow-down"></use></svg>457458459 </span>460 </span>461 </label>462 <div class="select-custom__option-holder">463 <ul class="link-list link-list--custom-select">464 <li class="link-list__item ">465 <a href="#" title="@Translate("EAN nummer", "EAN nummer")" class="link--custom-select " imagetype="ean" property="url">@Translate("EAN nummer", "EAN nummer")</a>466 </li>467 <li class="link-list__item ">468 <a href="#" title="@Translate("DB nummer", "DB nummer")" class="link--custom-select " imagetype="db" property="url">@Translate("DB nummer", "DB nummer")</a>469 </li>470 <li class="link-list__item ">471 <a href="#" title="@Translate("PLUS nummer", "PLUS nummer")" class="link--custom-select " imagetype="plus" property="url">@Translate("PLUS nummer", "PLUS nummer")</a>472 </li>473 <li class="link-list__item ">474 <a href="#" title="@Translate("PLUS + Varenavn + vejl pris", "PLUS + Varenavn + vejl pris")" class="link--custom-select " imagetype="presse" property="url">@Translate("PLUS + Varenavn + vejl pris", "PLUS + Varenavn + vejl pris")</a>475 </li>476 </ul>477 </div>478 </div>479480 </li>481 <li class="downloads-list__item">482 <a href="#" title="@Translate("Hent produktinfo for alle produkter i gruppen (.xml-fil)", "Hent produktinfo for alle produkter i gruppen (.xml-fil)")" class="downloads-list__link " property="url">@Translate("Hent produktinfo for alle produkter i gruppen (.xml-fil)", "Hent produktinfo for alle produkter i gruppen (.xml-fil)")</a>483 </li>484 </ul>485 </div>486 </section>487 }488489 //Description490 <section class="text-text-facts">491 <div class="grid-container grid-container--site-width">492 <div class="grid-row grid-row--three-columns-122333 ">493 <div class="grid-column ">494 <h3 class="heading heading--fw-element">@GetString("Ecom:Group:Field.groupDescriptionHeaderColumn1")</h3>495 <div class="body-text ">496 @GetString("Ecom:Group:Field.groupDescriptionTextColumn1")497 </div>498 </div>499 <div class="grid-column grid-column--2">500 <div class="grid-row grid-row--two-columns-111222 grid-column--2">501 <div class="grid-column ">502 <div class="text-text-facts__small-content">503 <h4 class="heading heading--small heading--small-text-col2">@GetString("Ecom:Group:Field.groupDescriptionHeaderColumn2")</h4>504 <div class="body-text body-text--text-col2">505 @GetString("Ecom:Group:Field.groupDescriptionTextColumn2")506 </div>507 </div>508 </div>509 <div class="grid-column ">510 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:Group:Field.groupDescriptionFactboxColumn3")))511 {512 <div class="facts-box ">513 <div class="body-text body-text--facts-box">514 @GetString("Ecom:Group:Field.groupDescriptionFactboxColumn3")515 </div>516 </div>517 }518 </div>519 </div>520 </div>521 </div>522 </div>523 </section>524 <section class="divider ">525 <span class="divider__icon">526 <svg class="divider__svg"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/frontend/dist/icons/icons.svg#logo"></use></svg>527 </span>528 </section>529530531532533534 foreach (var subgroups in GetLoop("Subgroups").Where(sg => sg.GetString("Ecom:Group:Field.categoryType") == "BOMProducts"))535 {536 //BOM products537538 if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.BOMListHeader")))539 {540 <section class="grid-sub-header ">541 <div class="grid-container grid-container--site-width">542543 <div class="grid-row ">544 <div class="grid-column ">545 <div class="grid-sub-header__content">546 <h2 class="heading heading--sub heading--centered">@GetString("Ecom:Group:Field.BOMListHeader")</h2>547 <p class="teaser teaser--centered">@GetString("Ecom:Group:Field.BOMListText")</p>548 </div>549 </div>550551 </div>552553 </div>554 </section>555 }556557558 var bomProductList = Dynamicweb.Ecommerce.Products.Group.GetGroupById(subgroups.GetString("Ecom:Group.ID"));559 @DisplayBOMProductList(bomProductList, productPageId)560561 <section class="divider ">562 <span class="divider__icon">563 <svg class="divider__svg"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/frontend/dist/icons/icons.svg#logo"></use></svg>564 </span>565 </section>566567 }568569 //Products570 //var productList = Dynamicweb.Ecommerce.Products.Group.GetGroupById(GetString("Ecom:Group.ID"));571 Dynamicweb.Ecommerce.Products.GroupService g = new Dynamicweb.Ecommerce.Products.GroupService();572 var productList = g.GetGroup(GetString("Ecom:Group.ID"));573574 if (productList.Products.Count() > 0)575 {576 if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.ProductListHeader")))577 {578 <a name="products" id="products"></a>579 <section class="grid-sub-header ">580 <div class="grid-container grid-container--site-width">581 <div class="grid-row ">582 <div class="grid-column ">583 <div class="grid-sub-header__content">584 <h2 class="heading heading--sub heading--centered">@GetString("Ecom:Group:Field.ProductListHeader")</h2>585 <p class="teaser teaser--centered">@GetString("Ecom:Group:Field.ProductListText")</p>586 </div>587 </div>588 </div>589 </div>590 </section>591 }592 @DisplayProductList(productList, productPageId)593 }594595 // Subgroups - minus BOM596597 foreach (var subgroups in GetLoop("Subgroups").Where(sg => sg.GetString("Ecom:Group:Field.categoryType") != "BOMProducts"))598 {599600 if (!String.IsNullOrEmpty(subgroups.GetString("Ecom:Group:Field.groupHeader")))601 {602 <section class="grid-sub-header ">603 <div class="grid-container grid-container--site-width">604 <div class="grid-row ">605 <div class="grid-column ">606 <div class="grid-sub-header__content">607 <h2 class="heading heading--sub heading--centered">@subgroups.GetString("Ecom:Group:Field.groupHeader")</h2>608 <p class="teaser teaser--centered">@subgroups.GetString("Ecom:Group:Field.ProductListText")</p>609 </div>610 </div>611 </div>612 </div>613 </section>614615 var subProductList = Dynamicweb.Ecommerce.Products.Group.GetGroupById(subgroups.GetString("Ecom:Group.ID"));616 @DisplayProductList(subProductList, productPageId)617618 <section class="divider ">619 <span class="divider__icon">620 <svg class="divider__svg"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/frontend/dist/icons/icons.svg#logo"></use></svg>621 </span>622 </section>623 }624 }625626627628 //Accessories629630 var accessoriesList = new List<Dynamicweb.Ecommerce.Products.Product>();631 var tempList = new List<string>();632 foreach (var p in productList.Products)633 {634 tempList.AddRange(p.RelatedProducts().Where(rp => rp.RelatedGroupId == "Addon").Select(pr => pr.Product.Id).ToList());635 }636 accessoriesList = Dynamicweb.Ecommerce.Products.Product.GetProductsByProductIDs(tempList.ToArray(), false, Pageview.Area.EcomLanguageId).ToList();637 accessoriesList = accessoriesList.Where(p => p.Active == true).ToList();638 if (accessoriesList.Count > 0)639 {640 if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.AccessoriesListHeader")))641 {642 <a name="accessories" id="accessories"></a>643 <section class="grid-sub-header ">644 <div class="grid-container grid-container--site-width">645 <div class="grid-row ">646 <div class="grid-column ">647 <div class="grid-sub-header__content">648 <h2 class="heading heading--sub heading--centered">@GetString("Ecom:Group:Field.AccessoriesListHeader")</h2>649 <p class="teaser teaser--centered">@GetString("Ecom:Group:Field.AccessoriesListText")</p>650 </div>651 </div>652 </div>653 </div>654 </section>655 }656657 @DisplayProductList(null, productPageId, accessoriesList)658659 }660661 //Gallery662 if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image1.Clean")) || !String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image2.Clean")) || !String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image3.Clean")) || !String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image4.Clean")) || !String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image5.Clean")) || !String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image6.Clean")) || !String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image7.Clean")) || !String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image8.Clean")) || !String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image9.Clean")) || !String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image10.Clean")) || !String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image11.Clean")))663 {664 <section class="gallery">665 <div class="grid-container grid-container--site-width">666 <ul class="gallery__list" id="gallery">667 @{668 if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image1.Clean")))669 {670 @DisplayGalleryImage(GetString("Ecom:Group:Field.Image1.Clean"))671 }672 if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image2.Clean")))673 {674 @DisplayGalleryImage(GetString("Ecom:Group:Field.Image2.Clean"))675676 }677 if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image3.Clean")))678 {679 @DisplayGalleryImage(GetString("Ecom:Group:Field.Image3.Clean"))680681 }682 if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image4.Clean")))683 {684 @DisplayGalleryImage(GetString("Ecom:Group:Field.Image4.Clean"))685686 }687 if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image5.Clean")))688 {689 @DisplayGalleryImage(GetString("Ecom:Group:Field.Image5.Clean"))690691 }692 if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image6.Clean")))693 {694 @DisplayGalleryImage(GetString("Ecom:Group:Field.Image6.Clean"))695696 }697 if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image7.Clean")))698 {699 @DisplayGalleryImage(GetString("Ecom:Group:Field.Image7.Clean"))700701 }702 if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image8.Clean")))703 {704 @DisplayGalleryImage(GetString("Ecom:Group:Field.Image8.Clean"))705706 }707 if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image9.Clean")))708 {709 @DisplayGalleryImage(GetString("Ecom:Group:Field.Image9.Clean"))710711 }712 if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image10.Clean")))713 {714 @DisplayGalleryImage(GetString("Ecom:Group:Field.Image10.Clean"))715716 }717 if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image11.Clean")))718 {719 @DisplayGalleryImage(GetString("Ecom:Group:Field.Image11.Clean"))720 }721 }722 </ul>723 <button class="gallery__nav-button gallery__nav-button--prev">724 <span class="arrow arrow--left arrow--show-always"></span>725 </button>726 <button class="gallery__nav-button gallery__nav-button--next">727 <span class="arrow arrow--right arrow--show-always"></span>728 </button>729 <span class="gallery__counter-box">730 <span class="gallery__counter"></span>/<span class="gallery__sum"></span>731 </span>732 </div>733 <div class="gallery__overlay-tags">734 <ul class="gallery-overlay__list"></ul>735 <!-- important: arrow buttons must be above all other buttons inside gallery__overlay-tags -->736 <button type="button" class="button button--ghost button--ghost-thin button--large button--slideshow button--color-gray " property="url">737 <span class="button__text"></span><span class="arrow arrow--left arrow--show-always"></span>738 </button>739 <button type="button" class="button button--ghost button--ghost-thin button--large button--slideshow button--color-gray " property="url">740 <span class="button__text"></span><span class="arrow arrow--right arrow--show-always"></span>741 </button>742 <button class="gallery-overlay__close" type="button">743 <span class="gallery-overlay__close-text">Luk (esc)</span>744 <span class="gallery-overlay__x"></span>745 </button>746 <span class="gallery-overlay__counter-item">747 <span class="gallery-overlay__count"></span>/<span class="gallery-overlay__sum"></span>748 </span>749 </div>750 </section>751 }752 }753754 @helper DisplayGroups(List<LoopItem> productGroups)755 {756757 foreach (var group in productGroups)758 {759 string image = group.GetString("Ecom:Group.LargeImage").Replace(" ", "%20");760 string productPageId = Pageview.Area.Item.FirstOrDefault(i => i.Key == "ProductPageId").Value.ToString();761 string groupLink = "Default.aspx?ID=" + productPageId + "&GroupID=" + group.GetString("Ecom:Group.ID");762763 if (string.IsNullOrWhiteSpace(image))764 {765 image = "/Files/Images/Ecommerce/Products/no-image.jpeg";766 }767768 <li class="grid-column list-cards-simple__item">769 <article class="card-simple">770 <a href="@groupLink" title="@Translate("Se mulighederne", "Se mulighederne")" class="card-simple__link" property="url">771 <figure vocab="http://schema.org/" typeof="ImageObject" class="image-lazyload__figure">772 <img class="lazyload image-lazyload__image " src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="@group.GetString("Ecom:Group.Name")" property="contentUrl" data-src="@image?mode=crop&width=535&height=535&quality=80"773 data-query-obj='{ "mode":"crop" }' data-srcset="@image?mode=crop&width=431&height=431&quality=80 431w,774 @image?mode=crop&width=360&height=360&quality=80 360w,775 @image?mode=crop&width=294&height=294&quality=80 294w,776 @image?mode=crop&width=220&height=220&quality=80 220w,777 @image?mode=crop&width=727&height=727&quality=80 727w,778 @image?mode=crop&width=535&height=535&quality=80 535w,779 @image?mode=crop&width=424&height=424&quality=80 424w,780 @image?mode=crop&width=280&height=280&quality=80 280w" sizes="(min-width: 1400px) 431px,781 (min-width: 1200px) 360px,782 (min-width: 992px) 294px,783 (min-width: 768px) 220px,784 (min-width: 576px) 727px,785 (min-width: 465px) 535px,786 (min-width: 321px) 424px,787 (min-width: 320px) 280px">788 <noscript><img src="@image?mode=crop&width=535&quality=80" alt="@group.GetString("Ecom:Group.Name")"></noscript>789 </figure>790 <!-- <h3 class="heading heading--col-element">@group.GetString("Ecom:Group.Name")</h3> -->791 <h2 class="heading heading--col-element">@group.GetString("Ecom:Group.Name")</h2>792 <div class="body-text body-text--card-std">793 @group.GetString("Ecom:Group:Field.groupTeaser")794 </div>795 <button class="button button--arrow button--color-puff">796 <span class="button__text">@Translate("Se mulighederne", "Se mulighederne")</span><span class="arrow arrow--right "></span>797 </button>798 </a>799 </article>800 </li>801 }802 }803 @helper DisplayGalleryImage(string image)804 {805806 <li class="gallery__item">807 <a href="@image?width=300" data-gallery="" class="gallery__link">808 <figure vocab="http://schema.org/" typeof="ImageObject" class="image-lazyload__figure image-lazyload__figure--gallery ">809 <img class="lazyload image-lazyload__image lazyload-bg-special image-lazyload__image--gallery" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" property="contentUrl" data-src="@image?mode=crop&width=535&quality=80"810 data-query-obj='{ "mode":"crop" }' data-srcset="@image?mode=crop&width=438&quality=80 438w,811 @image?mode=crop&width=367&quality=80 367w,812 @image?mode=crop&width=300&quality=80 300w,813 @image?mode=crop&width=227&quality=80 227w,814 @image?mode=crop&width=364&quality=80 364w,815 @image?mode=crop&width=535&quality=80 535w,816 @image?mode=crop&width=424&quality=80 424w,817 @image?mode=crop&width=280&quality=80 280w" sizes="(min-width: 1400px) 438px,818 (min-width: 1200px) 367px,819 (min-width: 992px) 300px,820 (min-width: 768px) 227px,821 (min-width: 576px) 364px,822 (min-width: 465px) 535px,823 (min-width: 321px) 424px,824 (min-width: 320px) 280px">825 <noscript><img src="@image?mode=crop&width=535&quality=80"></noscript>826 </figure>827 </a>828 </li>829 }830831 @helper DisplayBOMProductList(Dynamicweb.Ecommerce.Products.Group bomProductList, string productPageId)832 {833 string baseUrl = Pageview.Area.Item.FirstOrDefault(i => i.Key == "Base_Link").Value.ToString();834835 string hidePrices = Pageview.Area.Item["Hide_Prices"].ToString();836837 var prods = bomProductList.Products;838839 var filProds = prods.Where(p => p.Number.Split('-').Last() == "1" || p.ProductFieldValues.GetProductFieldValue("PrimaryBOM").Value.ToString() != "False");840841 var tempProds = filProds.Where(p => bool.Parse(p.ProductFieldValues.GetProductFieldValue("PrimaryBOM").Value.ToString()) == true && p.Number.Split('-').Last() != "1");842843 if (tempProds.Any())844 {845846 foreach (var tP in tempProds)847 {848 var baseID = tP.Number.Split('-');849 string remId = string.Join("-", string.Join("-", baseID.Take(baseID.Length - 1).ToArray()), "1");850 filProds = filProds.Where(p => p.Number != remId);851 }852 }853854 <section class="parts-list-element parts-list-element--3cols">855 <div class="grid-container grid-container--site-width">856 <ul class="grid-row grid-row--three-columns-113333 parts-list-element__list">857858 @foreach (Dynamicweb.Ecommerce.Products.Product bomProduct in filProds)859 {860 var productsNotInStock = new List<Dynamicweb.Ecommerce.Products.Product>();861 string prodId = bomProduct.Id;862 string prodName = bomProduct.Name;863 string prodImage = bomProduct.ImageLarge.Replace(" ", "%20");864865866 if (string.IsNullOrWhiteSpace(prodImage))867 {868 prodImage = "/Files/Images/Ecommerce/Products/no-image.jpeg";869 }870 else871 {872 prodImage = "/files" + prodImage;873 }874 string GID = "";875 // GID = "&groupid=" + bomProduct.DefaultGroup.Id;876 string prodLink = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("default.aspx?id=" + productPageId + GID + "&productId=" + prodId);877 string prodCurrency = bomProduct.Price.Currency.Code;878879880 string BOMMountType = "";881 double BOMMountTypeTotalPrice = 0;882 string BOMProductIdList = "";883 string BOMProductQuantityList = "";884885 BOMMountType = bomProduct.GetProductFieldValue("BOMProductListDefault").ToString();886887 string BOMProductInfoInclusive1 = bomProduct.GetProductFieldValue("BOMProductInfoInclusive1").ToString();888 string BOMProductInfoInclusive2 = bomProduct.GetProductFieldValue("BOMProductInfoInclusive2").ToString();889 string BOMProductInfoInclusive3 = bomProduct.GetProductFieldValue("BOMProductInfoInclusive3").ToString();890891 foreach (var item in bomProduct.Items)892 {893 var bomProd = Dynamicweb.Ecommerce.Products.Product.GetProductById(item.BomProductId);894 if (bomProd.Stock < 1)895 {896 if ((bomProd.GetProductFieldValue("ProductNextBackorderDate") is DateTime && (DateTime)bomProd.GetProductFieldValue("ProductNextBackorderDate") > DateTime.Now) || !(bomProd.GetProductFieldValue("ProductNextBackorderDate") is DateTime))897 {898 productsNotInStock.Add(bomProd);899 }900 }901 if (string.IsNullOrWhiteSpace(BOMProductIdList))902 {903 BOMProductIdList = bomProd.Id;904 }905 else906 {907 BOMProductIdList = BOMProductIdList + "," + bomProd.Id;908 }909 if (string.IsNullOrWhiteSpace(BOMProductQuantityList))910 {911 BOMProductQuantityList = item.Quantity.ToString();912 }913 else914 {915 BOMProductQuantityList = BOMProductQuantityList + "," + item.Quantity;916 }917918 BOMMountTypeTotalPrice = BOMMountTypeTotalPrice + (bomProd.Price.PriceWithoutVAT * item.Quantity);919 }920921922 <li class="grid-column parts-list-element__item">923 <article class="card-parts-list card-parts-list--3cols">924 <div class="card-parts-list__image">925 <a href="@prodLink" title="@prodName" class="" property="url">926 <figure vocab="http://schema.org/" typeof="ImageObject" class="image-lazyload__figure ">927 <img class="lazyload image-lazyload__image " src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="@prodName" property="contentUrl" data-src="@prodImage?mode=crop&width=776&height=776&quality=80"928 data-query-obj='{ "mode":"crop" }' data-srcset="@prodImage?mode=crop&width=431&height=431&quality=80 431w,929 @prodImage?mode=crop&width=360&height=360&quality=80 360w,930 @prodImage?mode=crop&width=294&height=294&quality=80 294w,931 @prodImage?mode=crop&width=220&height=220&quality=80 220w,932 @prodImage?mode=crop&width=776&height=776&quality=80 776w,933 @prodImage?mode=crop&width=540&height=540&quality=80 540w,934 @prodImage?mode=crop&width=280&height=280&quality=80 280w" sizes="(min-width: 1400px) 431px,935 (min-width: 1200px) 360px,936 (min-width: 992px) 294px,937 (min-width: 768px) 220px,938 (min-width: 576px) 776px,939 (min-width: 321px) 540px,940 (min-width: 320px) 280px">941 <noscript><img src="@prodImage?mode=crop&width=776&quality=80" alt="@prodName"></noscript>942 </figure>943 </a>944 </div>945 <div class="card-parts-list__content">946 <button data-overlay-class="overlay-products-added__overlay" data-overlay-url="@(baseUrl + "system/ajax/javascript/add-to-basket-overlay")?products=@BOMProductIdList&quantities=@BOMProductQuantityList" data-overlay-callback="updateCartQuantity" data-overlay-backdrop-class="novi-backdrop--semi" href="#" title="@prodName" class="card-group-element__icon @(productsNotInStock.Any() ? "card-group-element__icon-disabled" : "button--open-overlay")" property="url">947 <svg class="card-parts-list__svg"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/frontend/dist/icons/icons.svg#cart"></use></svg>948 </button>949 <h3 class="heading heading--col-element heading--col-element-parts-list">@prodName</h3>950 <div class="info-and-price info-and-price--3cols ">951 <div class="info-and-price__info">952 <div class="info-and-price__header">@Translate("Bl.a. inklusiv", "Bl.a. inklusiv")</div>953 <ul class="info-list info-list--mobile-compact">954 @if (!string.IsNullOrWhiteSpace(BOMProductInfoInclusive1))955 {956 <li class="info-list__item">@BOMProductInfoInclusive1</li>957 }958 @if (!string.IsNullOrWhiteSpace(BOMProductInfoInclusive2))959 {960 <li class="info-list__item">@BOMProductInfoInclusive2</li>961 }962 @if (!string.IsNullOrWhiteSpace(BOMProductInfoInclusive3))963 {964 <li class="info-list__item">@BOMProductInfoInclusive3</li>965 }966 </ul>967 </div>968 <div class="info-and-price__price">969 @if (hidePrices == "False")970 {971 <div class="price price--group-element">972 <div class="price__header">@Translate("Vejledende pris", "Vejledende pris")</div>973 <span class="price__unit">@prodCurrency </span>974 <span class="price__price">@Math.Round(BOMMountTypeTotalPrice, 2).ToString("N")</span>975 </div>976 }977 <a href="@prodLink" title="" class="button button--cta button--cta-compact" property="url">978 <span class="button__text">@Translate("Vis og tilpas", "Vis og tilpas")</span>979 </a>980 </div>981 </div>982 </div>983 </article>984 </li>985986 }987 </ul>988 </div>989 </section>990 }991992 @helper DisplayProductList(Dynamicweb.Ecommerce.Products.Group productList, string productPageId, List<Dynamicweb.Ecommerce.Products.Product> prodList = null)993 {994995 string baseUrl = Pageview.Area.Item.FirstOrDefault(i => i.Key == "Logo_Link").Value.ToString();996 string hidePrices = Pageview.Area.Item["Hide_Prices"].ToString();997998 var list = new List<Dynamicweb.Ecommerce.Products.Product>();999 if (productList != null)1000 {1001 list = productList.Products.DistinctBy(p => p.Id).ToList();10021003 }1004 if (prodList != null)1005 {1006 list = prodList.DistinctBy(p => p.Id).ToList();1007 }10081009101010111012 <section class="list-group-elements list-group-elements--4cols">1013 <div class="grid-container grid-container--site-width">10141015 <ul class="grid-row grid-row--four-columns-122444 list-group-elements__list">1016 @foreach (var product in list)1017 {1018 bool inStock = product.Stock > 0;1019 object backOrderDateObj = product.GetProductFieldValue("ProductNextBackorderDate");1020 DateTime backOrderDate = backOrderDateObj is DateTime ? (DateTime)backOrderDateObj : DateTime.MinValue;1021 bool hasBackOrderDateGTToday = backOrderDate > DateTime.Now;1022 string prodId = product.Id;1023 string prodName = product.Name;1024 string prodImage = product.ImageLarge.Replace(" ", "%20");102510261027 if (string.IsNullOrWhiteSpace(prodImage))1028 {1029 prodImage = "/Files/Images/Ecommerce/Products/no-image.jpeg";1030 }1031 else1032 {1033 prodImage = "/files" + prodImage;1034 }10351036 string prodDesc = string.Empty; /*product.ShortDescription;*/1037 string prodRawLink = "";1038 string GId = "";1039 /*1040 if(product.DefaultGroup != null)1041 {1042 GId = "&groupid=" + product.DefaultGroup.Id;1043 }1044 else if (product.Groups.Count > 0)1045 {1046 GId = "&groupid=" + product.Groups.First().Id;1047 }1048 */1049 string prodLink = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("default.aspx?id=" + productPageId + GId + "&productId=" + prodId);1050 string prodPrice = product.Price.PriceWithoutVATFormattedNoSymbol;1051 string prodCurrency = product.Price.Currency.Code;1052 string height = product.GetProductFieldValue("Height").ToString();1053 string width = product.GetProductFieldValue("Width").ToString();1054 string length = product.GetProductFieldValue("Length").ToString();1055 string color = product.GetProductFieldValue("Color").ToString();105610571058 <li class="grid-column list-group-elements__item">1059 <article class="card-group-element">1060 <div class="card-group-element__image">1061 <a href="@prodLink" data-test="@prodRawLink" title="@prodName" class="card-group-element__link" property="url">1062 <figure vocab="http://schema.org/" typeof="ImageObject" class="image-lazyload__figure ">1063 <img class="lazyload image-lazyload__image " src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="@prodName" property="contentUrl" data-src="@prodImage?mode=crop&width=535&height=535&quality=80"1064 data-query-obj='{ "mode":"crop" }' data-srcset="@prodImage?mode=crop&width=316&height=316&quality=80 316w,1065 @prodImage?mode=crop&width=263&height=263&quality=80 263w,1066 @prodImage?mode=crop&width=213&height=213&quality=80 213w,1067 @prodImage?mode=crop&width=345&height=345&quality=80 345w,1068 @prodImage?mode=crop&width=345&height=345&quality=80 345w,1069 @prodImage?mode=crop&width=535&height=535&quality=80 535w,1070 @prodImage?mode=crop&width=424&height=424&quality=80 424w,1071 @prodImage?mode=crop&width=280&height=280&quality=80 280w" sizes="(min-width: 1400px) 316px,1072 (min-width: 1200px) 263px,1073 (min-width: 992px) 213px,1074 (min-width: 768px) 345px,1075 (min-width: 576px) 345px,1076 (min-width: 465px) 535px,1077 (min-width: 321px) 424px,1078 (min-width: 320px) 280px">1079 <noscript><img src="@prodImage?mode=crop&width=535&quality=80" alt="@prodName"></noscript>1080 </figure>1081 </a>1082 </div>1083 <div class="card-group-element__content">1084 <button data-overlay-class="overlay-products-added__overlay" data-overlay-callback="updateCartQuantity" data-overlay-url="@(baseUrl + "system/ajax/javascript/add-to-basket-overlay")?products=@prodId&quantities=1" data-overlay-backdrop-class="novi-backdrop--semi" href="#" title="@prodName" class="card-group-element__icon @(!inStock && !hasBackOrderDateGTToday ? "card-group-element__icon-disabled" : "button--open-overlay")" property="url">1085 <svg class="card-group-element__svg"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/frontend/dist/icons/icons.svg#cart"></use></svg>1086 </button>1087 <a href="@prodLink" title="@prodName" class="card-group-element__link" property="url">1088 <h3 class="heading heading--col-element heading--col-element-group-element">@prodName</h3>1089 <div class="item-number item-number--group-element">@Translate("Varenummer", "Varenummer"): @prodId</div>1090 @if (!string.IsNullOrWhiteSpace(width))1091 {1092 <div class="item-number item-number--group-element">@Translate("Bredde", "Bredde"): @width cm</div>1093 }1094 @if (!string.IsNullOrWhiteSpace(height))1095 {1096 <div class="item-number item-number--group-element">@Translate("Højde", "Højde"): @height cm</div>1097 }1098 <!-- moved up before height - jgn 23/7-191099 @if (!string.IsNullOrWhiteSpace(width))1100 {1101 <div class="item-number item-number--group-element">@Translate("Bredde", "Bredde"): @width cm</div>1102 }1103 -->1104 @if (!string.IsNullOrWhiteSpace(length))1105 {1106 <div class="item-number item-number--group-element">@Translate("Længde", "Længde"): @length cm</div>1107 }1108 @if (!string.IsNullOrWhiteSpace(color))1109 {1110 <div class="item-number item-number--group-element">@Translate("Farve", "Farve"): @color</div>1111 }1112 </a>1113 <div class="info-and-price info-and-price--group-element">1114 <div class="info-and-price__info">1115 @prodDesc1116 </div>1117 <div class="info-and-price__price">1118 @if (hidePrices == "False")1119 {1120 <div class="price price--group-element">1121 <div class="price__header">@Translate("Vejledende pris", "Vejledende pris")</div>1122 <span class="price__unit">@prodCurrency </span>1123 <span class="price__price">@prodPrice</span>1124 </div>1125 }1126 <a href="@prodLink" title="" class="button button--group-element" property="url">1127 <span class="button__text">@Translate("Se detaljer", "Se detaljer")</span>1128 </a>1129 </div>1130 </div>1131 </div>1132 </article>1133 </li>1134 }1135 </ul>1136 </div>1137 </section>11381139 }