Error executing template "Designs/Default/eCom/ProductCatalog/ProductList.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_3e0e826bb13148e4a57a4f42ef538025.Execute() in E:\Dynamicweb.net\Solutions\Webshop\Files\Templates\Designs\Default\eCom\ProductCatalog\ProductList.cshtml:line 2211
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   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 @inherits ViewModelTemplate<ProductListViewModel> 2 @using Dynamicweb; 3 @using Dynamicweb.Core; 4 @using Dynamicweb.Environment; 5 @using Dynamicweb.Environment.Helpers; 6 @using Dynamicweb.Rendering; 7 @using Dynamicweb.Ecommerce.ProductCatalog; 8 @using System.Linq; 9 @using Cookie = Dynamicweb.Environment.Cookie; 10 @using Gasa.ProductInformation.Helpers; 11 12 @using Dynamicweb.Ecommerce.Orders; 13 @using System.Globalization; 14 @using Dynamicweb.Security.UserManagement; 15 @using Dynamicweb.Security.UserManagement.Common.CustomFields; 16 @using Dynamicweb; 17 @using Dynamicweb.Core; 18 @using Dynamicweb.Environment; 19 @using Dynamicweb.Environment.Helpers; 20 @using Dynamicweb.Rendering; 21 @using Dynamicweb.Ecommerce.ProductCatalog; 22 @using System.Linq; 23 @using Gasa.ProductInformation; 24 25 @* Note that this file will be inserted directly into another one by Dynamicweb IncludeFile 26 before evaluating the Razor code, so keep the syntax right *@ 27 28 29 @* global functions *@ 30 31 @functions { 32 bool checkIfFileExists(string imgURL) 33 { 34 return System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath(imgURL)); 35 } 36 string FormatDiameter(string value) 37 { 38 if (string.IsNullOrEmpty(value)) 39 { 40 return value; 41 } 42 43 Decimal d; 44 if (Decimal.TryParse(value, out d)) 45 { 46 return Converter.ToDouble(value).ToString("0.0", Dynamicweb.Frontend.PageView.Current().Area.CultureInfo.NumberFormat); 47 //return d.ToString("0.0", Base.GetCulture(true)); 48 } 49 50 return value; 51 } 52 53 string FormatPrice(string value) 54 { 55 if (string.IsNullOrEmpty(value)) 56 { 57 return value; 58 } 59 60 Decimal d; 61 if (Decimal.TryParse(value, out d)) 62 { 63 return Converter.ToDouble(value).ToString("0.00", Dynamicweb.Frontend.PageView.Current().Area.CultureInfo.NumberFormat); 64 } 65 66 return value; 67 } 68 69 string AvailableDeliveryDay(int leadDays) 70 { 71 DateTime today = DateTime.Now.Date; 72 DateTime availableDate = today; 73 DateTime deliveryDate = Dynamicweb.Ecommerce.Common.Context.OrderTime; 74 TimeSpan daysDifference = deliveryDate - today; 75 CultureInfo localLanguage = System.Threading.Thread.CurrentThread.CurrentCulture; 76 string result; 77 78 int leadWeekendDays = 0; 79 80 81 // check how many weekends within lead days 82 for (var i = 0; i < leadDays; i++) 83 { 84 if (availableDate.AddDays(i).DayOfWeek == DayOfWeek.Saturday) 85 { 86 leadWeekendDays++; 87 } 88 else if (availableDate.AddDays(i).DayOfWeek == DayOfWeek.Sunday) 89 { 90 leadWeekendDays++; 91 } 92 } 93 94 // check how many weekends after lead weekdays 95 for (var i = 0; i < leadWeekendDays; i++) 96 { 97 if (availableDate.AddDays(leadDays + i).DayOfWeek == DayOfWeek.Saturday) 98 { 99 leadWeekendDays++; 100 } 101 else if (availableDate.AddDays(leadDays + i).DayOfWeek == DayOfWeek.Sunday) 102 { 103 leadWeekendDays++; 104 } 105 } 106 107 var leadDaysTotal = leadWeekendDays + leadDays; 108 109 availableDate = availableDate.AddDays(leadDaysTotal); 110 111 if (daysDifference.TotalDays >= leadDaysTotal && availableDate <= deliveryDate) 112 { 113 result = null; 114 } 115 else 116 { 117 result = availableDate.ToString("dd-MM-yyyy", localLanguage); 118 } 119 //result=daysDifference.TotalDays.ToString(); 120 return result; 121 } 122 123 /* 124 bool EnableEditing() 125 { 126 return EnableEditableBarcode(); 127 } 128 */ 129 130 bool? _enableManufacturerPage; 131 bool EnableManufacturerPage() 132 { 133 if (!_enableManufacturerPage.HasValue) 134 { 135 if (Pageview.Page.PropertyItem != null && Converter.ToBoolean(Pageview.Page.PropertyItem["EnableManufacturer"])) 136 { 137 _enableManufacturerPage = true; 138 } 139 else 140 { 141 _enableManufacturerPage = false; 142 } 143 } 144 return _enableManufacturerPage.Value; 145 } 146 147 ///* generic validation of custom user fields */ 148 //bool? returnCustomUserFieldValidation(string CustomerUserFieldString) 149 //{ 150 // return GetCustomUserField<bool>(user, CustomerUserFieldString); 151 //} 152 153 154 bool? _displayPricesInclVat; 155 bool DisplayPricesInclVat() 156 { 157 if (!_displayPricesInclVat.HasValue) 158 { 159 _displayPricesInclVat = GetCustomUserField<bool>("AccessUser_DisplayPricesInclVat"); 160 } 161 return _displayPricesInclVat.Value; 162 } 163 164 bool? _enableEditableItemNumber; 165 bool EnableEditableItemNumber() 166 { 167 if (!_enableEditableItemNumber.HasValue) 168 { 169 _enableEditableItemNumber = GetCustomUserField<bool>("AccessUser_EnableEditableItemNumber"); 170 } 171 return _enableEditableItemNumber.Value; 172 } 173 174 //AccessUser_EnableManufacturerFiltering 175 bool? _enableManufacturerFiltering; 176 bool EnableManufacturerFiltering(bool chkEnableManufacturerPageEnableManufacturerPage = true) 177 { 178 if (chkEnableManufacturerPageEnableManufacturerPage && !EnableManufacturerPage()) 179 return false; 180 181 if (!_enableManufacturerFiltering.HasValue) 182 { 183 _enableManufacturerFiltering = GetCustomUserField<bool>("AccessUser_EnableManufacturerFiltering"); 184 } 185 return _enableManufacturerFiltering.Value; 186 } 187 188 bool? _enableCustomerItemNumber; 189 bool EnableCustomerItemNumber() 190 { 191 if (!_enableCustomerItemNumber.HasValue) 192 { 193 _enableCustomerItemNumber = GetCustomUserField<bool>("AccessUser_EnableCustomerItemNumber"); 194 } 195 return _enableCustomerItemNumber.Value; 196 } 197 198 bool? _enableEditableRetailPrice; 199 bool EnableEditableRetailPrice() 200 { 201 if (!_enableEditableRetailPrice.HasValue) 202 { 203 _enableEditableRetailPrice = GetCustomUserField<bool>("AccessUser_EnableEditableRetailPrice"); 204 } 205 return _enableEditableRetailPrice.Value; 206 } 207 208 bool? _enableEditableBarcode; 209 bool EnableEditableBarcode() 210 { 211 if (!_enableEditableBarcode.HasValue) 212 { 213 _enableEditableBarcode = GetCustomUserField<bool>("AccessUser_EnableEditableBarcode"); 214 } 215 return _enableEditableBarcode.Value; 216 } 217 218 bool? _enableCustomerRetailPrice; 219 bool EnableCustomerRetailPrice() 220 { 221 if (!_enableCustomerRetailPrice.HasValue) 222 { 223 _enableCustomerRetailPrice = GetCustomUserField<bool>("AccessUser_EnableCustomerRetailPrice"); 224 } 225 return _enableCustomerRetailPrice.Value; 226 } 227 228 bool? _enableCustomerBarcode; 229 bool EnableCustomerBarcode() 230 { 231 if (!_enableCustomerBarcode.HasValue) 232 { 233 _enableCustomerBarcode = GetCustomUserField<bool>("AccessUser_EnableCustomerBarcode"); 234 } 235 return _enableCustomerBarcode.Value; 236 237 } 238 239 bool? _enableComments; 240 bool EnableComments() 241 { 242 if (!_enableComments.HasValue) 243 { 244 _enableComments = GetCustomUserField<bool>("AccessUser_EnableCommentOnLine"); 245 } 246 return _enableComments.Value; 247 } 248 249 bool? _enableMinimumCCQuantity; 250 bool EnableMinimumCCQuantity() 251 { 252 if (!_enableMinimumCCQuantity.HasValue) 253 { 254 _enableMinimumCCQuantity = GetCustomUserField<bool>("AccessUser_EnableMinimumCCQuantity"); 255 } 256 return _enableMinimumCCQuantity.Value; 257 } 258 bool? _enableFullCCCheck; 259 bool EnableFullCCCheck() 260 { 261 if (!_enableFullCCCheck.HasValue) 262 { 263 _enableFullCCCheck = GetCustomUserField<bool>("AccessUser_EnableFullCCCheck"); 264 } 265 return _enableFullCCCheck.Value; 266 } 267 268 bool? _enableDisplayGrossMargin; 269 bool EnableDisplayOfGrossMargin() 270 { 271 if (DisablePrices()) 272 return false; 273 274 if (!_enableDisplayGrossMargin.HasValue) 275 { 276 _enableDisplayGrossMargin = GetCustomUserField<bool>("AccessUser_DisplayGrossMargin"); 277 } 278 return _enableDisplayGrossMargin.Value; 279 } 280 281 string GetGrossMargin(double retailPrice, double salesPrice) 282 { 283 var resultValue = ((retailPrice - salesPrice) * 100) / retailPrice; 284 return Converter.ToString(Math.Round(resultValue, 2)) + "%"; 285 } 286 287 288 double? _minimumCCQuantity; 289 double MinimumCCQuantity(string flag = "") 290 { 291 if (!_minimumCCQuantity.HasValue) 292 { 293 _minimumCCQuantity = GetCustomUserField<double>("AccessUser_MinimumCCQuantity" + flag.ToUpper()); 294 } 295 return _minimumCCQuantity.Value; 296 } 297 298 bool? _disablePrices; 299 bool DisablePrices() 300 { 301 if (!_disablePrices.HasValue) 302 { 303 _disablePrices = GetCustomUserField<bool>("AccessUser_DisablePrices"); 304 } 305 return _disablePrices.Value; 306 } 307 308 double? _fullCCCheckDeviation; 309 double FullCCCheckDeviation() 310 { 311 if (!_fullCCCheckDeviation.HasValue) 312 { 313 _fullCCCheckDeviation = GetCustomUserField<double>("AccessUser_FullCCCheckDeviation"); 314 } 315 316 return _fullCCCheckDeviation.Value; 317 } 318 319 //bool HasReachedMinimumQuantity() 320 //{ 321 // if (!EnableMinimumCCQuantity()) 322 // { 323 // return true; 324 // } 325 326 // var orderlinesGroupByCode = GetLoop("OrderLines").GroupBy(o => o.GetString("Ecom:Product:Field.NavCompanyCode")) 327 // .Select(o => new { 328 // Flag = o.FirstOrDefault().GetString("Ecom:Product:Field.NavCompanyCode"), 329 // CCRate = o.Sum(f => f.GetInteger("Ecom:Order:OrderLine.Quantity") * f.GetDouble("CustomerSpecificProductInformation.CCRate")) 330 // }); 331 332 // if (orderlinesGroupByCode.Count() == orderlinesGroupByCode.Where(o => o.CCRate >= MinimumCCQuantity(o.Flag)).Count()) 333 // { 334 // return true; 335 // } 336 337 // return false; 338 //} 339 340 //bool HasPassedFullCCCheckDeviationCheck() 341 //{ 342 // if (!EnableFullCCCheck()) 343 // { 344 // return true; 345 // } 346 347 // var orderlinesGroupByCode = GetLoop("OrderLines").GroupBy(o => o.GetString("Ecom:Product:Field.NavCompanyCode")) 348 // .Select(o => new { CCRate = o.Sum(f => f.GetInteger("Ecom:Order:OrderLine.Quantity") * f.GetDouble("CustomerSpecificProductInformation.CCRate")) }); 349 350 // if (orderlinesGroupByCode.Count() == orderlinesGroupByCode.Where(o => (o.CCRate % 1) == 0 || LessOrEqual((o.CCRate % 1), FullCCCheckDeviation()) || LessOrEqual(Math.Abs(1 - (o.CCRate % 1)), FullCCCheckDeviation())).Count()) 351 // { 352 // return true; 353 // } 354 355 // return false; 356 //} 357 358 //AE: Workaround for comparing doubles 359 bool LessOrEqual(double d1, double d2) 360 { 361 return d1 < d2 || Math.Abs(d1 - d2) <= 0.0000001; 362 } 363 364 /* 365 bool DisableComments() 366 { 367 User user = User.get_Current(PagePermissionLevels.Frontend); 368 369 return GetCustomField<bool>(user, "AccessUser_EnableCommentOnLine"); 370 } 371 */ 372 //static T GetCustomOrderLineField<T>(OrderLine orderLine, string customSystemFieldName) 373 //{ 374 // OrderLineFieldValue myFieldValue = 375 // orderLine.OrderLineFieldValues.FirstOrDefault(cfv => cfv.OrderLineFieldSystemName == customSystemFieldName); 376 377 // if (myFieldValue != null) 378 // { 379 // return (T)Convert.ChangeType(myFieldValue.Value, typeof(T)); 380 // } 381 382 // // Return default(T) which means you'll return null 383 // return default(T); 384 //} 385 386 //static T GetCustomOrderLineField<T>(LoopItem orderLine, string customSystemFieldName) 387 //{ 388 // var template = 389 // orderLine.GetLoop("Order.OrderLineFields").FirstOrDefault(o => o.GetString("Ecom:Order:OrderLine.OrderLineField.SystemName") == customSystemFieldName); 390 391 // if (template != null) 392 // { 393 // return (T)Convert.ChangeType(template.GetValue("Ecom:Order:OrderLine.OrderLineField.Value.Clean"), typeof(T)); 394 // } 395 396 // // Return default(T) which means you'll return null 397 // return default(T); 398 //} 399 400 Dynamicweb.Security.UserManagement.User _user = null; 401 T GetCustomUserField<T>(string customSystemFieldName) 402 { 403 if (_user == null) 404 { 405 _user = Dynamicweb.Security.UserManagement.User.GetCurrentExtranetUser(); 406 } 407 408 if (_user != null) 409 { 410 CustomFieldValue myFieldValue = _user.CustomFieldValues.FirstOrDefault(cfv => cfv.CustomField.SystemName == customSystemFieldName); 411 412 try 413 { 414 if (myFieldValue != null) 415 { 416 return (T)Convert.ChangeType(myFieldValue.Value, typeof(T)); 417 } 418 } 419 catch (Exception) 420 { 421 return default(T); 422 } 423 } 424 425 // Return default(T) which means you'll return null 426 return default(T); 427 } 428 429 430 ICollection<Dynamicweb.Ecommerce.Orders.OrderLineField> SortOrderLineFields(ICollection<Dynamicweb.Ecommerce.Orders.OrderLineField> loop) 431 { 432 return loop 433 .OrderByDescending(o => o.SystemName == "OrderLineComment") 434 .ThenByDescending(o => o.SystemName == "OrderLineRetailPrice") 435 .ThenByDescending(o => o.SystemName == "OrderLineItemNumber") 436 .ThenByDescending(o => o.SystemName == "OrderLineEAN").ToList(); 437 } 438 439 bool IsInCart(ProductViewModel product) 440 { 441 var cart = Dynamicweb.Ecommerce.Common.Context.Cart; 442 if (cart != null) 443 { 444 foreach (var ol in cart.OrderLines) 445 { 446 if (ol.ProductId == product.Id) 447 { 448 return true; 449 } 450 } 451 } 452 return false; 453 } 454 455 string GetProductInfoValue(ProductInformation productInfo, string key) 456 { 457 if (productInfo.Values != null) 458 { 459 object value; 460 if (productInfo.Values.TryGetValue(key, out value)) 461 { 462 if (!string.IsNullOrEmpty(Converter.ToString(value))) 463 { 464 return Converter.ToString(value); 465 } 466 } 467 } 468 return string.Empty; 469 } 470 471 } 472 473 474 @* html helpers section *@ 475 476 477 @helper renderToolTip() 478 { 479 var jsSuggestionStock = "<span class='js-suggestion-stock'></span>"; 480 <div class="hide js-tooltip-content quantity-tooltip-content"> 481 <h4 class="title"> 482 @Translate("Smartpage:Product.PackageSizeCeiled", "Antallet vil blive opskrevet til") <span class="js-package-size-quantity"></span> <a href="#" data-toggle="tooltip" data-placement="top" class="js-package-size-single package-size-single" title='@Translate("Smartpage:Product.PackageSizeCeiled.singleProduct.Text", "Det ønskede antal vare stemmer ikke overens med kollistørrelsen")'><i class="glyphicon glyphicon-info-sign"></i></a> 483 </h4> 484 <button class="btn btn-xs btn-info js-package-size-cancel" data-toggle="clickover"><i class="glyphicon glyphicon-remove"></i></button> 485 <button class="btn btn-xs btn-primary js-package-size-ok" data-toggle="clickover"><i class="glyphicon glyphicon-ok"></i></button> 486 </div> 487 488 <div class="hide js-tooltip-smaller-quantity quantity-tooltip-content"> 489 <h4 class="title"> 490 @Translate("Smartpage:Popover.OutOfStockText.LessQuantity", "Varen blev ikke tilføjet til kurven, forsøg med et mindre antal") 491 </h4> 492 <button class="btn btn-xs btn-info js-close-out-of-stock" data-toggle="clickover"><i class="glyphicon glyphicon-ok"></i></button> 493 </div> 494 495 <div class="hide js-tooltip-stock-content quantity-tooltip-content"> 496 <h4 class="title"> 497 @Translate("Smartpage:Popover.OutOfStockText", "Varen blev ikke tilføjet til kurven, fordi vi har ikke flere på lager") 498 </h4> 499 <button class="btn btn-xs btn-info js-close-out-of-stock" data-toggle="clickover"><i class="glyphicon glyphicon-ok"></i></button> 500 </div> 501 502 <div class="hide js-tooltip-stock-suggestion quantity-tooltip-content"> 503 <h4 class="title"> 504 @Translate("Smartpage:Popover.OutOfStockText.Suggestion", String.Format("Vi har kun {0} på lager. Vil du ændre antal?", jsSuggestionStock)) 505 </h4> 506 <button class="btn btn-xs btn-info js-cancel-out-of-stock" data-toggle="clickover"><i class="glyphicon glyphicon-remove"></i></button> 507 <button class="btn btn-xs btn-info js-accept-out-of-stock" data-toggle="clickover"><i class="glyphicon glyphicon-ok"></i></button> 508 </div> 509 } 510 511 512 @helper AddedToCart(ProductViewModel i, string cssClass) 513 { 514 var cart = Dynamicweb.Ecommerce.Common.Context.Cart; 515 string cssIsInCart = !IsInCart(i) ? "hide" : ""; 516 517 if (cart != null) 518 { 519 foreach (var ol in cart.OrderLines) 520 { 521 if (ol.ProductId == i.Id) 522 { 523 cssIsInCart = "hide"; 524 } 525 } 526 } 527 528 <span class='label label-success js-in-cart in-cart @cssClass @cssIsInCart'><i class="glyphicon glyphicon-shopping-cart"></i> @Translate("Smartpage:AddedInCart", "added")</span> 529 } 530 531 @helper SingleAddedToCart(ProductViewModel product) 532 { 533 string cssIsInCart = !IsInCart(product) ? "hide" : ""; 534 <span class='label label-success in-cart js-in-cart product @cssIsInCart'><i class="glyphicon glyphicon-shopping-cart"></i> @Translate("Smartpage:AddedInCart", "added")</span> 535 } 536 537 @helper SingleStockStatus(ProductViewModel product) 538 { 539 bool outOfStock = product.StockLevel <= 0; 540 bool isServiceProduct = Dynamicweb.Ecommerce.Services.Products.GetProductById(product.Id, product.VariantId, true).Type == Dynamicweb.Ecommerce.Products.ProductType.Service; 541 542 <div class='stock-status single-product'> 543 @if (outOfStock && !isServiceProduct) 544 { 545 <span class="label label-danger js-out-of-stock">@Translate("Smartpage:OutOfStock", "Ikke på lager")</span> 546 } 547 </div> 548 } 549 550 @helper ListStockStatus(ProductViewModel i, string currentViewMode) 551 { 552 bool outOfStock = i.StockLevel <= 0; 553 bool isServiceProduct = Dynamicweb.Ecommerce.Services.Products.GetProductById(i.Id, i.VariantId, true).Type == Dynamicweb.Ecommerce.Products.ProductType.Service; 554 555 <div class='stock-status @currentViewMode'> 556 @if (outOfStock && !isServiceProduct) 557 { 558 <span class="label label-danger js-out-of-stock">@Translate("Smartpage:OutOfStock", "Ikke på lager")</span> 559 } 560 @if (!isServiceProduct && !outOfStock) { 561 <span class='label label-success'>@i.StockLevel @Translate("GASA.LeftOnStock", "left on stock")</span> 562 } 563 </div> 564 } 565 566 567 @helper PricesWithVATStatus(string positionCSS) { 568 if (DisplayPricesInclVat()) 569 { 570 <p class='vat-message text-muted text-center @positionCSS'>@Translate("Smartpage:PricesIncludeVAT.Message", "Alle priser er inkl. Moms")</p> 571 } 572 else 573 { 574 <p class='vat-message text-muted text-center @positionCSS'>@Translate("Smartpage:PricesDoNotIncludeVAT.Message", "Alle priser er ekskl. Moms")</p> 575 } 576 } 577 578 @helper RenderManufacturer(string manufacturerId, string manufacturerName, string manufacturerWebsiteUrl) 579 { 580 if (EnableManufacturerFiltering()) 581 { 582 var name = manufacturerName + "/" + manufacturerId; 583 if (!string.IsNullOrEmpty(manufacturerWebsiteUrl)) 584 { 585 <a class="manufacturer-info-link" href="@manufacturerWebsiteUrl" target="_blank">@name</a> 586 } 587 else 588 { 589 <span class="manufacturer-info">@name</span> 590 } 591 } 592 } 593 @inherits ViewModelTemplate<ProductListViewModel> 594 @using System.Web 595 @using Dynamicweb; 596 @using Dynamicweb.Rendering; 597 @using Dynamicweb.Ecommerce.ProductCatalog; 598 599 @helper RenderSearch() 600 { 601 @SnippetStart("NavigationGroups") 602 603 var originalLink = "/Default.aspx?ID=" + HttpContext.Current.Request["id"].ToString(); 604 605 string groupId = System.Web.HttpContext.Current.Request["GroupId"]; 606 string groupName = string.Empty; 607 608 if (!string.IsNullOrEmpty(groupId)) 609 { 610 var group = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(groupId); 611 if (group != null) 612 { 613 groupName = group.Name; 614 } 615 } 616 617 <button type="button" class="btn btn-default btn-square dropdown-toggle js-select-group-dropdown" id="js-search-filters" data-toggle="dropdown" aria-expanded="false" data-whole-site="false"><span class="js-text-label hidden-xs hidden-sm">@Translate("Smartpage:Search.Select.InCategory", "in") @groupName</span> <span class="caret"></span></button> 618 <ul class="dropdown-menu js-search-dropdown-menu" role="menu" id="js-search-filters"> 619 <li><a class="js-search-group-choice" href='@originalLink' data-whole-site="true">@Translate("Smartpage:Search.WholeSite", "Whole site")</a></li> 620 <li><a class="js-search-group-choice" href='@("/Default.aspx?ID=" + Pageview.Page.ID + "&GroupId=" + groupId)' data-whole-site="false">@Translate("Smartpage:Search.Select.InCategory", "in") @groupName</a></li> 621 </ul> 622 623 @SnippetEnd("NavigationGroups") 624 } 625 626 @inherits ViewModelTemplate<ProductListViewModel> 627 @using Dynamicweb; 628 @using Dynamicweb.Core; 629 @using Dynamicweb.Environment; 630 @using Dynamicweb.Rendering; 631 @using Dynamicweb.Ecommerce.ProductCatalog; 632 @using System.Linq; 633 @using Gasa.ProductInformation; 634 @using Gasa.PriceInformation; 635 @using Gasa.ProductInformation.Helpers; 636 @using Dynamicweb.Ecommerce.Prices; 637 638 @helper RenderListView() 639 { 640 <form method="post" class="js-basket-add js-set-tabindex js-product-form-container" autocomplete="false" data-submit-url='@Pageview.Area.Item["JsonCart"]'> 641 <input type="hidden" name="CartCmd" value="addmulti" /> 642 @{ 643 644 int pageNum = Math.Max(Dynamicweb.Context.Current.Request.GetInt32("PageNum"), 1); 645 var isLoggedIn = Dynamicweb.Security.UserManagement.User.IsExtranetUserLoggedIn(); 646 var defaultImage = !string.IsNullOrWhiteSpace(Converter.ToString(Pageview.Area.Item["DefaultImage"])) ? Converter.ToString(Pageview.Area.Item["DefaultImage"]) : "/Files/images/default-image.png"; 647 648 var baseLoopCounter = Model.PageSize * (pageNum - 1); 649 int productLoopCounter = 0; 650 651 var productService = Dynamicweb.Ecommerce.Services.Products; 652 var helperService = new CustomProductFieldHelpers(); 653 string currentPageLink = "/Default.aspx?ID=" + Pageview.Page.ID; 654 655 } 656 <div class="clearfix"></div> 657 <div class="col-sm-12"> 658 <div class="product-list list-group js-grid-group"> 659 660 @foreach (var i in Model.Products) 661 { 662 productLoopCounter++; 663 664 var manufacturerName = i.Manufacturer.Name; 665 var manufacturerWebsiteUrl = i.Manufacturer.Web; 666 var manufacturerId = i.Manufacturer.Id; 667 668 var product = productService.GetProductById(i.Id, i.VariantId, true); 669 var productInfo = new ProductInformation(product, Dynamicweb.Security.UserManagement.User.GetCurrentExtranetUser().CustomerNumber); 670 var priceInformation = new PriceInformation(product, productInfo); 671 672 string productLink = currentPageLink + "&amp;GroupId=" + product.PrimaryGroupId + "&amp;ProductID=" + product.Id; 673 674 var images = i.ImagePatternImages; 675 string image = defaultImage; 676 677 if (images.Any()) 678 { 679 image = images.FirstOrDefault().Value; 680 } 681 682 int minQty = Converter.ToInt32(helperService.GetFieldValue("MinimumPurchaseQuantityLimit", i.ProductFields)); 683 if (minQty == 0) 684 { 685 switch (Converter.ToString(helperService.GetFieldValue("MinimumPurchaseQuantity", i.ProductFields)).ToLower().Trim()) 686 { 687 case "layer": 688 minQty = productInfo.ColliPerLayer; 689 break; 690 case "cc": 691 minQty = productInfo.ColliPerCc; 692 break; 693 default: 694 minQty = 1; 695 break; 696 } 697 } 698 699 bool isDeliverable = string.IsNullOrEmpty(AvailableDeliveryDay(Converter.ToInt32(helperService.GetFieldValue("LeadDays", i.ProductFields)))); 700 701 string cssIDSelector = "js-" + i.Id; 702 703 <div class="list-group-item row js-product border-bottom js-grid-product" data-min-quantity='@minQty' id="@cssIDSelector" data-page-num="@pageNum"> 704 <div class="col-md-1 col-sm-2 list-group-item-img"> 705 @{ 706 var previewImageUrl = "/Admin/Public/getimage.ashx?Image=" + image + "&amp;Resolution=75&amp;Compression=70&amp;Width=500&amp;Height=500&amp;Crop=5"; 707 } 708 <a class="js-preview js-product-title" href='@productLink' data-preview='@previewImageUrl'> 709 @{ 710 var imageUrl = "/Admin/Public/getimage.ashx?Image=" + image + "&amp;Resolution=75&amp;Compression=70&amp;Width=50&amp;Height=50&amp;Crop=5&amp;altFmImage_path=" + defaultImage; 711 } 712 <img src="@imageUrl" alt='@HttpUtility.HtmlEncode(i.Name)' class="img-responsive" /> 713 </a> 714 715 @if (images.Count > 1) 716 { 717 <span class="label label-info label-amount-pictures"><i class="glyphicon glyphicon-picture"></i> @images.Count</span> 718 } 719 </div> 720 <div class="col-md-3 col-sm-4"> 721 722 <h2 class="grid-item-name grid-item-name-list"> 723 <a href="@productLink" class="js-product-title">@i.Name</a> 724 @if (Converter.ToBoolean(helperService.GetFieldValue("NewProduct", i.ProductFields))) 725 { 726 <span class="label label-warning">@Translate("Smartpage:NewProduct", "NEW")</span> 727 } 728 @if (Converter.ToBoolean(helperService.GetFieldValue("Bestseller", i.ProductFields))) 729 { 730 <span class="label label-warning">@Translate("Smartpage:Bestseller", "BESTSELLER")</span> 731 } 732 @if (!string.IsNullOrEmpty(Converter.ToString(helperService.GetFieldValue("NavCompanyCode", i.ProductFields)))) 733 { 734 var flagImgPath = "/Admin/Images/Flags/Small/flag_" + Converter.ToString(helperService.GetFieldValue("NavCompanyCode", i.ProductFields)) + ".png"; 735 <img src='@flagImgPath' alt='@Converter.ToString(helperService.GetFieldValue("NavCompanyCode", i.ProductFields))' title='@Converter.ToString(helperService.GetFieldValue("NavCompanyCode", i.ProductFields))' /> 736 } 737 </h2> 738 739 <div class="shortdescription"> 740 @AddedToCart(i, "standard") 741 <p>@i.ShortDescription</p> 742 @ListStockStatus(i, "list") 743 </div> 744 <div class="manufacturer-website hidden-sm hidden-xs"> 745 @RenderManufacturer(manufacturerId, manufacturerName, manufacturerWebsiteUrl) <br /> 746 @if (product.Height > 0) 747 { 748 @FormatDiameter("H: " + product.Height + " cm") 749 } 750 </div> 751 752 </div> 753 754 <div class="col-md-1 col-sm-5"> 755 <div class="potsize text-right hidden-sm hidden-xs "> 756 @FormatDiameter(Converter.ToString(helperService.GetFieldValue("ProductPotSize", i.ProductFields))) cm 757 </div> 758 <div class="hidden-md hidden-lg"> 759 @FormatDiameter(Converter.ToString(helperService.GetFieldValue("ProductPotSize", i.ProductFields))) 760 @RenderManufacturer(manufacturerId, manufacturerName, manufacturerWebsiteUrl) <br /> 761 @if (product.Height > 0) 762 { 763 @FormatDiameter("H: " + product.Height + " cm") 764 } 765 </div> 766 </div> 767 768 <div class="clearfix visible-sm"></div> 769 <div class="col-md-4 col-sm-6"> 770 @if (isLoggedIn) 771 { 772 <div class="product-price"> 773 <table class="table"> 774 <tbody> 775 <tr> 776 <td> 777 @Translate("Pcs", "Stk") 778 </td> 779 <td> 780 1 &times; 781 @productInfo.ColliSize 782 </td> 783 <td> 784 <span class="js-colli-per-layer">@productInfo.ColliPerLayer</span> 785 &times; @productInfo.ColliSize 786 </td> 787 <td> 788 <span class="js-colli-per-cc">@productInfo.ColliPerCc</span> 789 &times; @productInfo.ColliSize 790 </td> 791 </tr> 792 @if (!DisablePrices()) 793 { 794 795 <tr> 796 <td> 797 @Translate("price", "Pris") 798 </td> 799 <td class="js-product-field-price js-product-field-price-colli"> 800 @if (DisplayPricesInclVat()) 801 { 802 @:FormatPrice(@priceInformation.Prices.PricePerColliUnit.PriceWithVAT 803 } 804 else 805 { 806 @:@priceInformation.Prices.PricePerColliUnit.PriceWithoutVAT 807 } 808 </td> 809 <td class="js-product-field-price js-product-field-price-layer"> 810 @if (DisplayPricesInclVat()) 811 { 812 @:@priceInformation.Prices.PricePerLayerUnit.PriceWithVAT 813 } 814 else 815 { 816 @:@priceInformation.Prices.PricePerLayerUnit.PriceWithoutVAT 817 } 818 </td> 819 <td class="js-product-field-price js-product-field-price-cc"> 820 @if (DisplayPricesInclVat()) 821 { 822 @:@priceInformation.Prices.PricePerCcUnit.PriceWithVAT 823 } 824 else 825 { 826 @:@priceInformation.Prices.PricePerCcUnit.PriceWithoutVAT 827 } 828 </td> 829 </tr> 830 } 831 </tbody> 832 </table> 833 </div> 834 } 835 </div> 836 <br class="hidden-sm hidden-md hidden-lg" /> 837 <div class="col-md-3 col-sm-6"> 838 @if (isLoggedIn && product.VariantCount == 0) 839 { 840 var loopCounter = productLoopCounter + baseLoopCounter; 841 var nameProductLoopCounter = "ProductLoopCounter" + loopCounter; 842 var nameProductIdCounter = "ProductID" + loopCounter; 843 var nameVariantIdCounter = "VariantID" + loopCounter; 844 var nameUnitIdCounter = "UnitID" + loopCounter; 845 var namewishListIdCounter = "wishListID" + loopCounter; 846 var priceRetailValue = productInfo.CustomerRetailPrice; 847 var priceRetail = new PriceCalculated(new PriceRaw(priceRetailValue, Dynamicweb.Ecommerce.Common.Context.Currency)); 848 var retailPriceValue = DisplayPricesInclVat() ? Converter.ToString(priceRetail.PriceWithVAT) : Converter.ToString(priceRetail.PriceWithoutVAT); 849 retailPriceValue = Converter.ToInt32(retailPriceValue) == 0 ? "" : FormatPrice(retailPriceValue); 850 851 <input type="hidden" value='@loopCounter' name='@nameProductLoopCounter'> 852 <input type="hidden" class="js-product-id" value='@i.Id' name="@nameProductIdCounter"> 853 <input type="hidden" value="" name="@nameVariantIdCounter"> 854 <input type="hidden" value="" name="@nameUnitIdCounter"> 855 <input type="hidden" value="0" name="@namewishListIdCounter"> 856 857 if (isDeliverable) 858 { 859 <div class="row"> 860 @renderToolTip() 861 <div class="col-xs-3 js-quantity-tooltip" data-placement="right" data-toggle="popover" data-trigger="manual"> 862 @{ 863 var quantityFieldName = "Quantity" + loopCounter; 864 bool isServiceProduct = product.Type == Dynamicweb.Ecommerce.Products.ProductType.Service; 865 866 var placeholder = minQty > 0 ? String.Format("min. {0}", minQty) : minQty.ToString(); 867 868 <div class="product-list-number"> 869 <input type="number" min="0" name='@quantityFieldName' tabindex='@loopCounter' data-is-service="@isServiceProduct" data-stock-status='@i.StockLevel' class="form-control js-quantity text-right" placeholder="@placeholder" /> 870 </div> 871 } 872 </div> 873 874 <div class="col-xs-9"> 875 @foreach (var o in product.OrderLineFields) 876 { 877 var inputName = "EcomOrderLineFieldInput_" + o.Name + loopCounter; 878 string placeholderText = o.Name; 879 switch (o.SystemName) 880 { 881 case "OrderLineComment": 882 if (EnableComments()) 883 { 884 placeholderText = Translate("LineComment", "Comment"); 885 <input type="text" class="form-control" maxlength="80" name="@inputName" placeholder="@placeholderText" /> 886 } 887 break; 888 case "OrderLineColliSize": 889 <input type="hidden" name="@inputName" value='@productInfo.ColliSize' /> 890 break; 891 case "OrderLineColliPerLayer": 892 <input type="hidden" name="@inputName" value='@productInfo.ColliPerLayer' /> 893 break; 894 case "OrderLineColliPerCC": 895 <input type="hidden" name="@inputName" value='@productInfo.ColliPerCc' /> 896 break; 897 case "OrderLineRetailPrice": 898 placeholderText = Translate("Smartpage:eCom:CustomerSpecificInfo.RetailPrice", "Add retail price"); 899 <div class="hidden"> 900 <input type="text" id="js-retail-price-@loopCounter" class="form-control js-retail-price-input js-product-field-replace text-right" data-replace-target=".js-product-field-retail-price" name="@inputName" value='@retailPriceValue' placeholder="@placeholderText" /> 901 </div> 902 break; 903 case "OrderLineItemNumber": 904 placeholderText = Translate("Smartpage:eCom:CustomerSpecificInfo.ItemNumber", "Item no."); 905 <div class="hidden"> 906 <input type="text" id="js-item-number-@loopCounter" class="form-control js-product-field-replace text-right" data-replace-target=".js-product-field-item-number" name="@inputName" value='@productInfo.CustomerItemNumber.Trim()' placeholder="@placeholderText" /> 907 </div> 908 break; 909 case "OrderLineEAN": 910 placeholderText = Translate("Deres_EAN_nummer-short", "EAN"); 911 912 <div class="hidden"> 913 <div class="editable" data-placeholder="my placeholder"> 914 <input type="text" id="js-ean-number-@loopCounter" class="form-control js-product-field-replace text-right" data-replace-target=".js-product-field-ean" name="@inputName" value='@productInfo.EAN.Trim()' placeholder="@placeholderText" /> 915 </div> 916 </div> 917 918 break; 919 default: 920 <text>@inputName</text> 921 break; 922 } 923 } 924 </div> 925 </div> 926 } 927 928 if (EnableDisplayOfGrossMargin() && isDeliverable) 929 { 930 var pricePerColliUnit = priceInformation.Prices.PricePerColliUnit; 931 double customerSalesPrice = DisplayPricesInclVat() ? pricePerColliUnit.PriceWithVAT : pricePerColliUnit.PriceWithoutVAT; 932 933 <div class="row"> 934 <div class="col-sm-12 col-md-12 col-lg-offset-3 col-lg-9 text-right product-retail-price product-gross-margin-list"> 935 <i class="js-product-field-gross-margin text-muted"> 936 <span class="pull-left">@Translate("Smartpage:eCom:CustomerSpecificInfo.GrossMargin", "Gross margin")</span> 937 <span class="pull-right js-gross-margin-value"> 938 @if (priceRetail.Price > 0) 939 { 940 @GetGrossMargin(priceRetail.Price, customerSalesPrice); 941 } 942 else 943 { 944 @Translate("Smartpage:ecom:CustomerSpecificInfo.GrossMargin.NA", "N/A") 945 } 946 </span> 947 </i> 948 </div> 949 </div> 950 } 951 952 if (EnableCustomerRetailPrice() && isDeliverable) 953 { 954 <div class="row"> 955 <div class="col-sm-12 col-md-12 col-lg-offset-3 col-lg-9 text-right product-retail-price product-editable-area"> 956 957 @if (EnableEditableRetailPrice() && isDeliverable && !String.IsNullOrEmpty(Converter.ToString(priceRetail.Price))) 958 { 959 <div class="product-selectable-edit pull-right"> 960 <i class="glyphicon glyphicon-edit js-product-fields-edit product-fields-edit" data-source="#js-retail-price-@loopCounter"></i> 961 </div> 962 } 963 <div class="js-product-field-retail-price"> 964 <span class="pull-left">@Translate("Smartpage:eCom:CustomerSpecificInfo.RetailPrice", "Retail price")</span> 965 <span class="pull-right">@retailPriceValue</span> 966 </div> 967 </div> 968 </div> 969 } 970 971 if (EnableCustomerItemNumber()) 972 { 973 <div class="row"> 974 975 <div class="col-sm-12 col-md-12 col-lg-offset-3 col-lg-9 text-right product-item-number product-editable-area"> 976 977 @if (EnableEditableItemNumber() && isDeliverable) 978 { 979 <div class="product-selectable-edit pull-right"> 980 <i class="glyphicon glyphicon-edit js-product-fields-edit product-fields-edit" data-source="#js-item-number-@loopCounter"></i> 981 </div> 982 } 983 <div class="js-product-field-item-number text-left"> 984 <span class="pull-left">@Translate("Smartpage:eCom:CustomerSpecificInfo.ItemNumber", "Item no.")</span> 985 <span class="pull-right">@productInfo.CustomerItemNumber</span> 986 </div> 987 </div> 988 </div> 989 } 990 <div class="row"> 991 <div class="hidden-xs col-sm-3 hidden-md hidden-lg"></div> 992 <div class="col-sm-12 col-md-12 col-lg-offset-3 col-lg-9 text-right product-editable-area"> 993 @if (EnableEditableBarcode() && isDeliverable && !String.IsNullOrEmpty(productInfo.EAN)) 994 { 995 <div class="product-selectable-edit pull-right"> 996 <i class="glyphicon glyphicon-edit js-product-fields-edit product-fields-edit" data-source="#js-ean-number-@loopCounter"></i> 997 </div> 998 } 999 @if (EnableCustomerBarcode() && !String.IsNullOrEmpty(productInfo.EAN)) 1000 { 1001 <div class="js-product-field-ean text-left"> 1002 <span class="pull-left">@Translate("Deres_EAN_nummer-short", "EAN")</span> 1003 <span class="pull-right">@productInfo.EAN</span> 1004 </div> 1005 } 1006 </div> 1007 </div> 1008 1009 if (!isDeliverable) 1010 { 1011 <div class="row"> 1012 <div class="hidden-xs col-sm-3 hidden-md hidden-lg"></div> 1013 <div class="col-sm-9 col-md-12 col-lg-offset-3 col-lg-9 product-editable-area"> 1014 <p>@Translate("Smartpage:Ecom.LeadDaysWarning", "Available on") <span class="label label-warning">@AvailableDeliveryDay(Converter.ToInt32(helperService.GetFieldValue("LeadDays", i.ProductFields)))</span></p> 1015 </div> 1016 </div> 1017 } 1018 1019 } 1020 </div> 1021 </div> 1022 } 1023 </div> 1024 1025 </div> 1026 1027 <input type="submit" value="Add to basket" class="sr-only" /> 1028 1029 @if (isLoggedIn) 1030 { 1031 @SnippetStart("SmartpageAddToBasket") 1032 <button class="btn btn-primary btn-block btn-lg js-submit-form" data-form-selector=".js-basket-add">@Translate("Smartpage:eCom.AddToCart", "Læg i kurven")</button> 1033 @SnippetEnd("SmartpageAddToBasket") 1034 } 1035 </form> 1036 } 1037 1038 @inherits ViewModelTemplate<ProductListViewModel> 1039 @using Dynamicweb; 1040 @using Dynamicweb.Core; 1041 @using Dynamicweb.Environment; 1042 @using Dynamicweb.Rendering; 1043 @using Dynamicweb.Ecommerce.ProductCatalog; 1044 @using System.Linq; 1045 @using Gasa.ProductInformation; 1046 @using Gasa.PriceInformation; 1047 @using Gasa.ProductInformation.Helpers; 1048 @using Dynamicweb.Ecommerce.Prices; 1049 1050 @helper RenderPhotoView() 1051 { 1052 <form method="post" class="js-basket-add js-set-tabindex row js-product-form-container" autocomplete="false" data-submit-url='@Pageview.Area.Item["JsonCart"]'> 1053 <input type="hidden" name="CartCmd" value="addmulti" /> 1054 @{ 1055 1056 var isLoggedIn = Dynamicweb.Security.UserManagement.User.IsExtranetUserLoggedIn(); 1057 var pagenum = 1; 1058 var defaultImage = !string.IsNullOrWhiteSpace(Converter.ToString(Pageview.Area.Item["DefaultImage"])) ? Converter.ToString(Pageview.Area.Item["DefaultImage"]) : "/Files/images/default-image.png"; 1059 1060 if (Dynamicweb.Context.Current.Request.GetInt32("pagenum") > 0) 1061 { 1062 pagenum = Dynamicweb.Context.Current.Request.GetInt32("pagenum"); 1063 } 1064 1065 var baseLoopCounter = Model.PageSize * (pagenum - 1); 1066 int productLoopCounter = 0; 1067 1068 var productService = Dynamicweb.Ecommerce.Services.Products; 1069 var helperService = new CustomProductFieldHelpers(); 1070 string currentPageLink = "/Default.aspx?ID=" + Pageview.Page.ID; 1071 1072 } 1073 <div class="col-xs-12"> 1074 <div class="product-grid photo-group js-grid-group"> 1075 @foreach (var i in Model.Products) 1076 { 1077 productLoopCounter++; 1078 1079 var manufacturerName = i.Manufacturer.Name; 1080 var manufacturerWebsiteUrl = i.Manufacturer.Web; 1081 var manufacturerId = i.Manufacturer.Id; 1082 1083 var product = productService.GetProductById(i.Id, i.VariantId, true); 1084 var productInfo = new ProductInformation(product, Dynamicweb.Security.UserManagement.User.GetCurrentExtranetUser().CustomerNumber); 1085 var priceInformation = new PriceInformation(product, productInfo); 1086 1087 string productLink = currentPageLink + "&amp;GroupId=" + product.PrimaryGroupId + "&amp;ProductID=" + product.Id; 1088 1089 var images = i.ImagePatternImages; 1090 string image = defaultImage; 1091 1092 if (images.Any()) 1093 { 1094 image = images.FirstOrDefault().Value; 1095 } 1096 1097 int minQty = Converter.ToInt32(helperService.GetFieldValue("MinimumPurchaseQuantityLimit", i.ProductFields)); 1098 if (minQty == 0) 1099 { 1100 switch (Converter.ToString(helperService.GetFieldValue("MinimumPurchaseQuantity", i.ProductFields)).ToLower().Trim()) 1101 { 1102 case "layer": 1103 minQty = productInfo.ColliPerLayer; 1104 break; 1105 case "cc": 1106 minQty = productInfo.ColliPerCc; 1107 break; 1108 default: 1109 minQty = 1; 1110 break; 1111 } 1112 } 1113 1114 bool isDeliverable = string.IsNullOrEmpty(AvailableDeliveryDay(Converter.ToInt32(helperService.GetFieldValue("LeadDays", i.ProductFields)))); 1115 string cssIDSelector = "js-" + i.Id; 1116 1117 <div class='photo-group-item col-xs-12 clearfix js-product js-grid-product' data-min-quantity="@minQty" id="@cssIDSelector"> 1118 <div class="col-sm-6 col-md-3"> 1119 <div class="photo-group-item-img"> 1120 <a href='@productLink' class="js-product-title"> 1121 @{ 1122 var imageUrl = "/Admin/Public/getimage.ashx?Image=" + image + "&amp;Resolution=75&amp;Compression=70&amp;Width=190&amp;Height=190&amp;Crop=5&amp;altFmImage_path=" + defaultImage; 1123 } 1124 <img src="@imageUrl" alt='@HttpUtility.HtmlEncode(i.Name)' class="img-responsive" /> 1125 </a> 1126 @if (images.Count > 1) 1127 { 1128 <span class="label label-info label-amount-pictures"><i class="glyphicon glyphicon-picture"></i> @images.Count</span> 1129 } 1130 @AddedToCart(i, "absolute") 1131 </div> 1132 </div> 1133 1134 <div class="col-sm-6 col-md-4 photo-group-item-details"> 1135 <h2 class="grid-item-name grid-item-name-photo"> 1136 <a href="@productLink" class="js-product-title">@i.Name</a> 1137 @if (Converter.ToBoolean(helperService.GetFieldValue("NewProduct", i.ProductFields))) 1138 { 1139 <span class="label label-warning">@Translate("Smartpage:NewProduct", "NEW")</span> 1140 } 1141 @if (Converter.ToBoolean(helperService.GetFieldValue("Bestseller", i.ProductFields))) 1142 { 1143 <span class="label label-warning">@Translate("Smartpage:Bestseller", "BESTSELLER")</span> 1144 } 1145 @if (!string.IsNullOrEmpty(Converter.ToString(helperService.GetFieldValue("NavCompanyCode", i.ProductFields)))) 1146 { 1147 var flagImgPath = "/Admin/Images/Flags/Small/flag_" + Converter.ToString(helperService.GetFieldValue("NavCompanyCode", i.ProductFields)) + ".png"; 1148 <img src='@flagImgPath' alt='@Converter.ToString(helperService.GetFieldValue("NavCompanyCode", i.ProductFields))' title='@Converter.ToString(helperService.GetFieldValue("NavCompanyCode", i.ProductFields))' /> 1149 } 1150 </h2> 1151 <div class="product-description"> 1152 @i.ShortDescription 1153 @ListStockStatus(i, "photo") 1154 </div> 1155 <div class="product-unit"> 1156 &Oslash; @FormatDiameter(Converter.ToString(helperService.GetFieldValue("ProductPotSize", i.ProductFields)) + " cm H: " + product.Height) cm <br /> 1157 @RenderManufacturer(manufacturerId, manufacturerName, manufacturerWebsiteUrl) 1158 </div> 1159 1160 @if (isLoggedIn) 1161 { 1162 <div class="product-price"> 1163 <table class="table"> 1164 <thead> 1165 <tr> 1166 <td>&nbsp;</td> 1167 <th> 1168 <div class="pictogram"> 1169 <div class="pictogram-box"></div> 1170 </div> 1171 </th> 1172 <th> 1173 <div class="pictogram"> 1174 <div class="pictogram-layer"></div> 1175 </div> 1176 </th> 1177 <th> 1178 <div class="pictogram"> 1179 <div class="pictogram-container"></div> 1180 </div> 1181 </th> 1182 </tr> 1183 </thead> 1184 <tbody> 1185 <tr> 1186 <td> 1187 @Translate("Pcs", "Stk") 1188 </td> 1189 <td> 1190 1 &times; 1191 @productInfo.ColliSize 1192 </td> 1193 <td> 1194 <span class="js-colli-per-layer">@productInfo.ColliPerLayer</span> 1195 &times; @productInfo.ColliSize 1196 </td> 1197 <td> 1198 <span class="js-colli-per-cc">@productInfo.ColliPerCc</span> 1199 &times; @productInfo.ColliSize 1200 </td> 1201 </tr> 1202 @if (!DisablePrices()) 1203 { 1204 1205 <tr> 1206 <td> 1207 @Translate("price", "Pris") 1208 </td> 1209 <td class="js-product-field-price-colli"> 1210 @if (DisplayPricesInclVat()) 1211 { 1212 @:@priceInformation.Prices.PricePerColliUnit.PriceWithVAT 1213 } 1214 else 1215 { 1216 @:@priceInformation.Prices.PricePerColliUnit.PriceWithoutVAT 1217 } 1218 </td> 1219 <td class="js-product-field-price-layer"> 1220 @if (DisplayPricesInclVat()) 1221 { 1222 @:@priceInformation.Prices.PricePerLayerUnit.PriceWithVAT 1223 } 1224 else 1225 { 1226 @:@priceInformation.Prices.PricePerLayerUnit.PriceWithoutVAT 1227 } 1228 </td> 1229 <td class="js-product-field-price-cc"> 1230 @if (DisplayPricesInclVat()) 1231 { 1232 @:@priceInformation.Prices.PricePerCcUnit.PriceWithVAT 1233 } 1234 else 1235 { 1236 @:@priceInformation.Prices.PricePerCcUnit.PriceWithoutVAT 1237 } 1238 </td> 1239 </tr> 1240 } 1241 </tbody> 1242 </table> 1243 </div> 1244 } 1245 </div> 1246 1247 <div class="clearfix visible-sm visible-xs"></div> 1248 <div class="col-md-5 col-sm-6 hidden-xs"></div> 1249 <div class="col-md-5 col-sm-6 col-xs-12"> 1250 <div class="product-informations"> 1251 @{ 1252 string customerSpecificRemark = GetProductInfoValue(productInfo, "CustomerSpecificRemark"); 1253 1254 if (!string.IsNullOrWhiteSpace(customerSpecificRemark)) 1255 { 1256 <span class="detail-info"> 1257 @Translate("Deres_bemaerkning", "Your Comment"): @customerSpecificRemark 1258 </span> 1259 } 1260 } 1261 <br /> 1262 </div> 1263 <div class="product-photo-price"> 1264 @if (isLoggedIn) 1265 { 1266 var loopCounter = productLoopCounter + baseLoopCounter; 1267 var nameProductLoopCounter = "ProductLoopCounter" + loopCounter; 1268 var nameProductIdCounter = "ProductID" + loopCounter; 1269 var nameVariantIdCounter = "VariantID" + loopCounter; 1270 var nameUnitIdCounter = "UnitID" + loopCounter; 1271 var namewishListIdCounter = "wishListID" + loopCounter; 1272 var cssIsAvailable = isDeliverable ? "available" : "not-available"; 1273 var priceRetailValue = productInfo.CustomerRetailPrice; 1274 var priceRetail = new PriceCalculated(new PriceRaw(priceRetailValue, Dynamicweb.Ecommerce.Common.Context.Currency)); 1275 var retailPriceValue = DisplayPricesInclVat() ? Converter.ToString(priceRetail.PriceWithVAT) : Converter.ToString(priceRetail.PriceWithoutVAT); 1276 retailPriceValue = Converter.ToInt32(retailPriceValue) == 0 ? "" : FormatPrice(retailPriceValue); 1277 1278 <input type="hidden" value='@loopCounter' name='@nameProductLoopCounter'> 1279 <input type="hidden" value='@i.Id' name="@nameProductIdCounter"> 1280 <input type="hidden" value="" name="@nameVariantIdCounter"> 1281 <input type="hidden" value="" name="@nameUnitIdCounter"> 1282 <input type="hidden" value="0" name="@namewishListIdCounter"> 1283 1284 <div class='row product-photo-price-element @cssIsAvailable'> 1285 1286 @if (EnableDisplayOfGrossMargin() && isDeliverable) 1287 { 1288 var pricePerColliUnit = priceInformation.Prices.PricePerColliUnit; 1289 double customerSalesPrice = DisplayPricesInclVat() ? pricePerColliUnit.PriceWithVAT : pricePerColliUnit.PriceWithoutVAT; 1290 <div class="col-xs-9 col-xs-offset-3 product-editable-area"> 1291 <i class="js-product-field-gross-margin text-muted"> 1292 <span class="pull-left">@Translate("Smartpage:eCom:CustomerSpecificInfo.GrossMargin", "Gross margin")</span> 1293 <span class="pull-right js-gross-margin-value"> 1294 @if (priceRetail.Price > 0) 1295 { 1296 @GetGrossMargin(priceRetail.Price, customerSalesPrice); 1297 } 1298 else 1299 { 1300 @Translate("Smartpage:ecom:CustomerSpecificInfo.GrossMargin.NA", "N/A") 1301 } 1302 </span> 1303 </i> 1304 </div> 1305 } 1306 1307 @if (EnableCustomerRetailPrice() && isDeliverable) 1308 { 1309 var formattedRetailPrice = DisplayPricesInclVat() ? priceRetail.PriceWithVATFormatted : priceRetail.PriceWithoutVATFormatted; 1310 formattedRetailPrice = Converter.ToDouble(formattedRetailPrice) == 0.00 ? "" : formattedRetailPrice; 1311 <div class="col-xs-9 col-xs-offset-3 product-editable-area"> 1312 1313 @if (EnableEditableRetailPrice() && isDeliverable && !String.IsNullOrEmpty(Converter.ToString(priceRetailValue))) 1314 { 1315 <div class="product-selectable-edit pull-right"> 1316 <i class="glyphicon glyphicon-edit js-product-fields-edit product-fields-edit" data-source="#js-retail-price-@loopCounter"></i> 1317 </div> 1318 } 1319 <div class="js-product-field-retail-price"> 1320 <span class="pull-left">@Translate("Smartpage:eCom:CustomerSpecificInfo.RetailPrice", "Retail price")</span> 1321 <span class="pull-right">@retailPriceValue</span> 1322 </div> 1323 </div> 1324 } 1325 1326 @if (EnableCustomerItemNumber()) 1327 { 1328 <div class="col-xs-9 col-xs-offset-3 product-editable-area"> 1329 1330 @if (EnableEditableItemNumber() && isDeliverable) 1331 { 1332 <div class="product-selectable-edit pull-right"> 1333 <i class="glyphicon glyphicon-edit js-product-fields-edit product-fields-edit" data-source="#js-item-number-@loopCounter"></i> 1334 </div> 1335 } 1336 <div class="js-product-field-item-number text-left"> 1337 <span class="pull-left">@Translate("Smartpage:eCom:CustomerSpecificInfo.ItemNumber", "Item no.")</span> 1338 <span class="pull-right">@productInfo.CustomerItemNumber</span> 1339 </div> 1340 </div> 1341 } 1342 1343 1344 <div class="col-xs-9 col-xs-offset-3 product-editable-area"> 1345 @if (EnableEditableBarcode() && isDeliverable) 1346 { 1347 <div class="pull-right product-selectable-edit"> 1348 <i class="glyphicon glyphicon-edit pull-right js-product-fields-edit product-fields-edit" data-source="#js-ean-number-@loopCounter"></i> 1349 </div> 1350 } 1351 @if (EnableCustomerBarcode() && !String.IsNullOrEmpty(productInfo.EAN)) 1352 { 1353 <div class="js-product-field-ean text-left"> 1354 <span class="pull-left">@Translate("Deres_EAN_nummer", "EAN")</span> 1355 <span class="pull-right">@productInfo.EAN</span> 1356 </div> 1357 } 1358 </div> 1359 1360 @if (isDeliverable) 1361 { 1362 var placeholder = minQty > 0 ? String.Format("min. {0}", minQty) : minQty.ToString(); 1363 1364 <div class="col-xs-3 js-quantity-tooltip" data-placement="top" data-toggle="popover" data-trigger="manual"> 1365 @renderToolTip() 1366 @{ 1367 var quantityFieldName = "Quantity" + loopCounter; 1368 bool isServiceProduct = product.Type == Dynamicweb.Ecommerce.Products.ProductType.Service; 1369 1370 <div class="form-group"> 1371 <input type="number" min="0" name='@quantityFieldName' tabindex='@loopCounter' data-is-service="@isServiceProduct" data-stock-status='@i.StockLevel' class="form-control text-right js-quantity" placeholder="@placeholder" /> 1372 </div> 1373 } 1374 </div> 1375 <div class="col-xs-9"> 1376 @foreach (Dynamicweb.Ecommerce.Orders.OrderLineField o in SortOrderLineFields(product.OrderLineFields)) 1377 { 1378 var inputName = "EcomOrderLineFieldInput_" + o.Name + loopCounter; 1379 string placeholderText = o.Name; 1380 1381 switch (o.SystemName) 1382 { 1383 case "OrderLineComment": 1384 if (EnableComments()) 1385 { 1386 placeholderText = Translate("LineComment", "Comment"); 1387 <div class="form-group"> 1388 <input type="text" class="form-control" maxlength="80" name="@inputName" placeholder="@placeholderText" /> 1389 </div> 1390 } 1391 break; 1392 case "OrderLineColliSize": 1393 <input type="hidden" name="@inputName" value='@productInfo.ColliSize' /> 1394 break; 1395 case "OrderLineColliPerLayer": 1396 <input type="hidden" name="@inputName" value='@productInfo.ColliPerLayer' /> 1397 break; 1398 case "OrderLineColliPerCC": 1399 <input type="hidden" name="@inputName" value='@productInfo.ColliPerCc' /> 1400 break; 1401 case "OrderLineRetailPrice": 1402 placeholderText = Translate("Smartpage:eCom:CustomerSpecificInfo.RetailPrice", "Add retail price"); 1403 <div class="hidden"> 1404 <input type="text" id="js-retail-price-@loopCounter" class="form-control js-product-field-replace js-retail-price-input text-right" data-replace-target=".js-product-field-retail-price" name="@inputName" value='@retailPriceValue' placeholder="@placeholderText" /> 1405 </div> 1406 break; 1407 case "OrderLineItemNumber": 1408 placeholderText = Translate("Smartpage:eCom:CustomerSpecificInfo.ItemNumber", "Item no."); 1409 <div class="hidden"> 1410 <input type="text" id="js-item-number-@loopCounter" class="form-control js-product-field-replace text-right" data-replace-target=".js-product-field-item-number" name="@inputName" value='@productInfo.CustomerItemNumber.Trim()' placeholder="@placeholderText" /> 1411 </div> 1412 break; 1413 case "OrderLineEAN": 1414 placeholderText = Translate("Deres_EAN_nummer-short", "EAN"); 1415 <div class="hidden"> 1416 <input type="text" class="form-control js-product-field-replace text-right" id="js-ean-number-@loopCounter" data-replace-target=".js-product-field-ean" name="@inputName" value='@productInfo.EAN.Trim()' placeholder="@placeholderText" /> 1417 </div> 1418 break; 1419 } 1420 } 1421 </div> 1422 } 1423 else 1424 { 1425 <div class="col-xs-9 col-xs-offset-3"> 1426 <span class="pull-left">@Translate("Smartpage:Ecom.LeadDaysWarning.Short", "Available on")</span> <span class="label label-warning pull-right not-deliverable">@AvailableDeliveryDay(Converter.ToInt32(helperService.GetFieldValue("LeadDays", i.ProductFields)))</span> 1427 </div> 1428 } 1429 </div> 1430 } 1431 </div> 1432 </div> 1433 </div> 1434 } 1435 </div> 1436 </div> 1437 1438 <input type="submit" value="Add to basket" class="sr-only" /> 1439 1440 @if (isLoggedIn) 1441 { 1442 @SnippetStart("SmartpageAddToBasket") 1443 <button class="btn btn-primary btn-block btn-lg js-submit-form" data-form-selector=".js-basket-add">@Translate("Smartpage:eCom.AddToCart", "Læg i kurven")</button> 1444 @SnippetEnd("SmartpageAddToBasket") 1445 } 1446 </form> 1447 } 1448 1449 1450 @inherits ViewModelTemplate<ProductListViewModel> 1451 @using Dynamicweb; 1452 @using Dynamicweb.Core; 1453 @using Dynamicweb.Environment; 1454 @using Dynamicweb.Rendering; 1455 @using Dynamicweb.Ecommerce.ProductCatalog; 1456 @using System.Linq; 1457 @using Gasa.ProductInformation; 1458 @using Gasa.PriceInformation; 1459 @using Gasa.ProductInformation.Helpers; 1460 @using Dynamicweb.Ecommerce.Prices; 1461 1462 @helper RenderQuicklistView() 1463 { 1464 <form method="post" class="js-basket-add js-set-tabindex js-product-form-container" autocomplete="false" data-submit-url='@Pageview.Area.Item["JsonCart"]'> 1465 <input type="hidden" name="CartCmd" value="addmulti" /> 1466 @{ 1467 1468 int pageNum = Math.Max(Dynamicweb.Context.Current.Request.GetInt32("PageNum"), 1); 1469 var isLoggedIn = Dynamicweb.Security.UserManagement.User.IsExtranetUserLoggedIn(); 1470 var pagenum = 1; 1471 var defaultImage = !string.IsNullOrWhiteSpace(Converter.ToString(Pageview.Area.Item["DefaultImage"])) ? Converter.ToString(Pageview.Area.Item["DefaultImage"]) : "/Files/images/default-image.png"; 1472 1473 if (Dynamicweb.Context.Current.Request.GetInt32("pagenum") > 0) 1474 { 1475 pagenum = Dynamicweb.Context.Current.Request.GetInt32("pagenum"); 1476 } 1477 1478 var baseLoopCounter = Model.PageSize * (pageNum - 1); 1479 int productLoopCounter = 0; 1480 1481 var productService = Dynamicweb.Ecommerce.Services.Products; 1482 var helperService = new CustomProductFieldHelpers(); 1483 string currentPageLink = "/Default.aspx?ID=" + Pageview.Page.ID; 1484 1485 } 1486 <div class="clearfix"></div> 1487 <div class="col-sm-12"> 1488 <div class="product-list list-group js-grid-group"> 1489 1490 @foreach (var i in Model.Products) 1491 { 1492 1493 productLoopCounter++; 1494 1495 var manufacturerName = i.Manufacturer.Name; 1496 var manufacturerWebsiteUrl = i.Manufacturer.Web; 1497 var manufacturerId = i.Manufacturer.Id; 1498 1499 var product = productService.GetProductById(i.Id, i.VariantId, true); 1500 var productInfo = new ProductInformation(product, Dynamicweb.Security.UserManagement.User.GetCurrentExtranetUser().CustomerNumber); 1501 var priceInformation = new PriceInformation(product, productInfo); 1502 1503 string productLink = currentPageLink + "&amp;GroupId=" + product.PrimaryGroupId + "&amp;ProductID=" + product.Id; 1504 1505 var images = i.ImagePatternImages; 1506 string image = defaultImage; 1507 1508 if (images.Any()) 1509 { 1510 image = images.FirstOrDefault().Value; 1511 } 1512 1513 int minQty = Converter.ToInt32(helperService.GetFieldValue("MinimumPurchaseQuantityLimit", i.ProductFields)); 1514 if (minQty == 0) 1515 { 1516 switch (Converter.ToString(helperService.GetFieldValue("MinimumPurchaseQuantity", i.ProductFields)).ToLower().Trim()) 1517 { 1518 case "layer": 1519 minQty = productInfo.ColliPerLayer; 1520 break; 1521 case "cc": 1522 minQty = productInfo.ColliPerCc; 1523 break; 1524 default: 1525 minQty = 1; 1526 break; 1527 } 1528 } 1529 1530 bool isDeliverable = string.IsNullOrEmpty(AvailableDeliveryDay(Converter.ToInt32(helperService.GetFieldValue("LeadDays", i.ProductFields)))); 1531 1532 string cssIDSelector = "js-" + i.Id; 1533 1534 <div class="list-group-item row js-product border-bottom js-grid-product" data-min-quantity='@minQty' id="@cssIDSelector" data-page-num="@pageNum"> 1535 1536 <div class="col-sm-4"> 1537 1538 <h2 class="grid-item-name-list grid-item-name"> 1539 1540 @{ 1541 var previewImageUrl = "/Admin/Public/Getimage.ashx?Image=" + image + "&amp;Resolution=75&amp;Compression=70&amp;Width=500&amp;Height=500&amp;Crop=5&amp;AlternativeImage=" + defaultImage; 1542 var imageUrl = "/Admin/Public/Getimage.ashx?Image=" + image + "&amp;Resolution=75&amp;Compression=70&amp;Width=15&amp;Height=15&amp;Crop=5&amp;AlternativeImage=" + defaultImage; 1543 } 1544 1545 <a class="js-preview" href='@productLink' data-preview='@previewImageUrl'> 1546 <img src="@imageUrl" alt='@HttpUtility.HtmlEncode(i.Name)' class="img-responsive" style="display:inline-block;border:1px solid #8ec13c;" /> 1547 </a> 1548 1549 <a href="@productLink" class="js-product-title">@i.Name</a> 1550 1551 @if (Converter.ToBoolean(helperService.GetFieldValue("NewProduct", i.ProductFields))) 1552 { 1553 <span class="label label-warning">@Translate("Smartpage:NewProduct", "NEW")</span> 1554 } 1555 @if (Converter.ToBoolean(helperService.GetFieldValue("Bestseller", i.ProductFields))) 1556 { 1557 <span class="label label-warning">@Translate("Smartpage:Bestseller", "BESTSELLER")</span> 1558 } 1559 @if (!string.IsNullOrEmpty(Converter.ToString(helperService.GetFieldValue("NavCompanyCode", i.ProductFields)))) 1560 { 1561 var flagImgPath = "/Admin/Images/Flags/Small/flag_" + Converter.ToString(helperService.GetFieldValue("NavCompanyCode", i.ProductFields)) + ".png"; 1562 <img src='@flagImgPath' alt='@Converter.ToString(helperService.GetFieldValue("NavCompanyCode", i.ProductFields))' title='@Converter.ToString(helperService.GetFieldValue("NavCompanyCode", i.ProductFields))' /> 1563 } 1564 1565 </h2> 1566 1567 <div class="shortdescription"> 1568 @AddedToCart(i, "standard") 1569 <p style="margin:0;">@i.ShortDescription</p> 1570 @ListStockStatus(i, "list") 1571 </div> 1572 1573 <div class="manufacturer-website hidden-sm hidden-xs"> 1574 @RenderManufacturer(manufacturerId, manufacturerName, manufacturerWebsiteUrl) <br /> 1575 </div> 1576 1577 </div> 1578 <div class="col-md-1 col-sm-5"> 1579 <div class="potsize text-right hidden-sm hidden-xs "> 1580 @FormatDiameter(Converter.ToString(helperService.GetFieldValue("ProductPotSize", i.ProductFields)) + " cm ") 1581 </div> 1582 <div class="hidden-md hidden-lg"> 1583 @FormatDiameter(Converter.ToString(helperService.GetFieldValue("ProductPotSize", i.ProductFields))) cm 1584 @RenderManufacturer(manufacturerId, manufacturerName, manufacturerWebsiteUrl) <br /> 1585 </div> 1586 </div> 1587 <div class="clearfix visible-sm"></div> 1588 <div class="col-md-4 col-sm-6"> 1589 @if (isLoggedIn) 1590 { 1591 <div class="product-price"> 1592 <table class="table"> 1593 1594 <tbody> 1595 <tr> 1596 <td> 1597 @Translate("Pcs", "Stk") 1598 </td> 1599 <td> 1600 1 &times; 1601 @productInfo.ColliSize 1602 </td> 1603 <td> 1604 <span class="js-colli-per-layer">@productInfo.ColliPerLayer</span> 1605 &times; @productInfo.ColliSize 1606 </td> 1607 <td> 1608 <span class="js-colli-per-cc">@productInfo.ColliPerCc</span> 1609 &times; @productInfo.ColliSize 1610 </td> 1611 </tr> 1612 @if (!DisablePrices()) 1613 { 1614 <tr> 1615 <td> 1616 @Translate("price", "Pris") 1617 </td> 1618 <td class="js-product-field-price js-product-field-price-colli"> 1619 @if (DisplayPricesInclVat()) 1620 { 1621 @:@priceInformation.Prices.PricePerColliUnit.PriceWithVAT 1622 } 1623 else 1624 { 1625 @:@priceInformation.Prices.PricePerColliUnit.PriceWithoutVAT 1626 } 1627 </td> 1628 <td class="js-product-field-price js-product-field-price-layer"> 1629 @if (DisplayPricesInclVat()) 1630 { 1631 @:@priceInformation.Prices.PricePerLayerUnit.PriceWithVAT 1632 } 1633 else 1634 { 1635 @:@priceInformation.Prices.PricePerLayerUnit.PriceWithoutVAT 1636 } 1637 </td> 1638 <td class="js-product-field-price js-product-field-price-cc"> 1639 @if (DisplayPricesInclVat()) 1640 { 1641 @:@priceInformation.Prices.PricePerCcUnit.PriceWithVAT 1642 } 1643 else 1644 { 1645 @:@priceInformation.Prices.PricePerCcUnit.PriceWithoutVAT 1646 } 1647 </td> 1648 </tr> 1649 } 1650 </tbody> 1651 </table> 1652 </div> 1653 } 1654 </div> 1655 <br class="hidden-sm hidden-md hidden-lg" /> 1656 <div class="col-md-3 col-sm-6"> 1657 @if (isLoggedIn && product.VariantCount == 0) 1658 { 1659 1660 var loopCounter = productLoopCounter + baseLoopCounter; 1661 var nameProductLoopCounter = "ProductLoopCounter" + loopCounter; 1662 var nameProductIdCounter = "ProductID" + loopCounter; 1663 var nameVariantIdCounter = "VariantID" + loopCounter; 1664 var nameUnitIdCounter = "UnitID" + loopCounter; 1665 var namewishListIdCounter = "wishListID" + loopCounter; 1666 var priceRetailValue = productInfo.CustomerRetailPrice; 1667 var priceRetail = new PriceCalculated(new PriceRaw(priceRetailValue, Dynamicweb.Ecommerce.Common.Context.Currency)); 1668 var retailPriceValue = DisplayPricesInclVat() ? Converter.ToString(priceRetail.PriceWithVAT) : Converter.ToString(priceRetail.PriceWithoutVAT); 1669 retailPriceValue = Converter.ToInt32(retailPriceValue) == 0 ? "" : FormatPrice(retailPriceValue); 1670 1671 <input type="hidden" value='@loopCounter' name='@nameProductLoopCounter'> 1672 <input type="hidden" class="js-product-id" value='@i.Id' name="@nameProductIdCounter"> 1673 <input type="hidden" value="" name="@nameVariantIdCounter"> 1674 <input type="hidden" value="" name="@nameUnitIdCounter"> 1675 <input type="hidden" value="0" name="@namewishListIdCounter"> 1676 1677 if (isDeliverable) 1678 { 1679 <div class="row"> 1680 @renderToolTip() 1681 <div class="col-xs-3 js-quantity-tooltip" data-placement="right" data-toggle="popover" data-trigger="manual"> 1682 @{ 1683 var quantityFieldName = "Quantity" + loopCounter; 1684 bool isServiceProduct = product.Type == Dynamicweb.Ecommerce.Products.ProductType.Service; 1685 1686 var placeholder = minQty > 0 ? String.Format("min. {0}", minQty) : minQty.ToString(); 1687 1688 <div class="product-list-number"> 1689 <input type="number" min="0" name='@quantityFieldName' tabindex='@loopCounter' data-is-service="@isServiceProduct" data-stock-status='@i.StockLevel' class="form-control js-quantity text-right" placeholder="@placeholder" /> 1690 </div> 1691 } 1692 </div> 1693 1694 <div class="col-xs-9"> 1695 @foreach (var o in product.OrderLineFields) 1696 { 1697 var inputName = "EcomOrderLineFieldInput_" + o.Name + loopCounter; 1698 string placeholderText = o.Name; 1699 switch (o.SystemName) 1700 { 1701 case "OrderLineComment": 1702 if (EnableComments()) 1703 { 1704 placeholderText = Translate("LineComment", "Comment"); 1705 <input type="text" class="form-control" maxlength="80" name="@inputName" placeholder="@placeholderText" /> 1706 } 1707 break; 1708 case "OrderLineColliSize": 1709 <input type="hidden" name="@inputName" value='@productInfo.ColliSize' /> 1710 break; 1711 case "OrderLineColliPerLayer": 1712 <input type="hidden" name="@inputName" value='@productInfo.ColliPerLayer' /> 1713 break; 1714 case "OrderLineColliPerCC": 1715 <input type="hidden" name="@inputName" value='@productInfo.ColliPerCc' /> 1716 break; 1717 case "OrderLineRetailPrice": 1718 placeholderText = Translate("Smartpage:eCom:CustomerSpecificInfo.RetailPrice", "Add retail price"); 1719 <div class="hidden"> 1720 <input type="text" id="js-retail-price-@loopCounter" class="form-control js-retail-price-input js-product-field-replace text-right" data-replace-target=".js-product-field-retail-price" name="@inputName" value='@retailPriceValue' placeholder="@placeholderText" /> 1721 </div> 1722 break; 1723 case "OrderLineItemNumber": 1724 placeholderText = Translate("Smartpage:eCom:CustomerSpecificInfo.ItemNumber", "Item no."); 1725 <div class="hidden"> 1726 <input type="text" id="js-item-number-@loopCounter" class="form-control js-product-field-replace text-right" data-replace-target=".js-product-field-item-number" name="@inputName" value='@productInfo.CustomerItemNumber.Trim()' placeholder="@placeholderText" /> 1727 </div> 1728 break; 1729 case "OrderLineEAN": 1730 placeholderText = Translate("Deres_EAN_nummer-short", "EAN"); 1731 1732 <div class="hidden"> 1733 <div class="editable" data-placeholder="my placeholder"> 1734 <input type="text" id="js-ean-number-@loopCounter" class="form-control js-product-field-replace text-right" data-replace-target=".js-product-field-ean" name="@inputName" value='@productInfo.EAN.Trim()' placeholder="@placeholderText" /> 1735 </div> 1736 </div> 1737 1738 break; 1739 default: 1740 <text>@inputName</text> 1741 break; 1742 } 1743 } 1744 </div> 1745 </div> 1746 } 1747 1748 if (!isDeliverable) 1749 { 1750 <div class="row"> 1751 <div class="hidden-xs col-sm-3 hidden-md hidden-lg"></div> 1752 <div class="col-sm-9 col-md-12 col-lg-offset-3 col-lg-9 product-editable-area"> 1753 <p>@Translate("Smartpage:Ecom.LeadDaysWarning", "Available on") <span class="label label-warning">@AvailableDeliveryDay(Converter.ToInt32(helperService.GetFieldValue("LeadDays", i.ProductFields)))</span></p> 1754 </div> 1755 </div> 1756 } 1757 1758 } 1759 </div> 1760 </div> 1761 } 1762 </div> 1763 1764 </div> 1765 1766 <input type="submit" value="Add to basket" class="sr-only" /> 1767 1768 @if (isLoggedIn) 1769 { 1770 @SnippetStart("SmartpageAddToBasket") 1771 <button class="btn btn-primary btn-block btn-lg js-submit-form" data-form-selector=".js-basket-add">@Translate("Smartpage:eCom.AddToCart", "Læg i kurven")</button> 1772 @SnippetEnd("SmartpageAddToBasket") 1773 } 1774 </form> 1775 } 1776 1777 @inherits ViewModelTemplate<ProductListViewModel> 1778 @using Dynamicweb; 1779 @using Dynamicweb.Core; 1780 @using Dynamicweb.Environment; 1781 @using Dynamicweb.Rendering; 1782 @using Dynamicweb.Ecommerce.ProductCatalog; 1783 @using System.Linq; 1784 @using Gasa.ProductInformation; 1785 @using Gasa.PriceInformation; 1786 @using Gasa.ProductInformation.Helpers; 1787 @using Dynamicweb.Ecommerce.Prices; 1788 1789 @helper RenderTilesView() 1790 { 1791 <form method="post" class="js-basket-add js-set-tabindex row js-product-form-container" autocomplete="false" data-submit-url='@Pageview.Area.Item["JsonCart"]'> 1792 <input type="hidden" name="CartCmd" value="addmulti" /> 1793 @{ 1794 1795 string pageNum = Dynamicweb.Context.Current.Request["PageNum"]; 1796 var isLoggedIn = Dynamicweb.Security.UserManagement.User.IsExtranetUserLoggedIn(); 1797 var pagenum = 1; 1798 var defaultImage = !string.IsNullOrWhiteSpace(Converter.ToString(Pageview.Area.Item["DefaultImage"])) ? Converter.ToString(Pageview.Area.Item["DefaultImage"]) : "/Files/images/default-image.png"; 1799 1800 if (Dynamicweb.Context.Current.Request.GetInt32("pagenum") > 0) 1801 { 1802 pagenum = Dynamicweb.Context.Current.Request.GetInt32("pagenum"); 1803 } 1804 1805 var baseLoopCounter = Model.PageSize * (pagenum - 1); 1806 1807 int productLoopCounter = 0; 1808 1809 var productService = Dynamicweb.Ecommerce.Services.Products; 1810 var helperService = new CustomProductFieldHelpers(); 1811 string currentPageLink = "/Default.aspx?ID=" + Pageview.Page.ID; 1812 1813 } 1814 <div class="col-xs-12"> 1815 <div class="product-grid grid-group js-grid-group"> 1816 @foreach (var i in Model.Products) 1817 { 1818 productLoopCounter++; 1819 var manufacturerName = i.Manufacturer.Name; 1820 var manufacturerWebsiteUrl = i.Manufacturer.Web; 1821 var manufacturerId = i.Manufacturer.Id; 1822 1823 var product = productService.GetProductById(i.Id, i.VariantId, true); 1824 var productInfo = new ProductInformation(product, Dynamicweb.Security.UserManagement.User.GetCurrentExtranetUser().CustomerNumber); 1825 var priceInformation = new PriceInformation(product, productInfo); 1826 1827 string productLink = currentPageLink + "&amp;GroupId=" + product.PrimaryGroupId + "&amp;ProductID=" + product.Id; 1828 1829 var images = i.ImagePatternImages; 1830 string image = defaultImage; 1831 1832 if (images.Any()) 1833 { 1834 image = images.FirstOrDefault().Value; 1835 } 1836 1837 int minQty = Converter.ToInt32(helperService.GetFieldValue("MinimumPurchaseQuantityLimit", i.ProductFields)); 1838 if (minQty == 0) 1839 { 1840 switch (Converter.ToString(helperService.GetFieldValue("MinimumPurchaseQuantity", i.ProductFields)).ToLower().Trim()) 1841 { 1842 case "layer": 1843 minQty = productInfo.ColliPerLayer; 1844 break; 1845 case "cc": 1846 minQty = productInfo.ColliPerCc; 1847 break; 1848 default: 1849 minQty = 1; 1850 break; 1851 } 1852 } 1853 1854 bool isDeliverable = string.IsNullOrEmpty(AvailableDeliveryDay(Converter.ToInt32(helperService.GetFieldValue("LeadDays", i.ProductFields)))); 1855 string cssIDSelector = "js-" + i.Id; 1856 1857 <div class="grid-group-item col-xs-12 col-sm-6 col-md-4 col-lg-3 clearfix js-product js-grid-product" data-min-quantity='@minQty' id="@cssIDSelector" data-page-num="@pageNum"> 1858 <div class="grid-group-item-img"> 1859 <a href='@productLink' class="js-product-title"> 1860 @{ 1861 var imageUrl = "/Admin/Public/getimage.ashx?Image=" + image + "&amp;Resolution=75&amp;Compression=70&amp;Width=190&amp;Height=190&amp;Crop=5&amp;AlternativeImage=" + defaultImage; 1862 } 1863 <img src="@imageUrl" alt='@HttpUtility.HtmlEncode(i.Name)' class="img-responsive" /> 1864 </a> 1865 @if (images.Count > 1) 1866 { 1867 <span class="label label-info label-amount-pictures"><i class="glyphicon glyphicon-picture"></i> @images.Count</span> 1868 } 1869 1870 @AddedToCart(i, "absolute") 1871 </div> 1872 1873 <div class="item-description-gallery-view"> 1874 <h2> 1875 <a href="@productLink" class="js-product-title">@i.Name</a> 1876 @if (Converter.ToBoolean(helperService.GetFieldValue("NewProduct", i.ProductFields))) 1877 { 1878 <span class="label label-warning">@Translate("Smartpage:NewProduct", "NEW")</span> 1879 } 1880 @if (Converter.ToBoolean(helperService.GetFieldValue("Bestseller", i.ProductFields))) 1881 { 1882 <span class="label label-warning">@Translate("Smartpage:Bestseller", "BESTSELLER")</span> 1883 } 1884 @if (!string.IsNullOrEmpty(Converter.ToString(helperService.GetFieldValue("NavCompanyCode", i.ProductFields)))) 1885 { 1886 var flagImgPath = "/Admin/Images/Flags/Small/flag_" + Converter.ToString(helperService.GetFieldValue("NavCompanyCode", i.ProductFields)) + ".png"; 1887 <img src='@flagImgPath' alt='@Converter.ToString(helperService.GetFieldValue("NavCompanyCode", i.ProductFields))' title='@Converter.ToString(helperService.GetFieldValue("NavCompanyCode", i.ProductFields))' /> 1888 } 1889 1890 </h2> 1891 <div class="product-description"> 1892 @ListStockStatus(i, "tiles") 1893 @i.ShortDescription 1894 </div> 1895 <div class="product-unit"> 1896 &Oslash; @FormatDiameter(Converter.ToString(helperService.GetFieldValue("ProductPotSize", i.ProductFields)) + " cm H: " + product.Height) cm <br /> 1897 @RenderManufacturer(manufacturerId, manufacturerName, manufacturerWebsiteUrl) 1898 </div> 1899 1900 </div> 1901 1902 <div class="product-grid-price"> 1903 @if (isLoggedIn) 1904 { 1905 <div class="product-price"> 1906 <table class="table"> 1907 <thead> 1908 <tr> 1909 <td>&nbsp;</td> 1910 <th> 1911 <div class="pictogram"> 1912 <div class="pictogram-box"></div> 1913 </div> 1914 </th> 1915 <th> 1916 <div class="pictogram"> 1917 <div class="pictogram-layer"></div> 1918 </div> 1919 </th> 1920 <th> 1921 <div class="pictogram"> 1922 <div class="pictogram-container"></div> 1923 </div> 1924 </th> 1925 </tr> 1926 </thead> 1927 <tbody> 1928 <tr> 1929 <td> 1930 @Translate("Pcs", "Stk") 1931 </td> 1932 <td> 1933 1 &times; 1934 @productInfo.ColliSize 1935 </td> 1936 <td> 1937 <span class="js-colli-per-layer">@productInfo.ColliPerLayer</span> 1938 &times; @productInfo.ColliSize 1939 </td> 1940 <td> 1941 <span class="js-colli-per-cc">@productInfo.ColliPerCc</span> 1942 &times; @productInfo.ColliSize 1943 </td> 1944 </tr> 1945 1946 @if (!DisablePrices()) 1947 { 1948 <tr> 1949 <td> 1950 @Translate("price", "Pris") 1951 </td> 1952 <td class="js-product-field-price-colli"> 1953 @if (DisplayPricesInclVat()) 1954 { 1955 @:@priceInformation.Prices.PricePerColliUnit.PriceWithVAT 1956 } 1957 else 1958 { 1959 @:@priceInformation.Prices.PricePerColliUnit.PriceWithoutVAT 1960 } 1961 </td> 1962 <td> 1963 @if (DisplayPricesInclVat()) 1964 { 1965 @:@priceInformation.Prices.PricePerLayerUnit.PriceWithVAT 1966 } 1967 else 1968 { 1969 @:@priceInformation.Prices.PricePerLayerUnit.PriceWithoutVAT 1970 } 1971 </td> 1972 <td> 1973 @if (DisplayPricesInclVat()) 1974 { 1975 @:@priceInformation.Prices.PricePerCcUnit.PriceWithVAT 1976 } 1977 else 1978 { 1979 @:@priceInformation.Prices.PricePerCcUnit.PriceWithoutVAT 1980 } 1981 </td> 1982 </tr> 1983 } 1984 </tbody> 1985 </table> 1986 </div> 1987 <div class="row"> 1988 <div class="editable-area-wrap-tile"> 1989 @if (isLoggedIn) 1990 { 1991 var loopCounter = productLoopCounter + baseLoopCounter; 1992 bool isServiceProduct = product.Type == Dynamicweb.Ecommerce.Products.ProductType.Service; 1993 var nameProductLoopCounter = "ProductLoopCounter" + loopCounter; 1994 var nameProductIdCounter = "ProductID" + loopCounter; 1995 var nameVariantIdCounter = "VariantID" + loopCounter; 1996 var nameUnitIdCounter = "UnitID" + loopCounter; 1997 var namewishListIdCounter = "wishListID" + loopCounter; 1998 var quantityFieldName = "Quantity" + loopCounter; 1999 var priceRetailValue = productInfo.CustomerRetailPrice; 2000 var priceRetail = new PriceCalculated(new PriceRaw(priceRetailValue, Dynamicweb.Ecommerce.Common.Context.Currency)); 2001 var retailPriceValue = DisplayPricesInclVat() ? Converter.ToString(priceRetail.PriceWithVAT) : Converter.ToString(priceRetail.PriceWithoutVAT); 2002 retailPriceValue = Converter.ToInt32(retailPriceValue) == 0 ? "" : FormatPrice(retailPriceValue); 2003 2004 <input type="hidden" value='@loopCounter' name='@nameProductLoopCounter'> 2005 <input type="hidden" value='@i.Id' name="@nameProductIdCounter"> 2006 <input type="hidden" value="" name="@nameVariantIdCounter"> 2007 <input type="hidden" value="" name="@nameUnitIdCounter"> 2008 <input type="hidden" value="0" name="@namewishListIdCounter"> 2009 2010 <!-- ::::::product-editable-area::::::: --> 2011 2012 if (EnableDisplayOfGrossMargin() && isDeliverable) 2013 { 2014 var pricePerColliUnit = priceInformation.Prices.PricePerColliUnit; 2015 double customerSalesPrice = DisplayPricesInclVat() ? pricePerColliUnit.PriceWithVAT : pricePerColliUnit.PriceWithoutVAT; 2016 2017 <div class="col-xs-12 product-editable-area"> 2018 <i class="js-product-field-gross-margin text-muted"> 2019 <span class="pull-left">@Translate("Smartpage:eCom:CustomerSpecificInfo.GrossMargin", "Gross margin")</span> 2020 <span class="pull-right js-gross-margin-value"> 2021 @if (priceRetail.Price > 0) 2022 { 2023 @GetGrossMargin(priceRetail.Price, customerSalesPrice); 2024 } 2025 else 2026 { 2027 @Translate("Smartpage:ecom:CustomerSpecificInfo.GrossMargin.NA", "N/A") 2028 } 2029 </span> 2030 </i> 2031 </div> 2032 } 2033 2034 if (EnableCustomerRetailPrice() && isDeliverable) 2035 { 2036 var formattedRetailPrice = DisplayPricesInclVat() ? priceRetail.PriceWithVATFormatted : priceRetail.PriceWithoutVATFormatted; 2037 formattedRetailPrice = Converter.ToDouble(formattedRetailPrice) == 0.00 ? "" : formattedRetailPrice; 2038 <div class="col-xs-12 product-editable-area"> 2039 2040 @if (EnableEditableRetailPrice() && isDeliverable && !String.IsNullOrEmpty(Converter.ToString(priceRetailValue))) 2041 { 2042 <div class="product-selectable-edit pull-right"> 2043 <i class="glyphicon glyphicon-edit js-product-fields-edit product-fields-edit" data-source="#js-retail-price-@loopCounter"></i> 2044 </div> 2045 } 2046 <div class="js-product-field-retail-price"> 2047 <span class="pull-left">@Translate("Smartpage:eCom:CustomerSpecificInfo.RetailPrice", "Retail price")</span> 2048 <span class="pull-right">@retailPriceValue</span> 2049 </div> 2050 </div> 2051 } 2052 2053 2054 if (EnableCustomerItemNumber()) 2055 { 2056 <div class="col-xs-12 product-editable-area"> 2057 2058 @if (EnableEditableItemNumber() && isDeliverable) 2059 { 2060 <div class="product-selectable-edit pull-right"> 2061 <i class="glyphicon glyphicon-edit js-product-fields-edit product-fields-edit" data-source="#js-item-number-@loopCounter"></i> 2062 </div> 2063 } 2064 <div class="js-product-field-item-number text-left"> 2065 <span class="pull-left">@Translate("Smartpage:eCom:CustomerSpecificInfo.ItemNumber", "Item no.")</span> 2066 <span class="pull-right">@productInfo.CustomerItemNumber</span> 2067 </div> 2068 </div> 2069 } 2070 2071 <div class="col-xs-12 product-editable-area push-last-row"> 2072 @if (EnableEditableBarcode() && isDeliverable) 2073 { 2074 <div class="pull-right product-selectable-edit"> 2075 <i class="glyphicon glyphicon-edit pull-right js-product-fields-edit product-fields-edit" data-source="#js-ean-number-@loopCounter"></i> 2076 </div> 2077 } 2078 @if (EnableCustomerBarcode() && !String.IsNullOrEmpty(productInfo.EAN)) 2079 { 2080 <div class="js-product-field-ean text-left"> 2081 <span class="pull-left">@Translate("Deres_EAN_nummer", "EAN")</span> 2082 <span class="pull-right">@productInfo.EAN</span> 2083 </div> 2084 } 2085 </div> 2086 2087 <!-- ::::::product-editable-area::::::: --> 2088 2089 if (isDeliverable) 2090 { 2091 var placeholder = minQty > 0 ? String.Format("min. {0}", minQty) : minQty.ToString(); 2092 2093 <div class="col-xs-4 js-quantity-tooltip" data-placement="top" data-toggle="popover" data-trigger="manual" style="padding-right:0;"> 2094 @renderToolTip() 2095 <div class="form-group"> 2096 <input type="number" min="0" data-is-service="@isServiceProduct" data-stock-status='@i.StockLevel' name='@quantityFieldName' tabindex='@loopCounter' class="form-control text-right js-quantity" placeholder="@placeholder" /> 2097 </div> 2098 </div> 2099 foreach (Dynamicweb.Ecommerce.Orders.OrderLineField o in SortOrderLineFields(product.OrderLineFields)) 2100 { 2101 var inputName = "EcomOrderLineFieldInput_" + o.Name + loopCounter; 2102 string placeholderText = o.Name; 2103 2104 switch (o.SystemName) 2105 { 2106 case "OrderLineComment": 2107 if (EnableComments()) 2108 { 2109 placeholderText = Translate("LineComment", "Comment"); 2110 <div class="col-xs-8"> 2111 <div class="form-group"> 2112 <input type="text" class="form-control" name='@inputName' maxlength="80" placeholder='@placeholderText' /> 2113 </div> 2114 </div> 2115 } 2116 break; 2117 case "OrderLineColliSize": 2118 <input type="hidden" name="@inputName" value='@productInfo.ColliSize' /> 2119 break; 2120 case "OrderLineColliPerLayer": 2121 <input type="hidden" name="@inputName" value='@productInfo.ColliPerLayer' /> 2122 break; 2123 case "OrderLineColliPerCC": 2124 <input type="hidden" name="@inputName" value='@productInfo.ColliPerCc' /> 2125 break; 2126 case "OrderLineEAN": 2127 placeholderText = Translate("Deres_EAN_nummer-short", "EAN"); 2128 <div class="hidden"> 2129 <input type="text" class="form-control js-product-field-replace text-right" id="js-ean-number-@loopCounter" data-replace-target=".js-product-field-ean" name="@inputName" value='@productInfo.EAN.Trim()' placeholder="@placeholderText" /> 2130 </div> 2131 break; 2132 case "OrderLineRetailPrice": 2133 placeholderText = Translate("Smartpage:eCom:CustomerSpecificInfo.RetailPrice", "Add retail price"); 2134 <div class="hidden"> 2135 <input type="text" id="js-retail-price-@loopCounter" class="form-control js-product-field-replace js-retail-price-input text-right" data-replace-target=".js-product-field-retail-price" name="@inputName" value='@retailPriceValue' placeholder="@placeholderText" /> 2136 </div> 2137 break; 2138 case "OrderLineItemNumber": 2139 placeholderText = Translate("Smartpage:eCom:CustomerSpecificInfo.ItemNumber", "Item no."); 2140 <div class="hidden"> 2141 <input type="text" id="js-item-number-@loopCounter" class="form-control js-product-field-replace text-right" data-replace-target=".js-product-field-item-number" name="@inputName" value='@productInfo.CustomerItemNumber.Trim()' placeholder="@placeholderText" /> 2142 </div> 2143 break; 2144 } 2145 } 2146 } 2147 else 2148 { 2149 <div class="col-sm-12 text-center product-not-available"> 2150 <p>@Translate("Smartpage:Ecom.LeadDaysWarning.Short", "Available on") <span class="label label-warning">@AvailableDeliveryDay(Converter.ToInt32(helperService.GetFieldValue("LeadDays", i.ProductFields)))</span></p> 2151 </div> 2152 } 2153 } 2154 </div> 2155 </div> 2156 } 2157 </div> 2158 <div class="clearfix"></div> 2159 </div> 2160 2161 2162 } 2163 </div> 2164 </div> 2165 2166 <input type="submit" value="Add to basket" class="sr-only" /> 2167 @if (isLoggedIn) 2168 { 2169 @SnippetStart("SmartpageAddToBasket") 2170 <button class="btn btn-primary btn-block btn-lg js-submit-form" data-form-selector=".js-basket-add">@Translate("Smartpage:eCom.AddToCart", "Læg i kurven")</button> 2171 @SnippetEnd("SmartpageAddToBasket") 2172 } 2173 </form> 2174 } 2175 2176 2177 @{ 2178 string listLink = LinkHelper.ReplaceQueryString("viewmode", "list"); 2179 string gridLink = LinkHelper.ReplaceQueryString("viewmode", "grid"); 2180 string photoLink = LinkHelper.ReplaceQueryString("viewmode", "photo"); 2181 string quicklistLink = LinkHelper.ReplaceQueryString("viewmode", "quicklist"); 2182 2183 2184 string urlParamView = Dynamicweb.Context.Current.Request.GetString("viewmode"); 2185 Cookie cookieViewMode = Dynamicweb.Environment.CookieManager.GetCookie("viewmode"); 2186 string cookieValue = String.Empty; 2187 2188 string currentQuery = "/Default.aspx?" + System.Web.HttpContext.Current.Request.QueryString.ToString(); 2189 var queryString = "?" + System.Web.HttpContext.Current.Request.QueryString.ToString(); 2190 2191 2192 string productEmptySortUrl = LinkHelper.ReplaceQueryString(queryString, "sortby", ""); 2193 string productNameURL = LinkHelper.ReplaceQueryString(queryString, "sortby", "productname"); 2194 string productNameLinkAsc = LinkHelper.ReplaceQueryString(productNameURL, "sortorder", "asc"); 2195 string productNameLinkDesc = LinkHelper.ReplaceQueryString(productNameURL, "sortorder", "desc"); 2196 2197 2198 var isNameAscSelected = (currentQuery.ToLower().Contains("&sortby=productname") && currentQuery.ToLower().Contains("&sortorder=asc")); 2199 var isNameDescSelected = (currentQuery.ToLower().Contains("&sortby=productname") && currentQuery.ToLower().Contains("&sortorder=desc")); 2200 2201 string potSizeURL = LinkHelper.ReplaceQueryString(queryString, "sortby", "CustomField_ProductPotSize"); 2202 string potSizeLinkAsc = LinkHelper.ReplaceQueryString(potSizeURL, "sortorder", "asc"); 2203 string potSizeLinkDesc = LinkHelper.ReplaceQueryString(potSizeURL, "sortorder", "desc"); 2204 2205 var isPotSizeAscSelected = (currentQuery.ToLower().Contains("&sortby=customfield_productpotsize") && currentQuery.ToLower().Contains("&sortorder=asc")); 2206 var isPotSizeDescSelected = (currentQuery.ToLower().Contains("&sortby=customfield_productpotsize") && currentQuery.ToLower().Contains("&sortorder=desc")); 2207 2208 2209 var currentUser = Dynamicweb.Frontend.PageView.Current().User; 2210 2211 var excelField = currentUser.CustomFieldValues.Where(x => x.CustomField.SystemName == "AccessUser_ProductFieldExport").FirstOrDefault(); 2212 2213 bool enableExcelExport = !string.IsNullOrEmpty(Converter.ToString(excelField.Value)); 2214 var excelDownloadUrl = LinkHelper.ReplaceQueryString("excel", "true") + "&pagesize=10000"; 2215 var baseURL = "/Files/Templates/Designs/" + Pageview.Layout.Design.Name.TrimEnd('/'); //GetString("Template:DesignBaseUrl").TrimEnd('/'); 2216 2217 bool isMobile = Converter.ToBoolean(Pageview.GlobalTags.GetTagByName("Global:Device.IsMobile").Value); 2218 2219 var helperService = new CustomProductFieldHelpers(); 2220 } 2221 2222 @if (cookieViewMode != null) 2223 { 2224 cookieValue = cookieViewMode.Value; 2225 } 2226 2227 @{ 2228 string viewMode = urlParamView == "grid" ? "grid" : urlParamView == "list" ? "list" : urlParamView == "photo" ? "photo" : urlParamView == "quicklist" ? "quicklist" : 2229 cookieValue == "grid" ? "grid" : cookieValue == "list" ? "list" : cookieValue == "photo" ? "photo" : cookieValue == "quicklist" ? "quicklist" : String.Empty; 2230 2231 if (String.IsNullOrEmpty(viewMode)) 2232 { 2233 viewMode = Converter.ToString(Pageview.Area.Item["DefaultProductView"]); 2234 } 2235 else 2236 { 2237 Dynamicweb.Environment.CookieManager.SetCookie("viewmode", viewMode, DateTime.Now.AddDays(30)); 2238 } 2239 2240 if (String.IsNullOrEmpty(viewMode) || isMobile) 2241 { 2242 viewMode = "grid"; 2243 } 2244 } 2245 2246 @RenderSearch() 2247 2248 <div class="clearfix"></div> 2249 2250 @PricesWithVATStatus("top") 2251 2252 <div class="page-header"> 2253 <h1 class="page-header-h1 pull-left col-sm-3"> 2254 @{ 2255 string groupId = System.Web.HttpContext.Current.Request["GroupId"]; 2256 string currentParagraphHeader = Pageview.CurrentParagraph.Header; 2257 2258 if (!string.IsNullOrEmpty(groupId)) 2259 { 2260 var group = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(groupId); 2261 if (group != null) 2262 { 2263 @group.Name 2264 } 2265 else 2266 { 2267 @currentParagraphHeader 2268 } 2269 } 2270 else 2271 { 2272 @currentParagraphHeader 2273 } 2274 } 2275 </h1> 2276 <div class="col-sm-9"> 2277 <div class="row"> 2278 @if (!isMobile) 2279 { 2280 <div class="hidden-xs col-sm-5 col-md-3"> 2281 <div class="filter-product-list"> 2282 <select class="form-control js-select-filter-products select-filter-products"> 2283 <option value="@productEmptySortUrl" data-label-select="true">@Translate("Smartpage:ProductList.Filter.Text", "Sort by")</option> 2284 <option value='@productNameLinkAsc' selected='@isNameAscSelected'>@Translate("Smartpage:ProductList.Filter.ProductName.Asc", "Alphabetical A-Z")</option> 2285 <option value='@productNameLinkDesc' selected='@isNameDescSelected'>@Translate("Smartpage:ProductList.Filter.ProductName.Desc", "Alphabetical Z-A")</option> 2286 <option value='@potSizeLinkAsc' selected='@isPotSizeAscSelected'>@Translate("Smartpage:ProductList.Filter.PotSize.Asc", "Pot size ascending")</option> 2287 <option value='@potSizeLinkDesc' selected='@isPotSizeDescSelected'>@Translate("Smartpage:ProductList.Filter.PotSize.Desc", "Pot size descending")</option> 2288 </select> 2289 </div> 2290 </div> 2291 } 2292 2293 @if (viewMode == "list" || viewMode == "quicklist") 2294 { 2295 <div class="hidden-xs hidden-sm"> 2296 <div class="col-md-offset-1 col-md-1 text-right list-dia"> 2297 &Oslash; 2298 </div> 2299 <div class="col-md-4"> 2300 <div class="product-price row"> 2301 <table class="table table-pictogram"> 2302 <thead> 2303 <tr> 2304 <td>&nbsp;</td> 2305 <th> 2306 <div class="pictogram"> 2307 <div class="pictogram-box"></div> 2308 </div> 2309 </th> 2310 <th> 2311 <div class="pictogram"> 2312 <div class="pictogram-layer"></div> 2313 </div> 2314 </th> 2315 <th> 2316 <div class="pictogram"> 2317 <div class="pictogram-container"></div> 2318 </div> 2319 </th> 2320 </tr> 2321 </thead> 2322 </table> 2323 </div> 2324 </div> 2325 </div> 2326 } 2327 2328 @if (!isMobile) 2329 { 2330 <div class="viewmode pull-right"> 2331 @if (enableExcelExport) 2332 { 2333 <a href="@excelDownloadUrl" class="btn btn-default" title='@Translate("Smartpage:eCom.ExcelExport", "Download as Excel-file")'><img src="@baseURL/Assets/Images/Excel-icon-grey.png" alt='@Translate("Smartpage:ProductList.DownloadAsExcel","Hent som excel")' /></a> 2334 } 2335 <div class="btn-group" role="group"> 2336 @{ 2337 var listActiveLink = String.Empty; 2338 if (viewMode == "list") 2339 { 2340 listActiveLink = "active"; 2341 } 2342 <a class="js-listview js-view-change js-tooltips listview-link view-link btn btn-default @listActiveLink" href="@listLink" data-toggle="tooltip" data-placement="top" data-container=".viewmode" title='@Translate("Smartpage:ProductList.Tooltip.ViewMode.List", "View as list")'><i class="glyphicon glyphicon-list"></i></a> 2343 } 2344 @{ 2345 listActiveLink = String.Empty; 2346 if (viewMode == "grid") 2347 { 2348 listActiveLink = "active"; 2349 } 2350 <a class="js-gridview js-view-change js-tooltips gridview-link view-link btn btn-default @listActiveLink" href="@gridLink" data-toggle="tooltip" data-placement="top" data-container=".viewmode" title='@Translate("Smartpage:ProductList.Tooltip.ViewMode.Grid", "View as grid")'><i class="glyphicon glyphicon-th-large"></i></a> 2351 } 2352 @{ 2353 listActiveLink = String.Empty; 2354 if (viewMode == "photo") 2355 { 2356 listActiveLink = "active"; 2357 } 2358 <a class="js-photoview js-view-change js-tooltips photoview-link view-link btn btn-default @listActiveLink" href="@photoLink" data-toggle="tooltip" data-placement="top" data-container=".viewmode" title='@Translate("Smartpage:ProductList.Tooltip.ViewMode.Photos","View as photos")'><i class="glyphicon glyphicon-th-list"></i></a> 2359 } 2360 @{ 2361 listActiveLink = String.Empty; 2362 if (viewMode == "quicklist") 2363 { 2364 listActiveLink = "active"; 2365 } 2366 <a class="js-quicklistview js-view-change js-tooltips quicklistview-link view-link btn btn-default @listActiveLink" href="@quicklistLink" data-toggle="tooltip" data-placement="top" data-container=".viewmode" title='@Translate("Smartpage:ProductList.Tooltip.ViewMode.Quicklist","View as quick list")'><i class="glyphicon glyphicon-align-justify"></i></a> 2367 } 2368 </div> 2369 </div> 2370 } 2371 2372 </div> 2373 2374 </div> 2375 <div class="clearfix"></div> 2376 </div> 2377 <div class="border-bottom-box"> 2378 <div class="clearfix"></div> 2379 <div class="productlistnavigation navigation-top hidden"> 2380 2381 <span class="productcount"> 2382 @Model.TotalProductsCount 2383 @Translate("SmartPage:Product.Paging.ProductsFound", "produkter fundet") 2384 </span> 2385 <span class="pagenavigation pull-right js-product-pagination" data-url="@System.Web.HttpContext.Current.Request.RawUrl"> 2386 @{ 2387 string groupIdQueryParameter = string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["GroupID"]) 2388 ? string.Empty 2389 : "&amp;GroupID=" + Dynamicweb.Context.Current.Request["GroupID"]; 2390 string currentPageLink = "/Default.aspx?ID=" + Pageview.Page.ID + groupIdQueryParameter; 2391 2392 string currentPageNumber = string.IsNullOrWhiteSpace(HttpContext.Current.Request["PageNum"]) ? "1": HttpContext.Current.Request["PageNum"]; 2393 2394 if (Converter.ToInt32(currentPageNumber) > Model.PageCount) 2395 { 2396 currentPageLink = Dynamicweb.Environment.Helpers.LinkHelper.ReplaceQueryString(Dynamicweb.Context.Current.Request.Url.PathAndQuery, "PageNum", Converter.ToString(Converter.ToInt32(currentPageNumber) -1)); 2397 <a class="prevpage js-prev-page" href="@currentPageLink">@Translate("SmartPage:Product.Paging.Previous", "Forrige")</a> 2398 } 2399 if (Converter.ToInt32(currentPageNumber) < Model.PageCount) 2400 { 2401 currentPageLink = Dynamicweb.Environment.Helpers.LinkHelper.ReplaceQueryString(Dynamicweb.Context.Current.Request.Url.PathAndQuery, "PageNum", Converter.ToString(Converter.ToInt32(currentPageNumber) + 1)); 2402 <a class="nextpage js-next-page" href="@currentPageLink">@Translate("SmartPage:Product.Paging.Next", "Næste")</a> 2403 } 2404 } 2405 <br /> 2406 </span> 2407 </div> 2408 <div class="col-sm-3"> 2409 @if (isMobile) 2410 { 2411 <div class="row"> 2412 <div class="col-xs-12 filter-product-list"> 2413 <select class="form-control js-select-filter-products select-filter-products"> 2414 <option value="@productEmptySortUrl" data-label-select="true">@Translate("Smartpage:ProductList.Filter.Text", "Sort by")</option> 2415 <option value='@productNameLinkAsc' @isNameAscSelected>@Translate("Smartpage:ProductList.Filter.ProductName.Asc", "Alphabetical A-Z")</option> 2416 <option value='@productNameLinkDesc' @isNameDescSelected>@Translate("Smartpage:ProductList.Filter.ProductName.Desc", "Alphabetical Z-A")</option> 2417 <option value='@potSizeLinkAsc' @isPotSizeAscSelected>@Translate("Smartpage:ProductList.Filter.PotSize.Asc", "Pot size ascending")</option> 2418 <option value='@potSizeLinkDesc' @isPotSizeDescSelected>@Translate("Smartpage:ProductList.Filter.PotSize.Desc", "Pot size descending")</option> 2419 </select> 2420 </div> 2421 </div> 2422 } 2423 2424 @inherits ViewModelTemplate<ProductListViewModel> 2425 @using Dynamicweb; 2426 @using Dynamicweb.Frontend; 2427 @using Dynamicweb.Rendering; 2428 @using Dynamicweb.Ecommerce.ProductCatalog; 2429 @using System.Linq; 2430 @using Dynamicweb.Core; 2431 2432 @{ 2433 var designBaseUrl = "/Files/Templates/Designs/" + Pageview.Layout.Design.Name.TrimEnd('/');//GetString("Template:DesignBaseUrl").TrimEnd('/'); 2434 } 2435 2436 <form name="EcomSearch" class="form-filters js-form-filters" method="get" action='@SearchEngineFriendlyURLs.GetFriendlyUrl(Converter.ToInt32(Pageview.Page.ID))'> 2437 @*<input type="hidden" name="ID" value='@Converter.ToInt32(Pageview.Page.ID)' />*@ 2438 @* start - enable ajax loading *@ 2439 <input type="hidden" id="js-ajax-filter-enabled" value="true" /> 2440 @* end - enable ajax loading *@ 2441 @if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["SortBy"])) 2442 { 2443 <input type="hidden" name="SortBy" value='@Dynamicweb.Context.Current.Request["SortBy"]' /> 2444 } 2445 @if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["SortOrder"])) 2446 { 2447 <input type="hidden" name="SortOrder" value='@Dynamicweb.Context.Current.Request["SortOrder"]' /> 2448 } 2449 @if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["GroupID"])) 2450 { 2451 <input type="hidden" name="GroupID" value='@Dynamicweb.Context.Current.Request["GroupID"]' /> 2452 } 2453 @if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["q"])) 2454 { 2455 <input type="hidden" name="q" value='@Dynamicweb.Context.Current.Request["q"]' /> 2456 } 2457 2458 <input type="submit" class="sr-only"> 2459 2460 <div class="filter-range"> 2461 <h3>@Translate("Potsize", "Pot size")</h3> 2462 @{ 2463 var potsizes = HttpContext.Current.Request.QueryString.GetValues("potsize"); 2464 if (potsizes == null) // Try to get from post instead 2465 { 2466 potsizes = HttpContext.Current.Request.Form.GetValues("potsize"); 2467 } 2468 var potsizeMin = 0; 2469 var potsizeMax = 0; 2470 if (potsizes != null) 2471 { 2472 if (potsizes.Length == 1) 2473 { 2474 potsizes = potsizes.First().Split(','); 2475 } 2476 2477 if (potsizes.Length == 2) 2478 { 2479 potsizeMin = Converter.ToInt32(potsizes.First()); 2480 potsizeMax = Converter.ToInt32(potsizes.Last()); 2481 } 2482 } 2483 } 2484 <div class="row filter-range-inputs"> 2485 <div class="col-xs-4"> 2486 <label>@Translate("Smartpage:Min", "min")</label> 2487 <input type="number" class="form-control js-min-value" name="potsize" data-is-minimum="true" value='@potsizeMin' /> 2488 </div> 2489 <div class="col-xs-4 pull-right"> 2490 <label>@Translate("Smartpage:Max", "max")</label> 2491 @{ 2492 if (potsizeMax == 0 || potsizeMax == 9999) 2493 { 2494 potsizeMax = 30; 2495 } 2496 } 2497 <input type="number" class="form-control js-max-value" data-system-max="9999" data-visual-max="30" name="potsize" value='@potsizeMax' /> 2498 </div> 2499 <br /> 2500 </div> 2501 <div class="filter-range-slider js-filter-range-slider"> 2502 <input id="slider-input" type="text" value="@(potsizeMin + "-" + potsizeMax)" data-slider-min='0' data-slider-max='30' data-slider-value='[@potsizeMin,@potsizeMax]' class="sr-only" /> 2503 <div class="clearfix"></div> 2504 <div class="min-value pull-left">0</div> 2505 <div class="max-value pull-right">30+</div> 2506 </div> 2507 </div> 2508 2509 <div class="clearfix"></div> 2510 2511 <div class="filter-range"> 2512 <h3>@Translate("Height", "Height")</h3> 2513 @{ 2514 var heights = HttpContext.Current.Request.QueryString.GetValues("height"); 2515 if (heights == null) // Try to get from post instead 2516 { 2517 heights = HttpContext.Current.Request.Form.GetValues("height"); 2518 } 2519 var heightMin = 0; 2520 var heightMax = 0; 2521 if (heights != null) 2522 { 2523 if (heights.Length == 1) 2524 { 2525 heights = heights.First().Split(','); 2526 } 2527 2528 if (heights.Length == 2) 2529 { 2530 heightMin = Converter.ToInt32(heights.First()); 2531 heightMax = Converter.ToInt32(heights.Last()); 2532 } 2533 } 2534 } 2535 <div class="row filter-range-inputs"> 2536 <div class="col-xs-4"> 2537 <label>@Translate("Smartpage:Min", "min")</label> 2538 <input type="number" class="form-control js-min-value" name="height" data-is-minimum="true" value='@heightMin' /> 2539 </div> 2540 <div class="col-xs-4 pull-right"> 2541 <label>@Translate("Smartpage:Max", "max")</label> 2542 @{ 2543 if (heightMax == 0 || heightMax == 9999) 2544 { 2545 heightMax = 200; 2546 } 2547 } 2548 <input type="number" class="form-control js-max-value" data-system-max="9999" data-visual-max="200" name="height" value='@heightMax' /> 2549 </div> 2550 <br /> 2551 </div> 2552 <div class="filter-range-slider js-filter-range-slider"> 2553 <input id="slider-input" type="text" value="@(heightMin + "-" + heightMax)" data-slider-min='0' data-slider-max='200' data-slider-value='[@heightMin,@heightMax]' class="sr-only" /> 2554 <div class="clearfix"></div> 2555 <div class="min-value pull-left">0</div> 2556 <div class="max-value pull-right">200+</div> 2557 </div> 2558 </div> 2559 2560 <div class="clearfix"></div> 2561 2562 @{ 2563 var facets = Model.FacetGroups.FirstOrDefault(); 2564 if (facets != null) 2565 { 2566 var colors = facets.Facets.FirstOrDefault(g => g.QueryParameter == "color"); 2567 if (colors != null && colors.Options.Any()) 2568 { 2569 <div class="filter-color filter-container clearfix"> 2570 <h3>@Translate("Color", "Color")</h3> 2571 <ul class="list-unstyled"> 2572 @foreach (var i in colors.Options) 2573 { 2574 <li class="col-md-6 col-sm-12"> 2575 <label class="filter-color-item row"> 2576 <input type="checkbox" class="js-select-filter-option" name='@colors.QueryParameter' value='@i.Value' checked='@i.Selected' /> 2577 &nbsp; 2578 @{ 2579 if (i.Value != "XXXXXX") 2580 { 2581 var backgroundColor = "#" + i.Value; 2582 <span class="filter-color" style="background-color: @backgroundColor" title='@i.Label'> 2583 &nbsp; 2584 </span> 2585 } 2586 else 2587 { 2588 <span class="filter-color" title='@i.Label'> 2589 <img src="/Files/images/multi-color.png" class="img-responsive" title='@i.Label' alt='@i.Label' /> 2590 </span> 2591 } 2592 } 2593 &nbsp;<span>(@i.Count)</span> 2594 </label> 2595 </li> 2596 } 2597 </ul> 2598 </div> 2599 } 2600 2601 var categories = facets.Facets.FirstOrDefault(g => g.QueryParameter == "category"); 2602 2603 if (categories != null && categories.Options.Any()) 2604 { 2605 var totalResults = categories.OptionResultTotalCount; 2606 <h3>@Translate("Filters.Categories", "Categories")</h3> 2607 if (totalResults < 10) 2608 { 2609 // show checkboxes 2610 foreach (var i in categories.Options) 2611 { 2612 2613 var isselected = i.Selected ? "checked" : ""; 2614 var inputID = i.Value; 2615 <div class="checkbox"> 2616 <label> 2617 <input type='checkbox' name='@categories.QueryParameter' class='js-select-filter-option' value='@i.Value' @isselected /> @i.Label (@i.Count) 2618 </label> 2619 </div> 2620 } 2621 } 2622 else 2623 { 2624 // show select 2625 <select class="select2 js-select-filter-option js-select2-filter" name='@categories.QueryParameter' multiple="multiple" data-placeholder="@Translate("Smartpage:Ecom.SelectCategory", "Select category...")"> 2626 @foreach (var i in categories.Options) 2627 { 2628 var isselected = i.Selected ? "selected" : ""; 2629 <option class='js-select-filter-option' value='@i.Value' @isselected>@i.Label (@i.Count)</option> 2630 } 2631 </select> 2632 } 2633 2634 } 2635 2636 2637 if (EnableManufacturerFiltering()) 2638 { 2639 var manufacturers = facets.Facets.FirstOrDefault(g => g.QueryParameter == "manuid"); 2640 if (manufacturers != null) 2641 { 2642 var dwManufacturers = Dynamicweb.Ecommerce.Common.Context.Manufacturers; 2643 var manufacturersResults = manufacturers.OptionResultTotalCount; 2644 2645 <div class="filter-manufacturer filter-container clearfix"> 2646 <h3>@Translate("Grower", "Grower")</h3> 2647 2648 @if (manufacturersResults < 10) 2649 { 2650 foreach (var i in manufacturers.Options) 2651 { 2652 2653 bool isChecked = i.Selected; 2654 var inputID = i.Value; 2655 <div class="checkbox"> 2656 <label> 2657 <input type='checkbox' name='@manufacturers.QueryParameter' class='js-select-filter-option' value='@i.Value' checked="@isChecked" /> @i.Label (@i.Count) 2658 </label> 2659 </div> 2660 } 2661 2662 } 2663 else 2664 { 2665 <select class="select2 js-select-filter-option js-select2-filter" name='@manufacturers.QueryParameter' multiple="multiple" data-placeholder="@Translate("Smartpage:Ecom.SelectGrower", "Select grower...")"> 2666 @foreach (var i in manufacturers.Options) 2667 { 2668 var isselected = i.Selected ? "selected" : ""; 2669 var manufacturer = dwManufacturers.FirstOrDefault(m => m.Id == i.Value); 2670 var manufacturerLink = ""; 2671 if (manufacturer != null && !string.IsNullOrEmpty(manufacturer.Web)) 2672 { 2673 manufacturerLink = manufacturer.Web; 2674 if (!manufacturerLink.StartsWith("http", StringComparison.InvariantCultureIgnoreCase)) 2675 { 2676 manufacturerLink = "http://" + manufacturerLink; 2677 } 2678 } 2679 var manufacturerDescription = i.Label + "/" + i.Value; 2680 @*<pre>@string.Join("\n", i.Values.Select(e => string.Format("{0}: {1}", e.Key, System.Web.HttpUtility.HtmlEncode(e.Value))).ToArray())</pre>*@ 2681 2682 <option value='@i.Value' data-link="@manufacturerLink" @isselected>@manufacturerDescription (@i.Count)</option> 2683 } 2684 </select> 2685 } 2686 </div> 2687 } 2688 } 2689 2690 var news = facets.Facets.FirstOrDefault(g => g.QueryParameter == "new"); 2691 if (news != null && news.Options.Any(i => Dynamicweb.Core.Converter.ToBoolean(i.Value))) 2692 { 2693 <div class="clearfix"></div> 2694 <div class="filter-color filter-container"> 2695 <h3>@Translate("Smartpage:NewProduct", "New")</h3> 2696 <ul class="list-unstyled"> 2697 @foreach (var i in news.Options) 2698 { 2699 if (Dynamicweb.Core.Converter.ToBoolean(i.Value)) 2700 { 2701 <li class="col-md-6 col-sm-12"> 2702 <label class="filter-color-item row"> 2703 <input type="checkbox" class="js-select-filter-option" name='@news.QueryParameter' value='@i.Value' checked='@i.Selected' /> 2704 &nbsp;<span title='@i.Value'> 2705 @Translate("show all", "Show all")&nbsp;(@i.Count) 2706 </span> 2707 </label> 2708 </li> 2709 } 2710 } 2711 </ul> 2712 </div> 2713 } 2714 } 2715 } 2716 </form> 2717 2718 2719 @*@Snippet Start("StyleSheet") 2720 <link href="@designBaseUrl/Assets/plugins/bootstrap-slider/dist/css/bootstrap-slider.min.css" rel="stylesheet" /> 2721 <link href="@designBaseUrl/Assets/plugins/selectize.js/dist/css/selectize.css" rel="stylesheet" /> 2722 <link href="@designBaseUrl/Assets/plugins/selectize.js/dist/css/selectize.bootstrap3.css" rel="stylesheet" /> 2723 <link href="@designBaseUrl/Assets/plugins/select2/select2-3.5.4/select2.css" rel="stylesheet" /> 2724 @Snippet End("StyleSheet")*@ 2725 2726 <div class="clearfix">&nbsp;</div> 2727 </div> 2728 <div class="col-sm-9"> 2729 <div class="js-products border-left row"> 2730 @if (Model.TotalProductsCount == 0) 2731 { 2732 <div class="col-sm-12"> 2733 @Translate("Smartpage:eCom.SearchNoProducts", "Ingen produkter matcher dine søgekriterier") 2734 </div> 2735 } 2736 else 2737 { 2738 if (viewMode == "list" || String.IsNullOrEmpty(viewMode)) 2739 { 2740 @RenderListView() 2741 } 2742 else if (viewMode == "grid") 2743 { 2744 @RenderTilesView() 2745 } 2746 else if (viewMode == "photo") 2747 { 2748 @RenderPhotoView() 2749 } 2750 else if (viewMode == "quicklist") 2751 { 2752 @RenderQuicklistView() 2753 } 2754 } 2755 </div> 2756 </div> 2757 <div class="clearfix"></div> 2758 </div> 2759 <div class="productlistnavigation navigation-bottom"> 2760 <span class="productcount"> 2761 @Model.TotalProductsCount 2762 @Translate("SmartPage:Product.Paging.ProductsFound", "produkter fundet") 2763 </span> 2764 2765 @{ 2766 currentPageNumber = string.IsNullOrWhiteSpace(HttpContext.Current.Request["PageNum"]) ? "1": HttpContext.Current.Request["PageNum"]; 2767 if (Converter.ToInt32(currentPageNumber) <= Model.PageCount && Model.PageCount > 0) 2768 { 2769 <input type="hidden" class="current-page js-current-page-number" value='@currentPageNumber' /> 2770 } 2771 } 2772 2773 </div> 2774 2775 2776 2777 <div class="clearfix"></div> 2778 @PricesWithVATStatus("bottom") 2779 2780