Error executing template "Designs/Dwsimple/eCom/Productlist/SearchResultList.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at Hounisen.Website.Helpers.GroupHelper.GetParentsRecursively(Group group, List`1 groupNames)
   at CompiledRazorTemplates.Dynamic.RazorEngine_e3ca6bdff1614bebab35e7ee2d1c0770.<>c__DisplayClass1_0.b__0(TextWriter __razor_helper_writer) in E:\Dynamicweb\hounisen\Files\Templates\Designs\Dwsimple\eCom\Productlist\SearchResultList.cshtml:line 204
   at CompiledRazorTemplates.Dynamic.RazorEngine_e3ca6bdff1614bebab35e7ee2d1c0770.Execute() in E:\Dynamicweb\hounisen\Files\Templates\Designs\Dwsimple\eCom\Productlist\SearchResultList.cshtml:line 1172
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @using VestjyskMarketing.Models 2 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 3 4 @using System.Globalization 5 @using Dynamicweb.Content 6 @using Dynamicweb.Ecommerce.Products 7 @using Dynamicweb.Security.UserManagement 8 @using Hounisen.Website.Helpers 9 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 10 11 @using System.Text.RegularExpressions 12 @using System.Web 13 14 15 @functions{ 16 public class WrapMethods 17 { 18 //Gets the contrasting color 19 public static string getContrastYIQ(string hexcolor) 20 { 21 if (hexcolor != "") 22 { 23 hexcolor = Regex.Replace(hexcolor, "[^0-9a-zA-Z]+", ""); 24 25 int r = Convert.ToByte(hexcolor.Substring(0, 2), 16); 26 int g = Convert.ToByte(hexcolor.Substring(2, 2), 16); 27 int b = Convert.ToByte(hexcolor.Substring(4, 2), 16); 28 int yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000; 29 30 if (yiq >= 128) 31 { 32 return "black"; 33 } 34 else 35 { 36 return "white"; 37 } 38 } 39 else 40 { 41 return "black"; 42 } 43 } 44 45 46 //Truncate text 47 public static string Truncate (string value, int count, bool strip=true) 48 { 49 if (strip == true){ 50 value = StripHtmlTagByCharArray(value); 51 } 52 53 if (value.Length > count) 54 { 55 value = value.Substring(0, count - 1) + "..."; 56 } 57 58 return value; 59 } 60 61 62 //Strip text from HTML 63 public static string StripHtmlTagByCharArray(string htmlString) 64 { 65 char[] array = new char[htmlString.Length]; 66 int arrayIndex = 0; 67 bool inside = false; 68 69 for (int i = 0; i < htmlString.Length; i++) 70 { 71 char let = htmlString[i]; 72 if (let == '<') 73 { 74 inside = true; 75 continue; 76 } 77 if (let == '>') 78 { 79 inside = false; 80 continue; 81 } 82 if (!inside) 83 { 84 array[arrayIndex] = let; 85 arrayIndex++; 86 } 87 } 88 return new string(array, 0, arrayIndex); 89 } 90 91 //Make the correct count of columns 92 public static string ColumnMaker(int Col, string ScreenSize) 93 { 94 string Columns = ""; 95 96 switch (Col) 97 { 98 case 1: 99 Columns = "col-"+ScreenSize+"-12"; 100 break; 101 102 case 2: 103 Columns = "col-"+ScreenSize+"-6"; 104 break; 105 106 case 3: 107 Columns = "col-"+ScreenSize+"-4"; 108 break; 109 110 case 4: 111 Columns = "col-"+ScreenSize+"-3"; 112 break; 113 114 default: 115 Columns = "col-"+ScreenSize+"-3"; 116 break; 117 } 118 119 return Columns; 120 } 121 122 123 private string Custom(string firstoption, string secondoption) 124 { 125 if (firstoption == "custom") 126 { 127 return secondoption; 128 } 129 else 130 { 131 return firstoption; 132 } 133 } 134 } 135 } 136 137 138 139 140 141 142 @helper GetProductList(dynamic Loop, int ColMD = 3, int ColSM = 3, int ColXS = 1) 143 { 144 int Count = 0; 145 146 int index = 1; 147 148 var embeddedScript = GetString("Ecom:Group:Field.ProductEmbeddedScript"); 149 var embedIndex = GetInteger("Ecom:Group:Field.EmbedScriptStartingIndex"); 150 151 IFormatProvider jsNumberFormat = new NumberFormatInfo() { NumberDecimalSeparator = ".", NumberGroupSeparator = "" }; 152 153 154 var groupService = new GroupService(); 155 var productService = new ProductService(); 156 var pageService = new PageService(); 157 158 // SKI AND Region H 159 bool hasSkiDeal = false; 160 bool hasRegionHDeal = false; 161 var currentUser = User.GetCurrentExtranetUser(); 162 if (currentUser != null) 163 { 164 var skiGroup = currentUser.Groups.FirstOrDefault(e => e.Name == "SKI"); 165 if (skiGroup != null && !string.IsNullOrEmpty(skiGroup.Name)) 166 { 167 hasSkiDeal = true; 168 } 169 170 hasRegionHDeal = Dynamicweb.Core.Converter.ToBoolean(currentUser.CustomFieldValues.Find(f => f.CustomField.SystemName == "AccessUser_RegionH").Value); 171 } 172 173 174 foreach (LoopItem product in Loop) 175 { 176 string GroupLink = "/Default.aspx?ID=" + product.GetString("Ecom:Product.PrimaryOrCurrentPageID") + "&groupid=" + product.GetString("Ecom:Product.PrimaryOrFirstGroupID") + "&productid=" + product.GetString("Ecom:Product.ID"); 177 // string GroupLink = product.GetString("Ecom:Product.LinkGroup.Clean"); 178 int stock = product.GetInteger("Ecom:Product.Stock"); 179 string Name = product.GetString("Ecom:Product.Name"); 180 string Description = product.GetString("Ecom:Product.ShortDescription"); 181 string prodID = product.GetString("Ecom:Product.ID"); 182 string prodVariantID = product.GetString("Ecom:Product.VariantID"); 183 string prodLanguageID = product.GetString("Ecom:Product.LanguageID"); 184 string Image = "/Admin/Public/GetImage.ashx?Image=/Files/Images/Ecom/Products/" + prodID + ".jpg&format=webp&quality=85"; 185 186 //prices and units 187 string defaultUnitId = product.GetString("Ecom:Product.DefaultUnitID"); 188 var prices = product.GetLoop("Product.Prices"); 189 List<string> pricesHtmlList = Hounisen.Website.Helpers.Helpers.PricesListMakeListString(prices); 190 List<Hounisen.Website.Models.Unit> unitsDropdown = Hounisen.Website.Helpers.Helpers.PopulateUnitsDropdown(prices); 191 var unitDefault = unitsDropdown.Where(x => x.Id.Equals(defaultUnitId)).FirstOrDefault(); 192 int minOrder = unitDefault != null ? unitDefault.MinOrder : 1; 193 194 if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product.SelectedVariantComboID"))) 195 { 196 prodID = product.GetString("Ecom:Product.ID") + "&" + product.GetString("Ecom:Product.SelectedVariantComboID"); 197 } 198 199 200 GroupHelper gh = new GroupHelper(); 201 var group = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(product.GetString("Ecom:Product.PrimaryOrFirstGroupID")); 202 var masterPage = pageService.GetPage(product.GetInteger("Ecom:Product.PrimaryOrCurrentPageID")); 203 masterPage.GetDisplayName(); 204 var groupNames = gh.GetParentsRecursively(group, new List<string>()); 205 groupNames = gh.Format(groupNames, masterPage.GetDisplayName(), group); 206 var groups = gh.ListToString(groupNames); 207 ; 208 209 210 <div class="product-list__item"> 211 <div class="col-xs-12"> 212 <div class="product-list__item-inner"> 213 <div class="col-xs-12 col-sm-4 col-flex"> 214 <div class="product-list-item__primary-image"> 215 @if (currentUser != null) 216 { 217 <a href="@GroupLink" title="@Name"> 218 <img class="product-list-item__image lazy" alt="@Name" data-src="@Image&width=300" class="img-responsive img-center"> 219 </a> 220 <a class="fancybox" data-fancybox href="@Image&width=1000" title="@Name"> 221 <svg class="product-list-item__image-icon"> 222 <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/dist/icons/icons.svg#fullscreen"></use> 223 </svg> 224 </a> 225 } 226 else 227 { 228 <a href="@GroupLink" title="@Name"> 229 <img class="product-list-item__image lazy" alt="@Name" data-src="@Image&width=300" class="img-responsive img-center"> 230 </a> 231 <a class="fancybox" data-fancybox href="@Image&width=1000" title="@Name"> 232 <svg class="product-list-item__image-icon"> 233 <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/dist/icons/icons.svg#fullscreen"></use> 234 </svg> 235 </a> 236 } 237 </div> 238 </div> 239 <div class="col-xs-12 col-sm-8"> 240 <div class="product-list-item__info js-product-info"> 241 <div class="row"> 242 @*Title & Number*@ 243 <div class="col-xs-12"> 244 <h4 data-name="@Name" data-product_id="@prodID" data-categories="@groups" class="product-list-item__title"> 245 <a class="product-list-item__title-link" href="@GroupLink">@Name</a> 246 </h4> 247 </div> 248 </div> 249 <div class="row"> 250 <div class="col-xs-12 col-sm-5"> 251 252 <div class="product-list-item__attributes"> 253 <p> 254 <strong>Varenummer:</strong> @product.GetString("Ecom:Product.Number") 255 </p> 256 <p> 257 <strong>@product.GetString("Ecom:Product:Field.Attribut1A"):</strong><br/>@product.GetString("Ecom:Product:Field.Attribut1B") 258 </p> 259 <p> 260 <strong>@product.GetString("Ecom:Product:Field.Attribut2A"):</strong> @product.GetString("Ecom:Product:Field.Attribut2B") 261 </p> 262 </div> 263 264 <div class="hidden-xs"> 265 <div class=""> 266 @* IKONER *@ 267 <div class="product-list-item__icons"> 268 @{ 269 foreach (var c in product.GetString("Ecom:Product:Field.Certificates").Split(',')) 270 { 271 if (!string.IsNullOrEmpty(c)) 272 { 273 string src = "/Admin/Public/GetImage.ashx?Image=/Files/Images/Ecom/Certificates/" + @c + ".jpg&format=webp&quality=85&width=100"; 274 <img class="product-list-item__icon lazy" alt="@Translate("Cert_" + c, c)" title="@Translate("Cert_" + c, c)" data-src=@src src=@src> 275 } 276 } 277 } 278 </div> 279 </div> 280 </div> 281 </div> 282 283 <div class="col-xs-12 col-sm-7"> 284 @if (Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))) 285 { 286 <ul class="product-list-item__prices"> 287 @foreach (var priceHtml in pricesHtmlList) 288 { 289 <li> 290 @priceHtml 291 </li> 292 } 293 </ul> 294 } 295 </div> 296 </div> 297 298 <div class="row"> 299 <div class="col-xs-12 col-sm-4 col-lg-5"> 300 @* LAGERBEHOLDNING *@ 301 <div class="product-list-item__stock"> 302 @{ 303 if (stock > 0) 304 { 305 <p class="product-list-item__stock-text"> 306 <span class="product-list-item__stock-circle product-list-item__stock-circle--green"></span> På lager 307 </p> 308 } 309 else 310 { 311 <p class="product-list-item__stock-text"> 312 <span class="product-list-item__stock-circle product-list-item__stock-circle--yellow"></span> Kontakt os for leveringstid: 86210800 eller salg@hounisen.com 313 </p> 314 } 315 } 316 </div> 317 318 <div class="product-list-item__see-product"> 319 <a class="product-list-item__link" href="@GroupLink" class="">@Translate("See product", "Se produkt")</a> 320 </div> 321 </div> 322 <div class="col-xs-12 col-sm-8 col-lg-7"> 323 @if (Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))) 324 { 325 <div class="row"> 326 <div class="col-xs-7"> 327 <div class="product__addtocart-input js-addtocart-input"> 328 <input type="button" value="-" class="product-list-item__quantity-button product-list-item__quantity-button--minus qtyminus" field="quantity"/> 329 <input type="number" class="product__quantity-input product-list-item__quantity-input quantity" data-name="quantity" name="quantity" value="@minOrder" field="quantity"/> 330 <input type="button" value="+" class="product-list-item__quantity-button product-list-item__quantity-button--plus qtyplus" field="quantity"/> 331 </div> 332 <div class="product__unit-selector" style="display: inline-block;"> 333 @{ 334 int counter = 0; 335 } 336 @foreach (var unitDropdown in unitsDropdown) 337 { 338 var currentUnitPrice = prices[counter].Values["Ecom:Product.Prices.Amount"]; 339 <input type="radio" data-id="@index" data-price="@currentUnitPrice" class="unit-type" id="@(unitDropdown.Id + prodID)" name="UnitID@(product.GetString("Ecom:Product.Number"))" value="@unitDropdown.Id" required data-lot-size="@unitDropdown.LotSize" data-min-order="@unitDropdown.MinOrder" @(unitsDropdown.Count == 1 ? "checked='checked'" : "")> 340 <label for="@(unitDropdown.Id + prodID)">@unitDropdown.Name</label> 341 counter++; 342 } 343 </div> 344 <p class="product__unit-selector-error-message"> 345 @Translate("unit-error-message", "* Du mangler at vælge type") 346 </p> 347 </div> 348 <div class="col-xs-5"> 349 <div class="product__addtocart-button"> 350 <button data-id="@index" type="submit" name="submit" onclick="AddToCart(event, '@prodID', $(this).parent().parent().prev().find('input.quantity').val(), $(this).parent().parent().prev().find('input[name=\'UnitID@(product.GetString("Ecom:Product.Number"))\']:checked').val());" class="btn btn-primary product__button"> 351 @Translate("Add to cart", "Add to cart") 352 <svg class="product__button-icon hidden-xs"> 353 <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/dist/icons/icons.svg#basket"></use> 354 </svg> 355 </button> 356 <div class="product-list-item__favorite-list popup-wrap favorite"> 357 358 @if (hasRegionHDeal == false) 359 { 360 <button class="popup-show" data-popup="favorite-list" type="button" title="@Translate("Add to favorites", "Add to favorites")"> 361 <i class="fa fa-star-o"></i> <span>Tilføj til liste</span> 362 </button> 363 <div id="favorite-list" class="popup-form"> 364 <div class="close"> 365 <i class="fa fa-times"></i> 366 </div> 367 <h3>@Translate("Choose list", "Choose list")</h3> 368 <ul> 369 @{ 370 var lists = Dynamicweb.Ecommerce.CustomerCenter.CustomerProductList.GetListsByUserCustomerNumber(currentUser.CustomerNumber); 371 } 372 373 @foreach (var list in lists) 374 { 375 if (list.Products.Where(p => p.ProductId.ToString() == prodID).Count() > 0) 376 { 377 <li> 378 <a href="@(System.Web.HttpContext.Current.Request.Url)&CCRemoveFromMyLists=@prodID&CCAddToListVariantID=&CCAddToListLanguageID=LANG1&CCAddToListID=@list.ListId&CCListType="> 379 <i class="fa fa-star"></i> @list.Name 380 </a> 381 </li> 382 } 383 else 384 { 385 <li> 386 <a href="@(System.Web.HttpContext.Current.Request.Url)&CCAddToMyLists=@prodID&CCAddToListVariantID=&CCAddToListLanguageID=LANG1&CCAddToListID=@list.ListId&CCListType="> 387 <i class="fa fa-star-o"></i> @list.Name 388 </a> 389 </li> 390 } 391 } 392 <li> 393 <a href="/favoritter/opret-favoritliste?ProdID=@prodID"> 394 <i class="fa fa-plus"></i>@Translate("Add new list", "Add new list") 395 </a> 396 </li> 397 </ul> 398 </div> 399 } 400 401 </div> 402 </div> 403 </div> 404 </div> 405 } 406 else 407 { 408 <div class="not-loggedin"> 409 <p class="not-loggedin-text"><a data-toggle="modal" data-target="#login" href="">@Translate("Login", "Login")</a> eller <a href="/kontakt/opret-brugerprofil">Bliv kunde</a> for at se priser og købe på Hounisen.com</p> 410 <a data-toggle="modal" data-target="#login" href="" class="btn btn-primary not-loggedin-button"> 411 <span>Log ind</span> 412 </a> 413 </div> 414 } 415 </div> 416 </div> 417 </div> 418 419 420 </div> 421 </div> 422 </div> 423 </div> 424 425 if (index == embedIndex) 426 { 427 <div class="product-list__item"> 428 <div class="col-xs-12"> 429 @embeddedScript 430 </div> 431 </div> 432 } 433 434 435 Count++; 436 index++; 437 438 if (Count == ColMD) 439 { 440 <div class="row"></div> 441 Count = 0; 442 } 443 } 444 } 445 446 <script> 447 448 document.addEventListener("DOMContentLoaded", function () { 449 450 var addToCartButtons = document.querySelectorAll('.product__button'); 451 var unitTypes = document.getElementsByClassName("unit-type"); 452 var product_names = document.getElementsByClassName("product-list-item__title"); 453 454 addToCartButtons.forEach(function (item) { 455 456 item.addEventListener('click', function () { 457 458 var product_name = product_names[this.dataset.id - 1].dataset.name; 459 var product_id = product_names[this.dataset.id - 1].dataset.product_id; 460 var initialCategories = product_names[this.dataset.id - 1].dataset.categories; 461 var categories = initialCategories.split("_"); 462 var quantity = document.getElementsByClassName("quantity")[this.dataset.id - 1].value; 463 var unitPrice; 464 var variantIsNull = true; 465 var unitTypeName = null; 466 467 //Get unittype price 468 for (const unitType of unitTypes) { 469 470 if (unitType.dataset.id == this.dataset.id) { 471 472 if (unitType.checked == true) { 473 474 var tempPrice = unitType.dataset.price.replace(".", ""); 475 tempPrice = tempPrice.replace(",", "."); 476 unitPrice = parseFloat(tempPrice); 477 variantIsNull = false; 478 unitTypeName = unitType.value; 479 480 unitTypeName = unitTypeName.toString().split("_")[1]; 481 482 } 483 } 484 } 485 486 if (!variantIsNull) { 487 dataLayer.push({ ecommerce: null }); 488 dataLayer.push({ 489 'event': 'add_to_cart', 490 "ecommerce": { 491 "currency": "DKK", 492 "value": unitPrice * parseInt(quantity).toFixed(2), 493 "items": [ 494 { 495 "item_name": product_name + " - " + unitTypeName, 496 'item_id': product_id, 497 'price': unitPrice, 498 "item_brand": "", 499 "item_category": (categories[0] != null ? categories[0] : ""), 500 "item_category2": (categories[1] != null ? categories[1] : ""), 501 "item_category3": (categories[2] != null ? categories[2] : ""), 502 "item_category4": (categories[3] != null ? categories[3] : ""), 503 "item_category5": (categories[4] != null ? categories[4] : ""), 504 "quantity": parseInt(quantity), 505 } 506 ] 507 }, 508 509 }); 510 } 511 }); 512 }) 513 }); 514 515 </script> 516 @using System.Globalization 517 @using Dynamicweb.Content 518 @using Dynamicweb.Ecommerce.Products 519 @using Dynamicweb.Security.UserManagement 520 @using Hounisen.Website.Helpers 521 @using System.Text.RegularExpressions; 522 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 523 524 @helper GetProductGalleryList(dynamic Loop, int ColMD = 3, int ColSM = 3, int ColXS = 1) 525 { 526 int index = 1; 527 var pageService = new PageService(); 528 529 // SKI AND Region H 530 bool hasRegionHDeal = false; 531 var currentUser = User.GetCurrentExtranetUser(); 532 if (currentUser != null) 533 { 534 hasRegionHDeal = Dynamicweb.Core.Converter.ToBoolean(currentUser.CustomFieldValues.Find(f => f.CustomField.SystemName == "AccessUser_RegionH").Value); 535 } 536 537 foreach (LoopItem product in Loop) 538 { 539 string GroupLink = "/Default.aspx?ID=" + product.GetString("Ecom:Product.PrimaryOrCurrentPageID") + "&groupid=" + product.GetString("Ecom:Product.PrimaryOrFirstGroupID") + "&productid=" + product.GetString("Ecom:Product.ID"); 540 // string GroupLink = product.GetString("Ecom:Product.LinkGroup.Clean"); 541 int stock = product.GetInteger("Ecom:Product.Stock"); 542 string name = product.GetString("Ecom:Product.Name"); 543 string formattedName = name.Length > 60 ? name.Substring(0, 60).TrimEnd() : name; 544 string attribute1B = product.GetString("Ecom:Product:Field.Attribut1B"); 545 string description = attribute1B.Length > 25 ? attribute1B.Substring(0, 25).TrimEnd() + "..." : attribute1B; 546 547 string prodID = product.GetString("Ecom:Product.ID"); 548 string Image = "/Admin/Public/GetImage.ashx?Image=/Files/Images/Ecom/Products/" + prodID + ".jpg&format=webp&quality=85"; 549 550 //prices and units 551 string defaultUnitId = product.GetString("Ecom:Product.DefaultUnitID"); 552 var prices = product.GetLoop("Product.Prices"); 553 var price = prices.OrderBy(x => x.GetDouble("Ecom:Product.Prices.BaseUnitPrice")).FirstOrDefault(); 554 string baseUnitPrice = price != null ? price.GetString("Ecom:Product.Prices.BaseUnitPrice") : string.Empty; 555 556 List<Hounisen.Website.Models.Unit> unitsDropdown = Helpers.PopulateUnitsDropdown(prices); 557 var unitDefault = unitsDropdown.Where(x => x.Id.Equals(defaultUnitId)).FirstOrDefault(); 558 int minOrder = unitDefault != null ? unitDefault.MinOrder : 1; 559 560 if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product.SelectedVariantComboID"))) 561 { 562 prodID = product.GetString("Ecom:Product.ID") + "&" + product.GetString("Ecom:Product.SelectedVariantComboID"); 563 } 564 565 GroupHelper gh = new GroupHelper(); 566 var group = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(product.GetString("Ecom:Product.PrimaryOrFirstGroupID")); 567 var masterPage = pageService.GetPage(product.GetInteger("Ecom:Product.PrimaryOrCurrentPageID")); 568 masterPage.GetDisplayName(); 569 var groupNames = gh.GetParentsRecursively(group, new List<string>()); 570 groupNames = gh.Format(groupNames, masterPage.GetDisplayName(), group); 571 var groups = gh.ListToString(groupNames); 572 573 <div class="product-list__wrap col-xs-12 col-sm-4"> 574 <div class="product-list__item product-list__item--gallery col-xs-12"> 575 <div class="product-list__item-inner product-list__item-inner--gallery"> 576 <div class="col-12 col-flex"> 577 <div class="product-list-item__primary-image product-list-item__primary-image--gallery"> 578 @if (currentUser != null) 579 { 580 <a href="@GroupLink" title="@name"> 581 <img class="product-list-item__image lazy" alt="@name" data-src="@Image&width=300" class="img-responsive img-center"> 582 </a> 583 } 584 else 585 { 586 <a href="@GroupLink" title="@name"> 587 <img class="product-list-item__image lazy" alt="@name" data-src="@Image&width=300" class="img-responsive img-center"> 588 </a> 589 } 590 </div> 591 </div> 592 <div class="col-12"> 593 <div class="product-list-item__info product-list-item__info--gallery js-product-info"> 594 <div class="row"> 595 @*Title & Number*@ 596 <div class="col-12"> 597 <h5 data-name="@name" data-product_id="@prodID" data-categories="@groups" class="product-list-item__title product-list-item__title--gallery"> 598 <a class="product-list-item__title-link" href="@GroupLink">@formattedName</a> 599 </h5> 600 </div> 601 </div> 602 <div class="row"> 603 <div class="col-12"> 604 605 <div class="product-list-item__attributes product-list-item__attributes--gallery"> 606 <p> 607 <strong>Varenummer:</strong> @product.GetString("Ecom:Product.Number") 608 </p> 609 <p> 610 <strong>@product.GetString("Ecom:Product:Field.Attribut1A"): </strong> @description 611 </p> 612 </div> 613 </div> 614 </div> 615 616 <div class="row"> 617 <div class="product-list-item__info__container"> 618 <div class="product-list-item__info__container__item"> 619 @* LAGERBEHOLDNING *@ 620 <div class="product-list-item__stock"> 621 @{ 622 if (stock > 0) 623 { 624 <p class="product-list-item__stock-text"> 625 <span class="product-list-item__stock-circle product-list-item__stock-circle--green"></span> På lager 626 </p> 627 } 628 else 629 { 630 <p class="product-list-item__stock-text"> 631 <span class="product-list-item__stock-circle product-list-item__stock-circle--yellow"></span> Kontakt os 632 </p> 633 } 634 } 635 </div> 636 <div class="product-list-item__see-product"> 637 <a class="product-list-item__link product-list-item__link--gallery" href="@GroupLink" class="">@Translate("See product", "Se produkt")</a> 638 </div> 639 </div> 640 @if (!string.IsNullOrEmpty(baseUnitPrice)) 641 { 642 <div class="product-list-item__info__container__item product-list-item__info__container__item--text"> 643 <div class="product-list-item__info__container__item--grey"><b>Priser fra </b></div><b>@baseUnitPrice</b> kr./stk. 644 </div> 645 } 646 </div> 647 648 <div class="product-list-item__info__control"> 649 @if (Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))) 650 { 651 <div class="row"> 652 <div class="col-xs-6 col-lg-8"> 653 <div class="product__addtocart-input js-addtocart-input"> 654 <input type="button" value="-" class="product-list-item__quantity-button product-list-item__quantity-button--gallery product-list-item__quantity-button--minus qtyminus" field="quantity"/> 655 <input class="product__quantity-input product-list-item__quantity-input product-list-item__quantity-input--gallery quantity" data-name="quantity" name="quantity" value="@minOrder" field="quantity"/> 656 <input type="button" value="+" class="product-list-item__quantity-button product-list-item__quantity-button--gallery product-list-item__quantity-button--plus qtyplus" field="quantity"/> 657 </div> 658 </div> 659 <div class="col-xs-6 col-lg-4"> 660 <div class="product__addtocart-button product-list-item__addtocart-button product-list-item__addtocart-button--gallery"> 661 <button data-id="@index" type="submit" name="submit" onclick="AddToCart(event, '@prodID', $(this).parent().parent().prev().find('input.quantity').val(), $(this).parent().parent().prev().parent().parent().find('input[name=\'UnitID@(product.GetString("Ecom:Product.Number"))\']:checked').val());" class="btn btn-primary product__button product__button--gallery"> 662 @Translate("Add to cart", "Add to cart") 663 </button> 664 <div class="product-list-item__favorite-list product-list-item__favorite-list--gallery popup-wrap favorite"> 665 666 @if (hasRegionHDeal == false) 667 { 668 <button class="popup-show" data-popup="favorite-list" type="button" title="@Translate("Add to favorites", "Add to favorites")"> 669 <i class="fa fa-star-o"></i> <span>Tilføj til liste</span> 670 </button> 671 <div id="favorite-list" class="popup-form"> 672 <div class="close"> 673 <i class="fa fa-times"></i> 674 </div> 675 <h3>@Translate("Choose list", "Choose list")</h3> 676 <ul> 677 @{ 678 var lists = Dynamicweb.Ecommerce.CustomerCenter.CustomerProductList.GetListsByUserCustomerNumber(currentUser.CustomerNumber); 679 } 680 681 @foreach (var list in lists) 682 { 683 if (list.Products.Where(p => p.ProductId.ToString() == prodID).Count() > 0) 684 { 685 <li> 686 <a href="@(System.Web.HttpContext.Current.Request.Url)&CCRemoveFromMyLists=@prodID&CCAddToListVariantID=&CCAddToListLanguageID=LANG1&CCAddToListID=@list.ListId&CCListType="> 687 <i class="fa fa-star"></i> @list.Name 688 </a> 689 </li> 690 } 691 else 692 { 693 <li> 694 <a href="@(System.Web.HttpContext.Current.Request.Url)&CCAddToMyLists=@prodID&CCAddToListVariantID=&CCAddToListLanguageID=LANG1&CCAddToListID=@list.ListId&CCListType="> 695 <i class="fa fa-star-o"></i> @list.Name 696 </a> 697 </li> 698 } 699 } 700 <li> 701 <a href="/favoritter/opret-favoritliste?ProdID=@prodID"> 702 <i class="fa fa-plus"></i>@Translate("Add new list", "Add new list") 703 </a> 704 </li> 705 </ul> 706 </div> 707 } 708 709 </div> 710 </div> 711 </div> 712 713 </div> 714 <div class="row"> 715 <div class="col-xs-12"> 716 <div class="product__unit-selector" style="margin: 0;"> 717 @{ 718 int counter = 0; 719 } 720 @foreach (var unitDropdown in unitsDropdown) 721 { 722 var currentUnitPrice = prices[counter].Values["Ecom:Product.Prices.Amount"]; 723 <input type="radio" data-id="@index" data-price="@currentUnitPrice" class="unit-type" id="@(unitDropdown.Id + prodID)" name="UnitID@(product.GetString("Ecom:Product.Number"))" value="@unitDropdown.Id" required data-lot-size="@unitDropdown.LotSize" data-min-order="@unitDropdown.MinOrder" @(unitsDropdown.Count == 1 ? "checked='checked'" : "")> 724 <label for="@(unitDropdown.Id + prodID)" style="font-size: 14px;">@unitDropdown.Name</label> 725 counter++; 726 } 727 </div> 728 <p class="product__unit-selector-error-message"> 729 @Translate("unit-error-message", "* Du mangler at vælge type") 730 </p> 731 </div> 732 </div> 733 } 734 else 735 { 736 <div class="not-loggedin not-loggedin--gallery"> 737 <p class="not-loggedin-text"><a data-toggle="modal" data-target="#login" href="">@Translate("Login", "Login")</a> eller <a href="/kontakt/opret-brugerprofil">Bliv kunde</a></p> 738 <a data-toggle="modal" data-target="#login" href="" class="btn btn-primary not-loggedin-button"> 739 <span>Log ind</span> 740 </a> 741 </div> 742 } 743 </div> 744 </div> 745 </div> 746 </div> 747 </div> 748 </div> 749 </div> 750 751 index++; 752 } 753 } 754 755 <script> 756 757 document.addEventListener("DOMContentLoaded", function () { 758 759 var addToCartButtons = document.querySelectorAll('.product__button'); 760 var unitTypes = document.getElementsByClassName("unit-type"); 761 var product_names = document.getElementsByClassName("product-list-item__title"); 762 763 addToCartButtons.forEach(function (item) { 764 765 item.addEventListener('click', function () { 766 767 var product_name = product_names[this.dataset.id - 1].dataset.name; 768 var product_id = product_names[this.dataset.id - 1].dataset.product_id; 769 var initialCategories = product_names[this.dataset.id - 1].dataset.categories; 770 var categories = initialCategories.split("_"); 771 var quantity = document.getElementsByClassName("quantity")[this.dataset.id - 1].value; 772 var unitPrice; 773 var variantIsNull = true; 774 var unitTypeName = null; 775 776 //Get unittype price 777 for (const unitType of unitTypes) { 778 779 if (unitType.dataset.id == this.dataset.id) { 780 781 if (unitType.checked == true) { 782 783 var tempPrice = unitType.dataset.price.replace(".", ""); 784 tempPrice = tempPrice.replace(",", "."); 785 unitPrice = parseFloat(tempPrice); 786 variantIsNull = false; 787 unitTypeName = unitType.value; 788 789 unitTypeName = unitTypeName.toString().split("_")[1]; 790 791 } 792 } 793 } 794 795 if (!variantIsNull) { 796 dataLayer.push({ ecommerce: null }); 797 dataLayer.push({ 798 'event': 'add_to_cart', 799 "ecommerce": { 800 "currency": "DKK", 801 "value": unitPrice * parseInt(quantity).toFixed(2), 802 "items": [ 803 { 804 "item_name": product_name + " - " + unitTypeName, 805 'item_id': product_id, 806 'price': unitPrice, 807 "item_brand": "", 808 "item_category": (categories[0] != null ? categories[0] : ""), 809 "item_category2": (categories[1] != null ? categories[1] : ""), 810 "item_category3": (categories[2] != null ? categories[2] : ""), 811 "item_category4": (categories[3] != null ? categories[3] : ""), 812 "item_category5": (categories[4] != null ? categories[4] : ""), 813 "quantity": parseInt(quantity), 814 } 815 ] 816 }, 817 818 }); 819 } 820 }); 821 }) 822 }); 823 824 </script> 825 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 826 827 @helper GetB2BProductList(dynamic Loop) 828 { 829 <form name="multiForm" id="multiForm" method="post"> 830 <input type="hidden" name="CartCmd" id="CartCmd" value="addMulti" /> 831 <table class="table table-striped"> 832 <thead> 833 <tr> 834 <th></th> 835 <th class="item-no"> 836 <a href="@GetSortingUrl("Number")"><span title="@Translate("Item no", "Item no")">@Translate("Item no", "Item no").</span></a> 837 </th> 838 <th> 839 <a href="@GetSortingUrl("Name")"><span title="@Translate("Item name", "Item name")">@Translate("Item name", "Item name")</span></a> 840 </th> 841 <th class="group-text"> 842 <a href="@GetSortingUrl("CustomField_House")"><span title="@Translate("Category", "Category")">@Translate("Category", "Category")</span></a> 843 </th> 844 <th class="stock-title" style="width: 60px"> 845 <span title="@Translate("Stock", "Stock")">@Translate("Stock", "Stock")</span> 846 </th> 847 <th class="price-title"> 848 <span title="@Translate("Price", "Price")">@Translate("Price", "Price")</span> 849 </th> 850 <th> 851 <span title="@Translate("Quantity", "Quantity")">@Translate("Quantity", "Quantity")</span> 852 </th> 853 <th class="button-title">&nbsp;</th> 854 </tr> 855 </thead> 856 <tbody class="table-row"> 857 858 @foreach (LoopItem product in Loop) 859 { 860 var n = product.GetString("Ecom:Product.LoopCounter"); 861 var productId = product.GetString("Ecom:Product.ID"); 862 var variantId = product.GetString("Ecom:Product.VariantID"); 863 string Image = product.GetString("Ecom:Product.ImageLarge.Default.Clean"); 864 string GroupLink = "/Default.aspx?ID=" + product.GetString("Ecom:Product.PrimaryOrCurrentPageID") + "&groupid=" + product.GetString("Ecom:Product.PrimaryOrFirstGroupID") + "&productid=" + product.GetString("Ecom:Product.ID"); 865 // string GroupLink = product.GetString("Ecom:Product.LinkGroup.Clean"); 866 string Name = product.GetString("Ecom:Product.Name"); 867 string postinggroup = product.GetString("Ecom:Product:Field.House"); 868 string Description2 = product.GetString("Ecom:Product:Field.Description2"); 869 string Discount = product.GetString("Ecom:Product.Discount.Price"); 870 string Price = product.GetString("Ecom:Product.Price"); 871 string number = product.GetString("Ecom:Product.Number"); 872 string unit = product.GetString("Ecom:Product:Field.Unit"); 873 string qtyprparcel = product.GetString("Ecom:Product:Field.QtyPrParcel"); 874 string storestock = product.GetString("Ecom:Product.Stock"); 875 int quantitystock = product.GetInteger("Ecom:Product.Stock"); 876 string disabled = ""; 877 string disabledinput = ""; 878 foreach (LoopItem stockUnit in product.GetLoop("StockLocations")) 879 { 880 if (stockUnit.GetInteger("Ecom:StockLocation.ID") == product.GetInteger("Ecom:ContextStockLocation.ID")) 881 { 882 quantitystock = stockUnit.GetInteger("Ecom:StockLocation.Quantity"); 883 } 884 } 885 886 if (@quantitystock <= 0) 887 { 888 disabled = "noStock"; 889 disabledinput = "disabled"; 890 } 891 892 if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product.SelectedVariantComboID"))) 893 { 894 productId = product.GetString("Ecom:Product.ID") + "&" + product.GetString("Ecom:Product.SelectedVariantComboID"); 895 } 896 897 <tr class="clickable-row" data-href="@GroupLink"> 898 <td class="image-title"> 899 <figure style="" class="productfigure"> 900 <img alt="" src="/Admin/Public/Getimage.ashx?width=40&amp;height=40&amp;compression=85&amp;Crop=5&amp;image=@Image&format=WebP&Quality=90" width="40" height="40" class="img-responsive img-center lazy"> 901 </figure> 902 <div class="big-hover-image" style="display: none"> 903 <img alt="" src="/Admin/Public/Getimage.ashx?width=300&amp;height=300&amp;compression=85&amp;Crop=5&amp;image=@Image&format=WebP&Quality=90" width="300" height="300" class="img-responsive img-center lazy"> 904 </div> 905 </td> 906 <td class="item-no">@number</td> 907 <td class="desc"><span title="@Name" class="click">@Name</span></td> 908 <td class="group-text">@postinggroup</td> 909 <td class="stock-title" align="right">@quantitystock.ToString()</td> 910 <td class="retai-price" align="right">@Price</td> 911 <td class="quanity-title"> 912 @if (!string.IsNullOrWhiteSpace(qtyprparcel)) 913 { 914 <input id="@("Quantity" + @n)" type="number" class="quantity form-control hidden-print" @disabledinput name="@("Quantity" + @n)" value="0" min="0" max="@quantitystock" step="@qtyprparcel"> 915 } 916 else 917 { 918 <input id="@("Quantity" + @n)" type="number" class="quantity form-control hidden-print" @disabledinput name="@("Quantity" + @n)" value="0" min="0" max="@quantitystock" step="1"> 919 } 920 </td> 921 <td class="button-title"> 922 <input type="hidden" name="@("ProductLoopCounter" + @n)" value="@n" /> 923 <input type="hidden" name="@("ProductID" + @n)" value="@productId" /> 924 <input type="hidden" name="@("VariantID" + @n)" value="@variantId" /> 925 <button type="button" name="submit" onclick="AddToCart(event, '@productId', document.getElementById('@("Quantity" + @n)').value);" class="btn btn-sm btn-dw-cart"><strong>@Translate("Buy")</strong></button> 926 </td> 927 </tr> 928 } 929 </tbody> 930 </table> 931 <div class=""> 932 <input type="submit" class="btn btn-dw-cart pull-right hidden-print" value="@Translate("productlist_BuyAll", "Buy all")" /> 933 </div> 934 </form> 935 } 936 937 938 @functions { 939 string GetSortingUrl(string sortBy) { 940 try 941 { 942 var url = GetString("Global:Pageview.Url.Raw"); 943 944 var uri = new Uri(url); 945 var newQueryString = HttpUtility.ParseQueryString(uri.Query); 946 newQueryString.Remove("SortBy"); 947 newQueryString.Remove("SortOrder"); 948 newQueryString.Add("SortBy", sortBy); 949 newQueryString.Add("SortOrder", "ASC"); 950 var pagePathWithoutQueryString = uri.GetLeftPart(UriPartial.Path); 951 952 return newQueryString.Count > 0 953 ? String.Format("{0}?{1}", pagePathWithoutQueryString, newQueryString) 954 : pagePathWithoutQueryString; 955 } 956 catch (Exception) 957 { 958 //throw; 959 return string.Empty; 960 } 961 } 962 } 963 964 @SnippetStart("JavaScriptBottom") 965 <script> 966 document.addEventListener("DOMContentLoaded", function (event) { 967 var group = document.getElementsByClassName('image-title'); 968 for (var i = 0; i < group.length; i++) { 969 var figure = group[i].getElementsByClassName("productfigure")[0]; 970 figure.addEventListener('mouseover', function(e) { 971 this.parentNode.getElementsByClassName("big-hover-image")[0].style.display = 'block'; 972 }); 973 figure.addEventListener('mouseout', function(e) { 974 this.parentNode.getElementsByClassName("big-hover-image")[0].style.display = 'none'; 975 }); 976 }; 977 }); 978 </script> 979 @SnippetEnd("JavaScriptBottom") 980 @using Dynamicweb.Security.UserManagement 981 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 982 983 @helper GetProductListRelated(dynamic Loop, int ColMD = 3, int ColSM = 3, int ColXS = 1) 984 { 985 var currentUser = User.GetCurrentExtranetUser(); 986 987 <ul class="shop-list__list"> 988 989 @foreach (LoopItem product in Loop) 990 { 991 992 string GroupLink = "/Default.aspx?ID=" + product.GetString("Ecom:Product.PrimaryOrCurrentPageID") + "&groupid=" + product.GetString("Ecom:Product.PrimaryOrFirstGroupID") + "&productid=" + product.GetString("Ecom:Product.ID"); 993 string Name = product.GetString("Ecom:Product.Name"); 994 string Description = product.GetString("Ecom:Product.ShortDescription"); 995 string prodID = product.GetString("Ecom:Product.ID"); 996 string Image = "/Admin/Public/GetImage.ashx?Image=/Files/Images/Ecom/Products/" + prodID + ".jpg&format=webp&quality=85"; 997 998 <li class="shop-list__item col-xs-12"> 999 <a class="shop-list__link" href="@GroupLink" title="@Name"> 1000 <figure class="shop-list__figure"> 1001 <img class="shop-list__image lazy" style="width: 213px;" alt="@Name" data-src="@Image&width=213"> 1002 </figure> 1003 <h4 class="shop-list__title">@Name</h4> 1004 <div class="shop-list__text"> 1005 @if (String.IsNullOrEmpty(product.GetString("Ecom:Product.LongDescription"))) 1006 { 1007 var gr = Dynamicweb.Ecommerce.Products.Group.GetGroupById(product.GetString("Ecom:Product.PrimaryOrFirstGroupID")); 1008 1009 @gr.Description.Replace("<a ", "<span ").Replace("</a>", "</span>").Replace("<h2>", "<p>").Replace("</h2>", "</p>") 1010 } 1011 else 1012 { 1013 @product.GetString("Ecom:Product.LongDescription").Replace("<a ", "<span ").Replace("</a>", "</span>").Replace("<h2>", "<p>").Replace("</h2>", "</p>") 1014 } 1015 1016 </div> 1017 <div class="shop-list__price"> 1018 @if (currentUser != null) 1019 { 1020 string baseUnitPrice = String.Empty; 1021 var price = product.GetLoop("Product.Prices").OrderBy(x => x.GetDouble("Ecom:Product.Prices.BaseUnitPrice")).FirstOrDefault(); 1022 if (price != null) 1023 { 1024 baseUnitPrice = price.GetString("Ecom:Product.Prices.BaseUnitPrice"); 1025 } 1026 <span class="shop-list__price-from">Priser fra</span> 1027 <span class="shop-list__price-value">@baseUnitPrice</span> 1028 <span class="shop-list__price-unit">kr./stk.</span> 1029 } 1030 </div> 1031 </a> 1032 </li> 1033 1034 } 1035 </ul> 1036 } 1037 1038 1039 1040 @{ 1041 string grouplink = ""; 1042 1043 if (!string.IsNullOrWhiteSpace(GetString("Ecom:ProductList:Page.GroupID"))) 1044 { 1045 grouplink = "/Default.aspx?ID=" + GetValue("Ecom:ProductList:Page.ID") + "&amp;GroupID=" + GetValue("Ecom:ProductList:Page.GroupID"); 1046 } 1047 else 1048 { 1049 grouplink = "/Default.aspx?ID=" + GetValue("Ecom:ProductList:Page.ID") + "&amp;eComQuery=" + GetValue("Ecom:ProductList:Search.Query"); 1050 } 1051 1052 1053 var id = Dynamicweb.Context.Current.Request.QueryString["ID"]; 1054 var search = Dynamicweb.Context.Current.Request.QueryString["Search"]; 1055 var request = HttpContext.Current.Request; 1056 var listView = request.QueryString["ListView"]; 1057 } 1058 1059 1060 <div class="row"> 1061 <div class="col-md-3 hidden-sm hidden-xs"> 1062 <aside> 1063 @{ 1064 var queryService = Dynamicweb.Extensibility.ServiceLocator.Current.GetInstance<Dynamicweb.Indexing.Querying.IQueryService>(); 1065 1066 //settings for the query 1067 Dynamicweb.Indexing.Querying.QuerySettings querySettings = new Dynamicweb.Indexing.Querying.QuerySettings(); 1068 querySettings.Take = 10; 1069 Dictionary<string, object> parameters = new Dictionary<string, object>(); 1070 parameters.Add("Search", search); 1071 querySettings.Parameters = parameters; 1072 1073 Dynamicweb.Indexing.Querying.IQueryResult groups = queryService.Query(queryService.LoadQuery("Hounisen", "Hounisen Group Query.query"), querySettings); 1074 Dynamicweb.Indexing.Querying.IQueryResult contents = queryService.Query(queryService.LoadQuery("Hounisen", "Hounisen Content.query"), querySettings); 1075 1076 if (groups.Count > 0) 1077 { 1078 <h3>Kategorier</h3> 1079 <ul> 1080 @foreach (var queryResult in groups.QueryResult) 1081 { 1082 IDictionary<string, object> props = queryResult as IDictionary<string, object>; 1083 string linkGroup = props["GroupMetaPrimaryPage"].ToString() + "&GroupID=" + props["GroupID"].ToString(); 1084 <li><a href="@linkGroup">@props["GroupName"].ToString()</a></li> 1085 } 1086 </ul> 1087 } 1088 1089 if (contents.Count > 0) 1090 { 1091 <h3>Indhold</h3> 1092 <ul> 1093 @foreach (var queryResult in contents.QueryResult) 1094 { 1095 IDictionary<string, object> props = queryResult as IDictionary<string, object>; 1096 <li><a href="/Default.aspx?ID=@props["PageID"].ToString()">@props["PageMenuText"].ToString()</a></li> 1097 } 1098 </ul> 1099 } 1100 } 1101 </aside> 1102 </div> 1103 1104 <div class="col-md-9 col-sm-12 col-xs-12"> 1105 <div class="row"> 1106 <div class="col-lg-12"> 1107 <div class="shop-list category-slider slider"> 1108 <div class="owl-carousel"> 1109 @{ 1110 foreach (var queryResult in groups.QueryResult) 1111 { 1112 IDictionary<string, object> props = queryResult as IDictionary<string, object>; 1113 string linkGroup = props["GroupMetaPrimaryPage"].ToString() + "&GroupID=" + props["GroupID"].ToString(); 1114 1115 string resizedGroupImage = VestjyskMarketing.Helpers.ImageHelper.ResizeImage(new ResizeImageSettings() 1116 { 1117 Image = "/Files/" + props["GroupSmallImage"].ToString(), 1118 Width = 220, 1119 Quality = 80 1120 }); 1121 1122 <div class="owl-item owl-custom-item"> 1123 <a class="shop-list__link shop-list__link--slide " style="width: 100%;" href="@linkGroup"> 1124 <figure class="shop-list__figure"> 1125 <img class="shop-list__image lazy" style="width: 220px;" src="@resizedGroupImage" alt="@props["GroupName"].ToString()"> 1126 </figure> 1127 <h4 class="shop-list__title">@props["GroupName"].ToString()</h4> 1128 </a> 1129 </div> 1130 } 1131 } 1132 </div> 1133 </div> 1134 </div> 1135 </div> 1136 1137 <div class="row"> 1138 <div class="col-xs-12"> 1139 <p class="text-center" style="color: #AAAAAA !important; font-size: 14px !important">Din søgning gav @GetValue("Ecom:ProductList.PageProdCnt") resultater</p> 1140 </div> 1141 </div> 1142 1143 <div class="row"> 1144 <div class="list-view"> 1145 <div class="col-12"> 1146 <div class="list-view__control"> 1147 <button onclick="Hounisen.product.listProductsByView('list')"> 1148 <span class="glyphicon glyphicon-th-list @(listView == null ? "active" : "")"></span> 1149 </button> 1150 1151 <button onclick="Hounisen.product.listProductsByView('gallery')"> 1152 <span class="glyphicon glyphicon-th @(listView == "gallery" ? "active" : "")"></span> 1153 </button> 1154 </div> 1155 </div> 1156 </div> 1157 </div> 1158 1159 <div class="row search-result-list"> 1160 @if (Pageview.Area.Item["EcommerceProductListForm"].ToString() == "b2b") 1161 { 1162 @GetB2BProductList(GetLoop("Products")) 1163 } 1164 else 1165 { 1166 if (listView == "gallery") 1167 { 1168 @GetProductGalleryList(GetLoop("Products"), 3) 1169 } 1170 else 1171 { 1172 @GetProductList(GetLoop("Products"), 3) 1173 } 1174 } 1175 </div> 1176 1177 <hr> 1178 <span class="shop-page-info pull-left hidden-sm hidden-xs">@Translate("Showing page", "Showing page") @GetValue("Ecom:ProductList.CurrentPage") @Translate("of", "of") @GetValue("Ecom:ProductList.TotalPages") (@GetValue("Ecom:ProductList.PageProdCnt") @Translate("products", "products"))</span> 1179 <ul class="pagination pull-right"> 1180 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:ProductList.PrevPage.Clean"))) 1181 { 1182 <li><a href="@GetString("Ecom:ProductList.PrevPage.Clean")">&laquo;</a></li> 1183 } 1184 @foreach (LoopItem page in GetLoop("Ecom:ProductList.Pages")) 1185 { 1186 if (page.GetBoolean("Ecom:ProductList.Pages.Page.IsCurrent")) 1187 { 1188 <li class="active"><a href="@page.GetString("Ecom:ProductList.Pages.Page.Url")">@page.GetValue("Ecom:ProductList.Pages.Page.Number")</a></li> 1189 } 1190 else 1191 { 1192 <li><a href="@page.GetString("Ecom:ProductList.Pages.Page.Url")">@page.GetValue("Ecom:ProductList.Pages.Page.Number")</a></li> 1193 } 1194 } 1195 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:ProductList.NextPage.Clean"))) 1196 { 1197 <li><a href="@GetString("Ecom:ProductList.NextPage.Clean")">&raquo;</a></li> 1198 } 1199 </ul> 1200 1201 </div> 1202 </div>

Dansk support (kl. 08-16)

Dag-til-dag levering

Hurtig genbestilling

Faguddannet personale