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_4566fa4b64f9457499b9bb68aafb9797.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 }488 //Gallery489 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")))490 {491 <section class="gallery">492 <div class="grid-container grid-container--site-width">493 <ul class="gallery__list" id="gallery">494 @{495 if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image1.Clean")))496 {497 @DisplayGalleryImage(GetString("Ecom:Group:Field.Image1.Clean"))498 }499 if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image2.Clean")))500 {501 @DisplayGalleryImage(GetString("Ecom:Group:Field.Image2.Clean"))502503 }504 if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image3.Clean")))505 {506 @DisplayGalleryImage(GetString("Ecom:Group:Field.Image3.Clean"))507508 }509 if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image4.Clean")))510 {511 @DisplayGalleryImage(GetString("Ecom:Group:Field.Image4.Clean"))512513 }514 if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image5.Clean")))515 {516 @DisplayGalleryImage(GetString("Ecom:Group:Field.Image5.Clean"))517518 }519 if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image6.Clean")))520 {521 @DisplayGalleryImage(GetString("Ecom:Group:Field.Image6.Clean"))522523 }524 if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image7.Clean")))525 {526 @DisplayGalleryImage(GetString("Ecom:Group:Field.Image7.Clean"))527528 }529 if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image8.Clean")))530 {531 @DisplayGalleryImage(GetString("Ecom:Group:Field.Image8.Clean"))532533 }534 if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image9.Clean")))535 {536 @DisplayGalleryImage(GetString("Ecom:Group:Field.Image9.Clean"))537538 }539 if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image10.Clean")))540 {541 @DisplayGalleryImage(GetString("Ecom:Group:Field.Image10.Clean"))542543 }544 if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image11.Clean")))545 {546 @DisplayGalleryImage(GetString("Ecom:Group:Field.Image11.Clean"))547 }548 }549 </ul>550 <button class="gallery__nav-button gallery__nav-button--prev">551 <span class="arrow arrow--left arrow--show-always"></span>552 </button>553 <button class="gallery__nav-button gallery__nav-button--next">554 <span class="arrow arrow--right arrow--show-always"></span>555 </button>556 <span class="gallery__counter-box">557 <span class="gallery__counter"></span>/<span class="gallery__sum"></span>558 </span>559 </div>560 <div class="gallery__overlay-tags">561 <ul class="gallery-overlay__list"></ul>562 <!-- important: arrow buttons must be above all other buttons inside gallery__overlay-tags -->563 <button type="button" class="button button--ghost button--ghost-thin button--large button--slideshow button--color-gray " property="url">564 <span class="button__text"></span><span class="arrow arrow--left arrow--show-always"></span>565 </button>566 <button type="button" class="button button--ghost button--ghost-thin button--large button--slideshow button--color-gray " property="url">567 <span class="button__text"></span><span class="arrow arrow--right arrow--show-always"></span>568 </button>569 <button class="gallery-overlay__close" type="button">570 <span class="gallery-overlay__close-text">Luk (esc)</span>571 <span class="gallery-overlay__x"></span>572 </button>573 <span class="gallery-overlay__counter-item">574 <span class="gallery-overlay__count"></span>/<span class="gallery-overlay__sum"></span>575 </span>576 </div>577 </section>578 }579 //Description580 <section class="text-text-facts">581 <div class="grid-container grid-container--site-width">582 <div class="grid-row grid-row--three-columns-122333 ">583 <div class="grid-column ">584 <h3 class="heading heading--fw-element">@GetString("Ecom:Group:Field.groupDescriptionHeaderColumn1")</h3>585 <div class="body-text ">586 @GetString("Ecom:Group:Field.groupDescriptionTextColumn1")587 </div>588 </div>589 <div class="grid-column grid-column--2">590 <div class="grid-row grid-row--two-columns-111222 grid-column--2">591 <div class="grid-column ">592 <div class="text-text-facts__small-content">593 <h4 class="heading heading--small heading--small-text-col2">@GetString("Ecom:Group:Field.groupDescriptionHeaderColumn2")</h4>594 <div class="body-text body-text--text-col2">595 @GetString("Ecom:Group:Field.groupDescriptionTextColumn2")596 </div>597 </div>598 </div>599 <div class="grid-column ">600 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:Group:Field.groupDescriptionFactboxColumn3")))601 {602 <div class="facts-box ">603 <div class="body-text body-text--facts-box">604 @GetString("Ecom:Group:Field.groupDescriptionFactboxColumn3")605 </div>606 </div>607 }608 </div>609 </div>610 </div>611 </div>612 </div>613 </section>614 <section class="divider ">615 <span class="divider__icon">616 <svg class="divider__svg"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/frontend/dist/icons/icons.svg#logo"></use></svg>617 </span>618 </section>619620621622623624 foreach (var subgroups in GetLoop("Subgroups").Where(sg => sg.GetString("Ecom:Group:Field.categoryType") == "BOMProducts"))625 {626 //BOM products627628 if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.BOMListHeader")))629 {630 <section class="grid-sub-header ">631 <div class="grid-container grid-container--site-width">632633 <div class="grid-row ">634 <div class="grid-column ">635 <div class="grid-sub-header__content">636 <h2 class="heading heading--sub heading--centered">@GetString("Ecom:Group:Field.BOMListHeader")</h2>637 <p class="teaser teaser--centered">@GetString("Ecom:Group:Field.BOMListText")</p>638 </div>639 </div>640641 </div>642643 </div>644 </section>645 }646647648 var bomProductList = Dynamicweb.Ecommerce.Products.Group.GetGroupById(subgroups.GetString("Ecom:Group.ID"));649 @DisplayBOMProductList(bomProductList, productPageId)650651 <section class="divider ">652 <span class="divider__icon">653 <svg class="divider__svg"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/frontend/dist/icons/icons.svg#logo"></use></svg>654 </span>655 </section>656657 }658659 //Products660 //var productList = Dynamicweb.Ecommerce.Products.Group.GetGroupById(GetString("Ecom:Group.ID"));661 Dynamicweb.Ecommerce.Products.GroupService g = new Dynamicweb.Ecommerce.Products.GroupService();662 var productList = g.GetGroup(GetString("Ecom:Group.ID"));663664 if (productList.Products.Count() > 0)665 {666 if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.ProductListHeader")))667 {668 <a name="products" id="products"></a>669 <section class="grid-sub-header ">670 <div class="grid-container grid-container--site-width">671 <div class="grid-row ">672 <div class="grid-column ">673 <div class="grid-sub-header__content">674 <h2 class="heading heading--sub heading--centered">@GetString("Ecom:Group:Field.ProductListHeader")</h2>675 <p class="teaser teaser--centered">@GetString("Ecom:Group:Field.ProductListText")</p>676 </div>677 </div>678 </div>679 </div>680 </section>681 }682 @DisplayProductList(productList, productPageId)683 }684685686 // Subgroups - minus BOM687688 foreach (var subgroups in GetLoop("Subgroups").Where(sg => sg.GetString("Ecom:Group:Field.categoryType") != "BOMProducts"))689 {690691 if (!String.IsNullOrEmpty(subgroups.GetString("Ecom:Group:Field.groupHeader")))692 {693 <section class="grid-sub-header ">694 <div class="grid-container grid-container--site-width">695 <div class="grid-row ">696 <div class="grid-column ">697 <div class="grid-sub-header__content">698 <h2 class="heading heading--sub heading--centered">@subgroups.GetString("Ecom:Group:Field.groupHeader")</h2>699 <p class="teaser teaser--centered">@subgroups.GetString("Ecom:Group:Field.ProductListText")</p>700 </div>701 </div>702 </div>703 </div>704 </section>705706 var subProductList = Dynamicweb.Ecommerce.Products.Group.GetGroupById(subgroups.GetString("Ecom:Group.ID"));707 @DisplayProductList(subProductList, productPageId)708709 <section class="divider ">710 <span class="divider__icon">711 <svg class="divider__svg"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/frontend/dist/icons/icons.svg#logo"></use></svg>712 </span>713 </section>714 }715 }716717718719 //Accessories720721 var accessoriesList = new List<Dynamicweb.Ecommerce.Products.Product>();722 var tempList = new List<string>();723 foreach (var p in productList.Products)724 {725 tempList.AddRange(p.RelatedProducts().Where(rp => rp.RelatedGroupId == "Addon").Select(pr => pr.Product.Id).ToList());726 }727 accessoriesList = Dynamicweb.Ecommerce.Products.Product.GetProductsByProductIDs(tempList.ToArray(), false, Pageview.Area.EcomLanguageId).ToList();728 // accessoriesList = accessoriesList.ToList();729 if (accessoriesList.Count > 0)730 {731 if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.AccessoriesListHeader")))732 {733 <a name="accessories" id="accessories"></a>734 <section class="grid-sub-header ">735 <div class="grid-container grid-container--site-width">736 <div class="grid-row ">737 <div class="grid-column ">738 <div class="grid-sub-header__content">739 <h2 class="heading heading--sub heading--centered">@GetString("Ecom:Group:Field.AccessoriesListHeader")</h2>740 <p class="teaser teaser--centered">@GetString("Ecom:Group:Field.AccessoriesListText")</p>741 </div>742 </div>743 </div>744 </div>745 </section>746 }747748 @DisplayProductList(null, productPageId, accessoriesList)749750 }751 }752753 @helper DisplayGroups(List<LoopItem> productGroups)754 {755756 foreach (var group in productGroups)757 {758 string image = group.GetString("Ecom:Group.LargeImage").Replace(" ", "%20");759 string productPageId = Pageview.Area.Item.FirstOrDefault(i => i.Key == "ProductPageId").Value.ToString();760 string groupLink = "Default.aspx?ID=" + productPageId + "&GroupID=" + group.GetString("Ecom:Group.ID");761762 if (string.IsNullOrWhiteSpace(image))763 {764 image = "/Files/Images/Ecommerce/Products/no-image.jpeg";765 }766767 <li class="grid-column list-cards-simple__item">768 <article class="card-simple">769 <a href="@groupLink" title="@Translate("Se mulighederne", "Se mulighederne")" class="card-simple__link" property="url">770 <figure vocab="http://schema.org/" typeof="ImageObject" class="image-lazyload__figure">771 <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"772 data-query-obj='{ "mode":"crop" }' data-srcset="@image?mode=crop&width=431&height=431&quality=80 431w,773 @image?mode=crop&width=360&height=360&quality=80 360w,774 @image?mode=crop&width=294&height=294&quality=80 294w,775 @image?mode=crop&width=220&height=220&quality=80 220w,776 @image?mode=crop&width=727&height=727&quality=80 727w,777 @image?mode=crop&width=535&height=535&quality=80 535w,778 @image?mode=crop&width=424&height=424&quality=80 424w,779 @image?mode=crop&width=280&height=280&quality=80 280w" sizes="(min-width: 1400px) 431px,780 (min-width: 1200px) 360px,781 (min-width: 992px) 294px,782 (min-width: 768px) 220px,783 (min-width: 576px) 727px,784 (min-width: 465px) 535px,785 (min-width: 321px) 424px,786 (min-width: 320px) 280px">787 <noscript><img src="@image?mode=crop&width=535&quality=80" alt="@group.GetString("Ecom:Group.Name")"></noscript>788 </figure>789 <!-- <h3 class="heading heading--col-element">@group.GetString("Ecom:Group.Name")</h3> -->790 <h2 class="heading heading--col-element">@group.GetString("Ecom:Group.Name")</h2>791 <div class="body-text body-text--card-std">792 @group.GetString("Ecom:Group:Field.groupTeaser")793 </div>794 <button class="button button--arrow button--color-puff">795 <span class="button__text">@Translate("Se mulighederne", "Se mulighederne")</span><span class="arrow arrow--right "></span>796 </button>797 </a>798 </article>799 </li>800 }801 }802 @helper DisplayGalleryImage(string image)803 {804805 <li class="gallery__item">806 <a href="@image?width=300" data-gallery="" class="gallery__link">807 <figure vocab="http://schema.org/" typeof="ImageObject" class="image-lazyload__figure image-lazyload__figure--gallery ">808 <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"809 data-query-obj='{ "mode":"crop" }' data-srcset="@image?mode=crop&width=438&quality=80 438w,810 @image?mode=crop&width=367&quality=80 367w,811 @image?mode=crop&width=300&quality=80 300w,812 @image?mode=crop&width=227&quality=80 227w,813 @image?mode=crop&width=364&quality=80 364w,814 @image?mode=crop&width=535&quality=80 535w,815 @image?mode=crop&width=424&quality=80 424w,816 @image?mode=crop&width=280&quality=80 280w" sizes="(min-width: 1400px) 438px,817 (min-width: 1200px) 367px,818 (min-width: 992px) 300px,819 (min-width: 768px) 227px,820 (min-width: 576px) 364px,821 (min-width: 465px) 535px,822 (min-width: 321px) 424px,823 (min-width: 320px) 280px">824 <noscript><img src="@image?mode=crop&width=535&quality=80"></noscript>825 </figure>826 </a>827 </li>828 }829830 @helper DisplayBOMProductList(Dynamicweb.Ecommerce.Products.Group bomProductList, string productPageId)831 {832 string baseUrl = Pageview.Area.Item.FirstOrDefault(i => i.Key == "Base_Link").Value.ToString();833834 string hidePrices = Pageview.Area.Item["Hide_Prices"].ToString();835836 var prods = bomProductList.Products;837838 var filProds = prods.Where(p => p.Number.Split('-').Last() == "1" || p.ProductFieldValues.GetProductFieldValue("PrimaryBOM").Value.ToString() != "False");839840 var tempProds = filProds.Where(p => bool.Parse(p.ProductFieldValues.GetProductFieldValue("PrimaryBOM").Value.ToString()) == true && p.Number.Split('-').Last() != "1");841842 if (tempProds.Any())843 {844845 foreach (var tP in tempProds)846 {847 var baseID = tP.Number.Split('-');848 string remId = string.Join("-", string.Join("-", baseID.Take(baseID.Length - 1).ToArray()), "1");849 filProds = filProds.Where(p => p.Number != remId);850 }851 }852853 <section class="parts-list-element parts-list-element--3cols">854 <div class="grid-container grid-container--site-width">855 <ul class="grid-row grid-row--three-columns-113333 parts-list-element__list">856857 @foreach (Dynamicweb.Ecommerce.Products.Product bomProduct in filProds)858 {859 var productsNotInStock = new List<Dynamicweb.Ecommerce.Products.Product>();860 string prodId = bomProduct.Id;861 string prodName = bomProduct.Name;862 string prodImage = bomProduct.ImageLarge.Replace(" ", "%20");863864865 if (string.IsNullOrWhiteSpace(prodImage))866 {867 prodImage = "/Files/Images/Ecommerce/Products/no-image.jpeg";868 }869 else870 {871 prodImage = "/files" + prodImage;872 }873 string GID = "";874 // GID = "&groupid=" + bomProduct.DefaultGroup.Id;875 string prodLink = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("default.aspx?id=" + productPageId + GID + "&productId=" + prodId);876 string prodCurrency = bomProduct.Price.Currency.Code;877878879 string BOMMountType = "";880 double BOMMountTypeTotalPrice = 0;881 string BOMProductIdList = "";882 string BOMProductQuantityList = "";883884 BOMMountType = bomProduct.GetProductFieldValue("BOMProductListDefault").ToString();885886 string BOMProductInfoInclusive1 = bomProduct.GetProductFieldValue("BOMProductInfoInclusive1").ToString();887 string BOMProductInfoInclusive2 = bomProduct.GetProductFieldValue("BOMProductInfoInclusive2").ToString();888 string BOMProductInfoInclusive3 = bomProduct.GetProductFieldValue("BOMProductInfoInclusive3").ToString();889890 foreach (var item in bomProduct.Items)891 {892 var bomProd = Dynamicweb.Ecommerce.Products.Product.GetProductById(item.BomProductId);893 if (bomProd.Stock < 1)894 {895 if ((bomProd.GetProductFieldValue("ProductNextBackorderDate") is DateTime && (DateTime)bomProd.GetProductFieldValue("ProductNextBackorderDate") > DateTime.Now) || !(bomProd.GetProductFieldValue("ProductNextBackorderDate") is DateTime))896 {897 productsNotInStock.Add(bomProd);898 }899 }900 if (string.IsNullOrWhiteSpace(BOMProductIdList))901 {902 BOMProductIdList = bomProd.Id;903 }904 else905 {906 BOMProductIdList = BOMProductIdList + "," + bomProd.Id;907 }908 if (string.IsNullOrWhiteSpace(BOMProductQuantityList))909 {910 BOMProductQuantityList = item.Quantity.ToString();911 }912 else913 {914 BOMProductQuantityList = BOMProductQuantityList + "," + item.Quantity;915 }916917 BOMMountTypeTotalPrice = BOMMountTypeTotalPrice + (bomProd.Price.PriceWithoutVAT * item.Quantity);918 }919920921 <li class="grid-column parts-list-element__item">922 <article class="card-parts-list card-parts-list--3cols">923 <div class="card-parts-list__image">924 <a href="@prodLink" title="@prodName" class="" property="url">925 <figure vocab="http://schema.org/" typeof="ImageObject" class="image-lazyload__figure ">926 <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"927 data-query-obj='{ "mode":"crop" }' data-srcset="@prodImage?mode=crop&width=431&height=431&quality=80 431w,928 @prodImage?mode=crop&width=360&height=360&quality=80 360w,929 @prodImage?mode=crop&width=294&height=294&quality=80 294w,930 @prodImage?mode=crop&width=220&height=220&quality=80 220w,931 @prodImage?mode=crop&width=776&height=776&quality=80 776w,932 @prodImage?mode=crop&width=540&height=540&quality=80 540w,933 @prodImage?mode=crop&width=280&height=280&quality=80 280w" sizes="(min-width: 1400px) 431px,934 (min-width: 1200px) 360px,935 (min-width: 992px) 294px,936 (min-width: 768px) 220px,937 (min-width: 576px) 776px,938 (min-width: 321px) 540px,939 (min-width: 320px) 280px">940 <noscript><img src="@prodImage?mode=crop&width=776&quality=80" alt="@prodName"></noscript>941 </figure>942 </a>943 </div>944 <div class="card-parts-list__content">945 <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">946 <svg class="card-parts-list__svg"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/frontend/dist/icons/icons.svg#heart"></use></svg>947 </button>948 <h3 class="heading heading--col-element heading--col-element-parts-list">@prodName</h3>949 <div class="info-and-price info-and-price--3cols ">950 <div class="info-and-price__info">951 <div class="info-and-price__header">@Translate("Bl.a. inklusiv", "Bl.a. inklusiv")</div>952 <ul class="info-list info-list--mobile-compact">953 @if (!string.IsNullOrWhiteSpace(BOMProductInfoInclusive1))954 {955 <li class="info-list__item">@BOMProductInfoInclusive1</li>956 }957 @if (!string.IsNullOrWhiteSpace(BOMProductInfoInclusive2))958 {959 <li class="info-list__item">@BOMProductInfoInclusive2</li>960 }961 @if (!string.IsNullOrWhiteSpace(BOMProductInfoInclusive3))962 {963 <li class="info-list__item">@BOMProductInfoInclusive3</li>964 }965 </ul>966 </div>967 <div class="info-and-price__price">968 @if (hidePrices == "False")969 {970 <div class="price price--group-element">971 <div class="price__header">@Translate("Vejledende pris", "Vejledende pris")</div>972 <span class="price__unit">@prodCurrency </span>973 <span class="price__price">@Math.Round(BOMMountTypeTotalPrice, 2).ToString("N")</span>974 </div>975 }976 <a href="@prodLink" title="" class="button button--cta button--cta-compact" property="url">977 <span class="button__text">@Translate("Vis og tilpas", "Vis og tilpas")</span>978 </a>979 </div>980 </div>981 </div>982 </article>983 </li>984985 }986 </ul>987 </div>988 </section>989 }990991 @helper DisplayProductList(Dynamicweb.Ecommerce.Products.Group productList, string productPageId, List<Dynamicweb.Ecommerce.Products.Product> prodList = null)992 {993994 string baseUrl = Pageview.Area.Item.FirstOrDefault(i => i.Key == "Logo_Link").Value.ToString();995 string hidePrices = Pageview.Area.Item["Hide_Prices"].ToString();996997 var list = new List<Dynamicweb.Ecommerce.Products.Product>();998 if (productList != null)999 {1000 list = productList.Products.DistinctBy(p => p.Id).ToList();10011002 }1003 if (prodList != null)1004 {1005 list = prodList.DistinctBy(p => p.Id).ToList();1006 }10071008100910101011 <section class="list-group-elements list-group-elements--4cols">1012 <div class="grid-container grid-container--site-width">10131014 <ul class="grid-row grid-row--four-columns-122444 list-group-elements__list">1015 @foreach (var product in list)1016 {1017 bool inStock = product.Stock > 0;1018 var backOrderDate = product.GetProductFieldValue("ProductNextBackorderDate");1019 bool hasBackOrderDateGTToday = backOrderDate != null && (backOrderDate is DateTime ? (DateTime)backOrderDate : DateTime.MinValue) > DateTime.Now;1020 string prodId = product.Id;1021 string prodName = product.Name;1022 string prodImage = product.ImageLarge.Replace(" ", "%20");102310241025 if (string.IsNullOrWhiteSpace(prodImage))1026 {1027 prodImage = "/Files/Images/Ecommerce/Products/no-image.jpeg";1028 }1029 else1030 {1031 prodImage = "/files" + prodImage;1032 }10331034 string prodDesc = string.Empty; /*product.ShortDescription;*/1035 string prodRawLink = "";1036 string GId = "";1037 /*1038 if(product.DefaultGroup != null)1039 {1040 GId = "&groupid=" + product.DefaultGroup.Id;1041 }1042 else if (product.Groups.Count > 0)1043 {1044 GId = "&groupid=" + product.Groups.First().Id;1045 }1046 */1047 string prodLink = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("default.aspx?id=" + productPageId + GId + "&productId=" + prodId);1048 string prodPrice = product.Price.PriceWithoutVATFormattedNoSymbol;1049 string prodCurrency = product.Price.Currency.Code;1050 string height = product.GetProductFieldValue("Height").ToString();1051 string width = product.GetProductFieldValue("Width").ToString();1052 string length = product.GetProductFieldValue("Length").ToString();1053 string color = product.GetProductFieldValue("Color").ToString();105410551056 <li class="grid-column list-group-elements__item">1057 <article class="card-group-element">1058 <div class="card-group-element__image">1059 <a href="@prodLink" data-test="@prodRawLink" title="@prodName" class="card-group-element__link" property="url">1060 <figure vocab="http://schema.org/" typeof="ImageObject" class="image-lazyload__figure ">1061 <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"1062 data-query-obj='{ "mode":"crop" }' data-srcset="@prodImage?mode=crop&width=316&height=316&quality=80 316w,1063 @prodImage?mode=crop&width=263&height=263&quality=80 263w,1064 @prodImage?mode=crop&width=213&height=213&quality=80 213w,1065 @prodImage?mode=crop&width=345&height=345&quality=80 345w,1066 @prodImage?mode=crop&width=345&height=345&quality=80 345w,1067 @prodImage?mode=crop&width=535&height=535&quality=80 535w,1068 @prodImage?mode=crop&width=424&height=424&quality=80 424w,1069 @prodImage?mode=crop&width=280&height=280&quality=80 280w" sizes="(min-width: 1400px) 316px,1070 (min-width: 1200px) 263px,1071 (min-width: 992px) 213px,1072 (min-width: 768px) 345px,1073 (min-width: 576px) 345px,1074 (min-width: 465px) 535px,1075 (min-width: 321px) 424px,1076 (min-width: 320px) 280px">1077 <noscript><img src="@prodImage?mode=crop&width=535&quality=80" alt="@prodName"></noscript>1078 </figure>1079 </a>1080 </div>1081 <div class="card-group-element__content">1082 <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 || backOrderDate == null) ? "card-group-element__icon-disabled" : "button--open-overlay")" property="url">1083 <svg class="card-group-element__svg"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/frontend/dist/icons/icons.svg#heart"></use></svg>1084 </button>1085 <a href="@prodLink" title="@prodName" class="card-group-element__link" property="url">1086 <h3 class="heading heading--col-element heading--col-element-group-element">@prodName</h3>1087 <div class="item-number item-number--group-element">@Translate("Varenummer", "Varenummer"): @prodId</div>1088 @if (!string.IsNullOrWhiteSpace(width))1089 {1090 <div class="item-number item-number--group-element">@Translate("Bredde", "Bredde"): @width cm</div>1091 }1092 @if (!string.IsNullOrWhiteSpace(height))1093 {1094 <div class="item-number item-number--group-element">@Translate("Højde", "Højde"): @height cm</div>1095 }1096 <!-- moved up before height - jgn 23/7-191097 @if (!string.IsNullOrWhiteSpace(width))1098 {1099 <div class="item-number item-number--group-element">@Translate("Bredde", "Bredde"): @width cm</div>1100 }1101 -->1102 @if (!string.IsNullOrWhiteSpace(length))1103 {1104 <div class="item-number item-number--group-element">@Translate("Længde", "Længde"): @length cm</div>1105 }1106 @if (!string.IsNullOrWhiteSpace(color))1107 {1108 <div class="item-number item-number--group-element">@Translate("Farve", "Farve"): @color</div>1109 }1110 </a>1111 <div class="info-and-price info-and-price--group-element">1112 <div class="info-and-price__info">1113 @prodDesc1114 </div>1115 <div class="info-and-price__price">1116 @if (hidePrices == "False")1117 {1118 <div class="price price--group-element">1119 <div class="price__header">@Translate("Vejledende pris", "Vejledende pris")</div>1120 <span class="price__unit">@prodCurrency </span>1121 <span class="price__price">@prodPrice</span>1122 </div>1123 }1124 <a href="@prodLink" title="" class="button button--group-element" property="url">1125 <span class="button__text">@Translate("Se detaljer", "Se detaljer")</span>1126 </a>1127 </div>1128 </div>1129 </div>1130 </article>1131 </li>1132 }1133 </ul>1134 </div>1135 </section>11361137 }