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