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_ba22709bfb5048d8b2c8247dab71ff66.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 @using Dynamicweb.Core; 804 805 @{ 806 var designBaseUrl = GetString("Template:DesignBaseUrl").TrimEnd('/'); 807 } 808 809 <form name="EcomSearch" class="form-filters js-form-filters" method="get" action='@SearchEngineFriendlyURLs.GetFriendlyUrl(Converter.ToInt32(Pageview.Page.ID))'> 810 @*<input type="hidden" name="ID" value='@Converter.ToInt32(Pageview.Page.ID)' />*@ 811 @* start - enable ajax loading *@ 812 <input type="hidden" id="js-ajax-filter-enabled" value="true" /> 813 @* end - enable ajax loading *@ 814 @if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["SortBy"])) 815 { 816 <input type="hidden" name="SortBy" value='@Dynamicweb.Context.Current.Request["SortBy"]' /> 817 } 818 @if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["SortOrder"])) 819 { 820 <input type="hidden" name="SortOrder" value='@Dynamicweb.Context.Current.Request["SortOrder"]' /> 821 } 822 @if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["GroupID"])) 823 { 824 <input type="hidden" name="GroupID" value='@Dynamicweb.Context.Current.Request["GroupID"]' /> 825 } 826 @if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["q"])) 827 { 828 <input type="hidden" name="q" value='@Dynamicweb.Context.Current.Request["q"]' /> 829 } 830 831 <input type="submit" class="sr-only"> 832 833 <div class="filter-range"> 834 <h3>@Translate("Potsize", "Pot size")</h3> 835 @{ 836 var potsizes = HttpContext.Current.Request.QueryString.GetValues("potsize"); 837 if (potsizes == null) // Try to get from post instead 838 { 839 potsizes = HttpContext.Current.Request.Form.GetValues("potsize"); 840 } 841 var potsizeMin = 0; 842 var potsizeMax = 0; 843 if (potsizes != null) 844 { 845 if (potsizes.Length == 1) 846 { 847 potsizes = potsizes.First().Split(','); 848 } 849 850 if (potsizes.Length == 2) 851 { 852 potsizeMin = Converter.ToInt32(potsizes.First()); 853 potsizeMax = Converter.ToInt32(potsizes.Last()); 854 } 855 } 856 } 857 <div class="row filter-range-inputs"> 858 <div class="col-xs-4"> 859 <label>@Translate("Smartpage:Min", "min")</label> 860 <input type="number" class="form-control js-min-value" name="potsize" data-is-minimum="true" value='@potsizeMin' /> 861 </div> 862 <div class="col-xs-4 pull-right"> 863 <label>@Translate("Smartpage:Max", "max")</label> 864 @{ 865 if (potsizeMax == 0 || potsizeMax == 9999) 866 { 867 potsizeMax = 30; 868 } 869 } 870 <input type="number" class="form-control js-max-value" data-system-max="9999" data-visual-max="30" name="potsize" value='@potsizeMax' /> 871 </div> 872 <br /> 873 </div> 874 <div class="filter-range-slider js-filter-range-slider"> 875 <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" /> 876 <div class="clearfix"></div> 877 <div class="min-value pull-left">0</div> 878 <div class="max-value pull-right">30+</div> 879 </div> 880 </div> 881 882 <div class="clearfix"></div> 883 884 <div class="filter-range"> 885 <h3>@Translate("Height", "Height")</h3> 886 @{ 887 var heights = HttpContext.Current.Request.QueryString.GetValues("height"); 888 if (heights == null) // Try to get from post instead 889 { 890 heights = HttpContext.Current.Request.Form.GetValues("height"); 891 } 892 var heightMin = 0; 893 var heightMax = 0; 894 if (heights != null) 895 { 896 if (heights.Length == 1) 897 { 898 heights = heights.First().Split(','); 899 } 900 901 if (heights.Length == 2) 902 { 903 heightMin = Converter.ToInt32(heights.First()); 904 heightMax = Converter.ToInt32(heights.Last()); 905 } 906 } 907 } 908 <div class="row filter-range-inputs"> 909 <div class="col-xs-4"> 910 <label>@Translate("Smartpage:Min", "min")</label> 911 <input type="number" class="form-control js-min-value" name="height" data-is-minimum="true" value='@heightMin' /> 912 </div> 913 <div class="col-xs-4 pull-right"> 914 <label>@Translate("Smartpage:Max", "max")</label> 915 @{ 916 if (heightMax == 0 || heightMax == 9999) 917 { 918 heightMax = 200; 919 } 920 } 921 <input type="number" class="form-control js-max-value" data-system-max="9999" data-visual-max="200" name="height" value='@heightMax' /> 922 </div> 923 <br /> 924 </div> 925 <div class="filter-range-slider js-filter-range-slider"> 926 <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" /> 927 <div class="clearfix"></div> 928 <div class="min-value pull-left">0</div> 929 <div class="max-value pull-right">200+</div> 930 </div> 931 </div> 932 933 <div class="clearfix"></div> 934 935 @{ 936 var facets = GetLoop("FacetGroups").FirstOrDefault(); 937 if (facets != null) 938 { 939 var colors = facets.GetLoop("Facets").FirstOrDefault(g => g.GetString("Facet.QueryParameter") == "color"); 940 if (colors != null && colors.GetLoop("FacetOptions").Any()) 941 { 942 <div class="filter-color filter-container clearfix"> 943 <h3>@Translate("Color", "Color")</h3> 944 <ul class="list-unstyled"> 945 @foreach (LoopItem i in colors.GetLoop("FacetOptions")) 946 { 947 <li class="col-md-6 col-sm-12"> 948 <label class="filter-color-item row"> 949 <input type="checkbox" class="js-select-filter-option" name='@colors.GetString("Facet.QueryParameter")' value='@i.GetString("FacetOption.Value")' checked='@i.GetBoolean("FacetOption.Selected")' /> 950 &nbsp; 951 @{ 952 if (i.GetString("FacetOption.Value") != "XXXXXX") 953 { 954 var backgroundColor = "#" + i.GetValue("FacetOption.Value"); 955 <span class="filter-color" style="background-color: @backgroundColor" title='@i.GetValue("FacetOption.Label")'> 956 &nbsp; 957 </span> 958 } 959 else 960 { 961 <span class="filter-color" title='@i.GetValue("FacetOption.Label")'> 962 <img src="/Files/images/multi-color.png" class="img-responsive" title='@i.GetValue("FacetOption.Label")' alt='@i.GetValue("FacetOption.Label")' /> 963 </span> 964 } 965 } 966 &nbsp;<span>(@i.GetValue("FacetOption.Count"))</span> 967 </label> 968 </li> 969 } 970 </ul> 971 </div> 972 } 973 974 var categories = facets.GetLoop("Facets").FirstOrDefault(g => g.GetString("Facet.QueryParameter") == "category"); 975 976 if (categories != null && categories.GetLoop("FacetOptions").Any()) 977 { 978 var totalResults = categories.GetInteger("Facet.OptionWithResultCount"); 979 <h3>@Translate("Filters.Categories", "Categories")</h3> 980 if (totalResults < 10) 981 { 982 // show checkboxes 983 foreach (LoopItem i in categories.GetLoop("FacetOptions")) 984 { 985 986 var isselected = i.GetBoolean("FacetOption.Selected") ? "checked" : ""; 987 var inputID = i.GetValue("FacetOption.Value"); 988 <div class="checkbox"> 989 <label> 990 <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")) 991 </label> 992 </div> 993 } 994 } 995 else 996 { 997 // show select 998 <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...")"> 999 @foreach (LoopItem i in categories.GetLoop("FacetOptions")) 1000 { 1001 var isselected = i.GetBoolean("FacetOption.Selected") ? "selected" : ""; 1002 <option class='js-select-filter-option' value='@i.GetString("FacetOption.Value")' @isselected>@i.GetString("FacetOption.Label") (@i.GetString("FacetOption.Count"))</option> 1003 } 1004 </select> 1005 } 1006 1007 } 1008 1009 1010 if (EnableManufacturerFiltering()) 1011 { 1012 var manufacturers = facets.GetLoop("Facets").FirstOrDefault(g => g.GetString("Facet.QueryParameter") == "manuid"); 1013 if (manufacturers != null) 1014 { 1015 var dwManufacturers = Dynamicweb.Ecommerce.Common.Context.Manufacturers; 1016 var manufacturersResults = manufacturers.GetInteger("Facet.OptionWithResultCount"); 1017 1018 <div class="filter-manufacturer filter-container clearfix"> 1019 <h3>@Translate("Grower", "Grower")</h3> 1020 1021 @if (manufacturersResults < 10) 1022 { 1023 foreach (LoopItem i in manufacturers.GetLoop("FacetOptions")) 1024 { 1025 1026 bool isChecked = i.GetBoolean("FacetOption.Selected"); 1027 var inputID = i.GetValue("FacetOption.Value"); 1028 <div class="checkbox"> 1029 <label> 1030 <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")) 1031 </label> 1032 </div> 1033 } 1034 1035 } 1036 else 1037 { 1038 <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...")"> 1039 @foreach (LoopItem i in manufacturers.GetLoop("FacetOptions")) 1040 { 1041 var isselected = i.GetBoolean("FacetOption.Selected") ? "selected" : ""; 1042 var manufacturer = dwManufacturers.FirstOrDefault(m => m.Id == i.GetString("FacetOption.Value")); 1043 var manufacturerLink = ""; 1044 if (manufacturer != null && !string.IsNullOrEmpty(manufacturer.Web)) 1045 { 1046 manufacturerLink = manufacturer.Web; 1047 if (!manufacturerLink.StartsWith("http", StringComparison.InvariantCultureIgnoreCase)) 1048 { 1049 manufacturerLink = "http://" + manufacturerLink; 1050 } 1051 } 1052 var manufacturerDescription = i.GetString("FacetOption.Label") + "/" + i.GetString("FacetOption.Value"); 1053 @*<pre>@string.Join("\n", i.Values.Select(e => string.Format("{0}: {1}", e.Key, System.Web.HttpUtility.HtmlEncode(e.Value))).ToArray())</pre>*@ 1054 1055 <option value='@i.GetString("FacetOption.Value")' data-link="@manufacturerLink" @isselected>@manufacturerDescription (@i.GetValue("FacetOption.Count"))</option> 1056 } 1057 </select> 1058 } 1059 </div> 1060 } 1061 } 1062 1063 var news = facets.GetLoop("Facets").FirstOrDefault(g => g.GetString("Facet.QueryParameter") == "new"); 1064 if (news != null && news.GetLoop("FacetOptions").Any(i => i.GetBoolean("FacetOption.Value"))) 1065 { 1066 <div class="clearfix"></div> 1067 <div class="filter-color filter-container"> 1068 <h3>@Translate("Smartpage:NewProduct", "New")</h3> 1069 <ul class="list-unstyled"> 1070 @foreach (LoopItem i in news.GetLoop("FacetOptions")) 1071 { 1072 if (i.GetBoolean("FacetOption.Value")) 1073 { 1074 <li class="col-md-6 col-sm-12"> 1075 <label class="filter-color-item row"> 1076 <input type="checkbox" class="js-select-filter-option" name='@news.GetString("Facet.QueryParameter")' value='@i.GetValue("FacetOption.Value")' checked='@i.GetBoolean("FacetOption.Selected")' /> 1077 &nbsp;<span title='@i.GetValue("FacetOption.Value")'> 1078 @Translate("show all", "Show all")&nbsp;(@i.GetValue("FacetOption.Count")) 1079 </span> 1080 </label> 1081 </li> 1082 } 1083 } 1084 </ul> 1085 </div> 1086 } 1087 } 1088 } 1089 </form> 1090 1091 1092 @*@Snippet Start("StyleSheet") 1093 <link href="@designBaseUrl/Assets/plugins/bootstrap-slider/dist/css/bootstrap-slider.min.css" rel="stylesheet" /> 1094 <link href="@designBaseUrl/Assets/plugins/selectize.js/dist/css/selectize.css" rel="stylesheet" /> 1095 <link href="@designBaseUrl/Assets/plugins/selectize.js/dist/css/selectize.bootstrap3.css" rel="stylesheet" /> 1096 <link href="@designBaseUrl/Assets/plugins/select2/select2-3.5.4/select2.css" rel="stylesheet" /> 1097 @Snippet End("StyleSheet")*@ 1098 @* 1099 @GetValue("Ecom:Search.SearchBox") 1100 *@ 1101 <div class="clearfix">&nbsp;</div> 1102 </div> 1103 <div class="col-sm-9"> 1104 <div class="js-products border-left row"> 1105 @if (GetInteger("Ecom:ProductList.PageProdCnt") == 0) 1106 { 1107 <div class="col-sm-12"> 1108 @Translate("Smartpage:eCom.SearchNoProducts", "Ingen produkter matcher dine søgekriterier") 1109 </div> 1110 } 1111 else 1112 { 1113 if (viewMode == "list" || String.IsNullOrEmpty(viewMode)) 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.Core.Converter.ToInt32(Dynamicweb.Context.Current.Request["PageNum"]), 1); 1120 var isLoggedIn = Dynamicweb.Security.UserManagement.User.IsExtranetUserLoggedIn(); 1121 var defaultImage = !string.IsNullOrWhiteSpace(Dynamicweb.Core.Converter.ToString(Pageview.Area.Item["DefaultImage"])) ? Dynamicweb.Core.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"))) && Converter.ToInt32(i.GetValue("CustomerSpecificProductInformation.PricePerColli.UnitPrice.Price")) > 0; 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 if (Converter.ToInt32(i.GetValue("CustomerSpecificProductInformation.PricePerColli.UnitPrice.PriceWithVAT.Value")) > 0) 1277 { 1278 @:@i.GetValue("CustomerSpecificProductInformation.PricePerColli.UnitPrice.PriceWithVAT.Value") 1279 } 1280 } 1281 else 1282 { 1283 if (Converter.ToInt32(i.GetValue("CustomerSpecificProductInformation.PricePerColli.UnitPrice.PriceWithoutVAT.Value")) > 0) 1284 { 1285 @:@i.GetValue("CustomerSpecificProductInformation.PricePerColli.UnitPrice.PriceWithoutVAT.Value") 1286 } 1287 } 1288 </td> 1289 <td class="js-product-field-price js-product-field-price-layer"> 1290 @if (DisplayPricesInclVat()) 1291 { 1292 if (Converter.ToInt32(i.GetValue("CustomerSpecificProductInformation.PricePerLayer.UnitPrice.PriceWithVAT.Value")) > 0) 1293 { 1294 @:@i.GetValue("CustomerSpecificProductInformation.PricePerLayer.UnitPrice.PriceWithVAT.Value") 1295 } 1296 } 1297 else 1298 { 1299 if (Converter.ToInt32(i.GetValue("CustomerSpecificProductInformation.PricePerLayer.UnitPrice.PriceWithoutVAT.Value")) > 0) 1300 { 1301 @:@i.GetValue("CustomerSpecificProductInformation.PricePerLayer.UnitPrice.PriceWithoutVAT.Value") 1302 } 1303 } 1304 </td> 1305 <td class="js-product-field-price js-product-field-price-cc"> 1306 @if (DisplayPricesInclVat()) 1307 { 1308 if (Converter.ToInt32(i.GetValue("CustomerSpecificProductInformation.PricePerCC.UnitPrice.PriceWithVAT.Value")) > 0) 1309 { 1310 @:@i.GetValue("CustomerSpecificProductInformation.PricePerCC.UnitPrice.PriceWithVAT.Value") 1311 } 1312 } 1313 else 1314 { 1315 if (Converter.ToInt32(i.GetValue("CustomerSpecificProductInformation.PricePerCC.UnitPrice.PriceWithoutVAT.Value")) > 0) 1316 { 1317 @:@i.GetValue("CustomerSpecificProductInformation.PricePerCC.UnitPrice.PriceWithoutVAT.Value") 1318 } 1319 } 1320 </td> 1321 </tr> 1322 } 1323 </tbody> 1324 </table> 1325 </div> 1326 } 1327 </div> 1328 <br class="hidden-sm hidden-md hidden-lg" /> 1329 <div class="col-md-3 col-sm-6"> 1330 @if (isLoggedIn && i.GetInteger("Ecom:Product.VariantCount") == 0) 1331 { 1332 1333 var loopCounter = i.GetInteger("Products.LoopCounter") + baseLoopCounter; 1334 var nameProductLoopCounter = "ProductLoopCounter" + loopCounter; 1335 var nameProductIdCounter = "ProductID" + loopCounter; 1336 var nameVariantIdCounter = "VariantID" + loopCounter; 1337 var nameUnitIdCounter = "UnitID" + loopCounter; 1338 var namewishListIdCounter = "wishListID" + loopCounter; 1339 var retailPriceValue = DisplayPricesInclVat() ? i.GetValue("CustomerSpecificProductInformation.CustomerRetailPrice.Price.PriceWithVAT") : i.GetValue("CustomerSpecificProductInformation.CustomerRetailPrice.Price.PriceWithoutVAT"); 1340 retailPriceValue = Dynamicweb.Core.Converter.ToInt32(retailPriceValue) == 0 ? "" : FormatPrice(retailPriceValue.ToString()); 1341 1342 <input type="hidden" value='@loopCounter' name='@nameProductLoopCounter'> 1343 <input type="hidden" class="js-product-id" value='@i.GetValue("Ecom:Product.ID")' name="@nameProductIdCounter"> 1344 <input type="hidden" value="" name="@nameVariantIdCounter"> 1345 <input type="hidden" value="" name="@nameUnitIdCounter"> 1346 <input type="hidden" value="0" name="@namewishListIdCounter"> 1347 1348 if (isDeliverable) 1349 { 1350 <div class="row"> 1351 @renderToolTip() 1352 <div class="col-xs-3 js-quantity-tooltip" data-placement="right" data-toggle="popover" data-trigger="manual"> 1353 @{ 1354 var quantityFieldName = "Quantity" + loopCounter; 1355 bool isServiceProduct = i.GetInteger("Ecom:Product.Type") == 1; 1356 1357 var placeholder = minQty > 0 ? String.Format("min. {0}", minQty) : minQty.ToString(); 1358 1359 <div class="product-list-number"> 1360 <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" /> 1361 </div> 1362 } 1363 </div> 1364 1365 <div class="col-xs-9"> 1366 @foreach (var o in i.GetLoop("Product.OrderLineFields")) 1367 { 1368 var inputName = o.GetString("Ecom:Product.OrderLineField.InputTextFieldName") + loopCounter; 1369 string placeholderText = o.GetString("Ecom:Product.OrderLineField.Name"); 1370 switch (o.GetString("Ecom:Product.OrderLineField.SystemName")) 1371 { 1372 case "OrderLineComment": 1373 if (EnableComments()) 1374 { 1375 placeholderText = Translate("LineComment", "Comment"); 1376 <input type="text" class="form-control" maxlength="80" name="@inputName" placeholder="@placeholderText" /> 1377 } 1378 break; 1379 case "OrderLineColliSize": 1380 <input type="hidden" name="@inputName" value='@i.GetValue("CustomerSpecificProductInformation.ColliSize")' /> 1381 break; 1382 case "OrderLineColliPerLayer": 1383 <input type="hidden" name="@inputName" value='@i.GetValue("CustomerSpecificProductInformation.ColliPerLayer")' /> 1384 break; 1385 case "OrderLineColliPerCC": 1386 <input type="hidden" name="@inputName" value='@i.GetValue("CustomerSpecificProductInformation.ColliPerCC")' /> 1387 break; 1388 case "OrderLineRetailPrice": 1389 placeholderText = Translate("Smartpage:eCom:CustomerSpecificInfo.RetailPrice", "Add retail price"); 1390 <div class="hidden"> 1391 <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" /> 1392 </div> 1393 break; 1394 case "OrderLineItemNumber": 1395 placeholderText = Translate("Smartpage:eCom:CustomerSpecificInfo.ItemNumber", "Item no."); 1396 <div class="hidden"> 1397 <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" /> 1398 </div> 1399 break; 1400 case "OrderLineEAN": 1401 placeholderText = Translate("Deres_EAN_nummer-short", "EAN"); 1402 1403 <div class="hidden"> 1404 <div class="editable" data-placeholder="my placeholder"> 1405 <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" /> 1406 </div> 1407 </div> 1408 1409 break; 1410 default: 1411 <text>@inputName</text> 1412 break; 1413 } 1414 } 1415 </div> 1416 </div> 1417 } 1418 1419 if (EnableDisplayOfGrossMargin() && isDeliverable) 1420 { 1421 double customerSalesPrice = DisplayPricesInclVat() ? i.GetDouble("CustomerSpecificProductInformation.PricePerColli.UnitPrice.PriceWithVAT") : i.GetDouble("CustomerSpecificProductInformation.PricePerColli.UnitPrice.PriceWithoutVAT"); 1422 <div class="row"> 1423 <div class="col-sm-12 col-md-12 col-lg-offset-3 col-lg-9 text-right product-retail-price product-gross-margin-list"> 1424 <i class="js-product-field-gross-margin text-muted"> 1425 <span class="pull-left">@Translate("Smartpage:eCom:CustomerSpecificInfo.GrossMargin", "Gross margin")</span> 1426 <span class="pull-right js-gross-margin-value"> 1427 @if (i.GetInteger("CustomerSpecificProductInformation.CustomerRetailPrice") > 0) 1428 { 1429 @GetGrossMargin(i.GetDouble("CustomerSpecificProductInformation.CustomerRetailPrice"), customerSalesPrice); 1430 } 1431 else 1432 { 1433 @Translate("Smartpage:ecom:CustomerSpecificInfo.GrossMargin.NA", "N/A") 1434 } 1435 </span> 1436 </i> 1437 </div> 1438 </div> 1439 } 1440 1441 if (EnableCustomerRetailPrice() && isDeliverable) 1442 { 1443 //var formattedRetailPrice = DisplayPricesInclVat() ? i.GetValue("CustomerSpecificProductInformation.CustomerRetailPrice.Price.PriceWithVAT") : i.GetValue("CustomerSpecificProductInformation.CustomerRetailPrice.Price.PriceWithoutVAT"); 1444 //formattedRetailPrice = Dynamicweb.Base.ChkDouble(formattedRetailPrice) == 0.00 ? "" : formattedRetailPrice; 1445 1446 <div class="row"> 1447 <div class="col-sm-12 col-md-12 col-lg-offset-3 col-lg-9 text-right product-retail-price product-editable-area"> 1448 1449 @if (EnableEditableRetailPrice() && isDeliverable && !String.IsNullOrEmpty(i.GetString("CustomerSpecificProductInformation.CustomerRetailPrice"))) 1450 { 1451 <div class="product-selectable-edit pull-right"> 1452 <i class="glyphicon glyphicon-edit js-product-fields-edit product-fields-edit" data-source="#js-retail-price-@loopCounter"></i> 1453 </div> 1454 } 1455 <div class="js-product-field-retail-price"> 1456 <span class="pull-left">@Translate("Smartpage:eCom:CustomerSpecificInfo.RetailPrice", "Retail price")</span> 1457 <span class="pull-right">@retailPriceValue</span> 1458 </div> 1459 </div> 1460 </div> 1461 } 1462 1463 if (EnableCustomerItemNumber()) 1464 { 1465 <div class="row"> 1466 1467 <div class="col-sm-12 col-md-12 col-lg-offset-3 col-lg-9 text-right product-item-number product-editable-area"> 1468 1469 @if (EnableEditableItemNumber() && isDeliverable) 1470 { 1471 <div class="product-selectable-edit pull-right"> 1472 <i class="glyphicon glyphicon-edit js-product-fields-edit product-fields-edit" data-source="#js-item-number-@loopCounter"></i> 1473 </div> 1474 } 1475 <div class="js-product-field-item-number text-left"> 1476 <span class="pull-left">@Translate("Smartpage:eCom:CustomerSpecificInfo.ItemNumber", "Item no.")</span> 1477 <span class="pull-right">@i.GetValue("CustomerSpecificProductInformation.CustomerItemNumber")</span> 1478 </div> 1479 </div> 1480 </div> 1481 } 1482 <div class="row"> 1483 <div class="hidden-xs col-sm-3 hidden-md hidden-lg"></div> 1484 <div class="col-sm-12 col-md-12 col-lg-offset-3 col-lg-9 text-right product-editable-area"> 1485 @if (EnableEditableBarcode() && isDeliverable && !String.IsNullOrEmpty(i.GetString("CustomerSpecificProductInformation.EAN"))) 1486 { 1487 <div class="product-selectable-edit pull-right"> 1488 <i class="glyphicon glyphicon-edit js-product-fields-edit product-fields-edit" data-source="#js-ean-number-@loopCounter"></i> 1489 </div> 1490 } 1491 @if (EnableCustomerBarcode() && !String.IsNullOrEmpty(i.GetString("CustomerSpecificProductInformation.EAN"))) 1492 { 1493 <div class="js-product-field-ean text-left"> 1494 <span class="pull-left">@Translate("Deres_EAN_nummer-short", "EAN")</span> 1495 <span class="pull-right">@i.GetValue("CustomerSpecificProductInformation.EAN")</span> 1496 </div> 1497 } 1498 </div> 1499 </div> 1500 1501 if (true) 1502 { 1503 <div class="row"> 1504 <div class="hidden-xs col-sm-3 hidden-md hidden-lg"></div> 1505 <div class="col-sm-9 col-md-12 col-lg-offset-3 col-lg-9 product-editable-area"> 1506 <p>@Translate("Smartpage:Ecom.LeadDaysWarning", "Available on") <span class="label label-warning">@(!string.IsNullOrEmpty(AvailableDeliveryDay(i.GetInteger("Ecom:Product:Field.Gasa:LeadDays.Value"))) ? AvailableDeliveryDay(i.GetInteger("Ecom:Product:Field.Gasa:LeadDays.Value")) : i.GetString("Ecom:Product:Field.SpAvailableFrom.Value"))</span></p> 1507 </div> 1508 </div> 1509 } 1510 1511 } 1512 </div> 1513 </div> 1514 } 1515 </div> 1516 1517 </div> 1518 1519 <input type="submit" value="Add to basket" class="sr-only" /> 1520 1521 @if (isLoggedIn) 1522 { 1523 @SnippetStart("SmartpageAddToBasket") 1524 <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> 1525 @SnippetEnd("SmartpageAddToBasket") 1526 } 1527 </form> 1528 } 1529 else if (viewMode == "grid") 1530 { 1531 <form method="post" class="js-basket-add js-set-tabindex row js-product-form-container" autocomplete="false" data-submit-url='@Pageview.Area.Item["JsonCart"]'> 1532 <input type="hidden" name="CartCmd" value="addmulti" /> 1533 @{ 1534 1535 string pageNum = Dynamicweb.Context.Current.Request["PageNum"]; 1536 var isLoggedIn = Dynamicweb.Security.UserManagement.User.IsExtranetUserLoggedIn(); 1537 var pagenum = 1; 1538 var defaultImage = !string.IsNullOrWhiteSpace(Dynamicweb.Core.Converter.ToString(Pageview.Area.Item["DefaultImage"])) ? Dynamicweb.Core.Converter.ToString(Pageview.Area.Item["DefaultImage"]) : "/Files/images/default-image.png"; 1539 1540 if (Dynamicweb.Core.Converter.ToInt32(Dynamicweb.Context.Current.Request["pagenum"]) > 0) 1541 { 1542 pagenum = Dynamicweb.Core.Converter.ToInt32(Dynamicweb.Context.Current.Request["pagenum"]); 1543 } 1544 1545 var baseLoopCounter = GetInteger("Ecom:ProductList.PageSize") * (pagenum - 1); 1546 } 1547 <div class="col-xs-12"> 1548 <div class="product-grid grid-group js-grid-group"> 1549 @foreach (LoopItem i in GetLoop("Products")) 1550 { 1551 var manufacturerName = i.GetString("Ecom:Manufacturer.Name"); 1552 var manufacturerWebsiteUrl = i.GetString("Ecom:Manufacturer.Web"); 1553 var manufacturerId = i.GetString("Ecom:Manufacturer.ID"); 1554 1555 int minQty = i.GetInteger("Ecom:Product:Field.Gasa:MinimumPurchaseQuantityLimit"); 1556 if (minQty == 0) 1557 { 1558 switch (i.GetString("Ecom:Product:Field.Gasa:MinimumPurchaseQuantity").ToLower().Trim()) 1559 { 1560 case "layer": 1561 minQty = i.GetInteger("CustomerSpecificProductInformation.ColliPerLayer"); 1562 break; 1563 case "cc": 1564 minQty = i.GetInteger("CustomerSpecificProductInformation.ColliPerCC"); 1565 break; 1566 default: 1567 minQty = 1; 1568 break; 1569 } 1570 } 1571 1572 bool isDeliverable = string.IsNullOrEmpty(AvailableDeliveryDay(i.GetInteger("Ecom:Product:Field.Gasa:LeadDays.Value"))) && Converter.ToInt32(i.GetValue("CustomerSpecificProductInformation.PricePerColli.UnitPrice.Price")) > 0; 1573 string cssIDSelector = "js-" + i.GetString("Ecom:Product.ID"); 1574 1575 /*<pre>@string.Join("\n", i.Values.Select(e => string.Format("{0}: {1}", e.Key, System.Web.HttpUtility.HtmlEncode(e.Value))).ToArray())</pre>*/ 1576 <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"> 1577 <div class="grid-group-item-img"> 1578 <a href='@i.GetValue("Ecom:Product.LinkGroup.Clean")' class="js-product-title"> 1579 @{ 1580 var imageUrl = "/Admin/Public/getimage.ashx?Image=" + i.GetString("Ecom:Product.Image.Primary") + "&amp;Resolution=75&amp;Compression=70&amp;Width=190&amp;Height=190&amp;Crop=5&amp;AlternativeImage=" + defaultImage; 1581 } 1582 <img src="@imageUrl" alt='@HttpUtility.HtmlEncode(i.GetString("Ecom:Product.Name"))' class="img-responsive" /> 1583 </a> 1584 1585 @if (i.GetLoop("Ecom:Product.Images.Medium").Count > 1) 1586 { 1587 <span class="label label-info label-amount-pictures"><i class="glyphicon glyphicon-picture"></i> @i.GetLoop("Ecom:Product.Images.Medium").Count</span> 1588 } 1589 1590 @AddedToCart(i, "absolute") 1591 </div> 1592 1593 @*<div> 1594 <h2 class="grid-item-name"> 1595 <a href="@i.GetValue("Ecom:Product.LinkGroup.Clean")">@i.GetValue("Ecom:Product.Name")</a> 1596 @if (i.GetBoolean("Ecom:Product:Field.NewProduct.Value")) 1597 { 1598 <span class="label label-warning">@Translate("Smartpage:NewProduct", "NEW")</span> 1599 } 1600 </h2> 1601 </div> 1602 <div class="product-description"> 1603 @ListStockStatus(i, "tiles") 1604 @i.GetValue("Ecom:Product.ShortDescription") 1605 </div>*@ 1606 <!-- *** --> 1607 1608 <div class="item-description-gallery-view"> 1609 <h2> 1610 <a href="@i.GetValue("Ecom:Product.LinkGroup.Clean")" class="js-product-title">@i.GetValue("Ecom:Product.Name")</a> 1611 @if (i.GetBoolean("Ecom:Product:Field.NewProduct.Value")) 1612 { 1613 <span class="label label-warning">@Translate("Smartpage:NewProduct", "NEW")</span> 1614 } 1615 @if (i.GetBoolean("Ecom:Product:Field.Bestseller.Value")) 1616 { 1617 <span class="label label-warning">@Translate("Smartpage:Bestseller", "BESTSELLER")</span> 1618 } 1619 @if (!string.IsNullOrEmpty(i.GetString("Ecom:Product:Field.NavCompanyCode"))) 1620 { 1621 var flagImgPath = "/Admin/Images/Flags/Small/flag_" + i.GetValue("Ecom:Product:Field.NavCompanyCode") + ".png"; 1622 <img src='@flagImgPath' alt='@i.GetValue("Ecom:Product:Field.NavCompanyCode")' title='@i.GetValue("Ecom:Product:Field.NavCompanyCode")' /> 1623 } 1624 1625 </h2> 1626 <div class="product-description"> 1627 @ListStockStatus(i, "tiles") 1628 @i.GetValue("Ecom:Product.ShortDescription") 1629 </div> 1630 <div class="product-unit"> 1631 &Oslash; @FormatDiameter(i.GetString("Ecom:Product:Field.PotSize.Value") + " cm H: " + i.GetString("Ecom:Product:Field.Height.Value")) cm <br /> 1632 @RenderManufacturer(manufacturerId, manufacturerName, manufacturerWebsiteUrl) 1633 </div> 1634 1635 </div> 1636 1637 1638 1639 1640 1641 <div class="product-grid-price"> 1642 @if (isLoggedIn) 1643 { 1644 <div class="product-price"> 1645 <table class="table"> 1646 <thead> 1647 <tr> 1648 <td>&nbsp;</td> 1649 <th> 1650 <div class="pictogram"> 1651 <div class="pictogram-box"></div> 1652 </div> 1653 </th> 1654 <th> 1655 <div class="pictogram"> 1656 <div class="pictogram-layer"></div> 1657 </div> 1658 </th> 1659 <th> 1660 <div class="pictogram"> 1661 <div class="pictogram-container"></div> 1662 </div> 1663 </th> 1664 </tr> 1665 </thead> 1666 <tbody> 1667 <tr> 1668 <td> 1669 @Translate("Pcs", "Stk") 1670 </td> 1671 <td> 1672 1 &times; 1673 @i.GetValue("CustomerSpecificProductInformation.ColliSize") 1674 </td> 1675 <td> 1676 <span class="js-colli-per-layer">@i.GetValue("CustomerSpecificProductInformation.ColliPerLayer")</span> 1677 &times; @i.GetValue("CustomerSpecificProductInformation.ColliSize") 1678 </td> 1679 <td> 1680 <span class="js-colli-per-cc">@i.GetValue("CustomerSpecificProductInformation.ColliPerCC")</span> 1681 &times; @i.GetValue("CustomerSpecificProductInformation.ColliSize") 1682 </td> 1683 </tr> 1684 1685 @if (!DisablePrices()) 1686 { 1687 <tr> 1688 <td> 1689 @Translate("price", "Pris") 1690 </td> 1691 <td class="js-product-field-price js-product-field-price-colli"> 1692 @if (DisplayPricesInclVat()) 1693 { 1694 if (Converter.ToInt32(i.GetValue("CustomerSpecificProductInformation.PricePerColli.UnitPrice.PriceWithVAT.Value")) > 0) 1695 { 1696 @:@i.GetValue("CustomerSpecificProductInformation.PricePerColli.UnitPrice.PriceWithVAT.Value") 1697 } 1698 } 1699 else 1700 { 1701 if (Converter.ToInt32(i.GetValue("CustomerSpecificProductInformation.PricePerColli.UnitPrice.PriceWithoutVAT.Value")) > 0) 1702 { 1703 @:@i.GetValue("CustomerSpecificProductInformation.PricePerColli.UnitPrice.PriceWithoutVAT.Value") 1704 } 1705 } 1706 </td> 1707 <td class="js-product-field-price js-product-field-price-layer"> 1708 @if (DisplayPricesInclVat()) 1709 { 1710 if (Converter.ToInt32(i.GetValue("CustomerSpecificProductInformation.PricePerLayer.UnitPrice.PriceWithVAT.Value")) > 0) 1711 { 1712 @:@i.GetValue("CustomerSpecificProductInformation.PricePerLayer.UnitPrice.PriceWithVAT.Value") 1713 } 1714 } 1715 else 1716 { 1717 if (Converter.ToInt32(i.GetValue("CustomerSpecificProductInformation.PricePerLayer.UnitPrice.PriceWithoutVAT.Value")) > 0) 1718 { 1719 @:@i.GetValue("CustomerSpecificProductInformation.PricePerLayer.UnitPrice.PriceWithoutVAT.Value") 1720 } 1721 } 1722 </td> 1723 <td class="js-product-field-price js-product-field-price-cc"> 1724 @if (DisplayPricesInclVat()) 1725 { 1726 if (Converter.ToInt32(i.GetValue("CustomerSpecificProductInformation.PricePerCC.UnitPrice.PriceWithVAT.Value")) > 0) 1727 { 1728 @:@i.GetValue("CustomerSpecificProductInformation.PricePerCC.UnitPrice.PriceWithVAT.Value") 1729 } 1730 } 1731 else 1732 { 1733 if (Converter.ToInt32(i.GetValue("CustomerSpecificProductInformation.PricePerCC.UnitPrice.PriceWithoutVAT.Value")) > 0) 1734 { 1735 @:@i.GetValue("CustomerSpecificProductInformation.PricePerCC.UnitPrice.PriceWithoutVAT.Value") 1736 } 1737 } 1738 </td> 1739 </tr> 1740 } 1741 </tbody> 1742 </table> 1743 </div> 1744 <div class="row"> 1745 <div class="editable-area-wrap-tile"> 1746 @if (isLoggedIn) 1747 { 1748 var loopCounter = i.GetInteger("Products.LoopCounter") + baseLoopCounter; 1749 bool isServiceProduct = i.GetInteger("Ecom:Product.Type") == 1; 1750 var nameProductLoopCounter = "ProductLoopCounter" + loopCounter; 1751 var nameProductIdCounter = "ProductID" + loopCounter; 1752 var nameVariantIdCounter = "VariantID" + loopCounter; 1753 var nameUnitIdCounter = "UnitID" + loopCounter; 1754 var namewishListIdCounter = "wishListID" + loopCounter; 1755 var quantityFieldName = "Quantity" + loopCounter; 1756 var retailPriceValue = DisplayPricesInclVat() ? i.GetValue("CustomerSpecificProductInformation.CustomerRetailPrice.Price.PriceWithVAT") : i.GetValue("CustomerSpecificProductInformation.CustomerRetailPrice.Price.PriceWithoutVAT"); 1757 retailPriceValue = Dynamicweb.Core.Converter.ToInt32(retailPriceValue) == 0 ? "" : FormatPrice(retailPriceValue.ToString()); 1758 1759 <input type="hidden" value='@loopCounter' name='@nameProductLoopCounter'> 1760 <input type="hidden" value='@i.GetValue("Ecom:Product.ID")' name="@nameProductIdCounter"> 1761 <input type="hidden" value="" name="@nameVariantIdCounter"> 1762 <input type="hidden" value="" name="@nameUnitIdCounter"> 1763 <input type="hidden" value="0" name="@namewishListIdCounter"> 1764 1765 <!-- ::::::product-editable-area::::::: --> 1766 1767 if (EnableDisplayOfGrossMargin() && isDeliverable) 1768 { 1769 double customerSalesPrice = DisplayPricesInclVat() ? i.GetDouble("CustomerSpecificProductInformation.PricePerColli.UnitPrice.PriceWithVAT") : i.GetDouble("CustomerSpecificProductInformation.PricePerColli.UnitPrice.PriceWithoutVAT"); 1770 <div class="col-xs-12 product-editable-area"> 1771 1772 <i class="js-product-field-gross-margin text-muted"> 1773 <span class="pull-left">@Translate("Smartpage:eCom:CustomerSpecificInfo.GrossMargin", "Gross margin")</span> 1774 <span class="pull-right js-gross-margin-value"> 1775 @if (i.GetInteger("CustomerSpecificProductInformation.CustomerRetailPrice") > 0) 1776 { 1777 @GetGrossMargin(i.GetDouble("CustomerSpecificProductInformation.CustomerRetailPrice"), customerSalesPrice); 1778 } 1779 else 1780 { 1781 @Translate("Smartpage:ecom:CustomerSpecificInfo.GrossMargin.NA", "N/A") 1782 } 1783 </span> 1784 </i> 1785 </div> 1786 } 1787 1788 if (EnableCustomerRetailPrice() && isDeliverable) 1789 { 1790 var formattedRetailPrice = DisplayPricesInclVat() ? i.GetValue("CustomerSpecificProductInformation.CustomerRetailPrice.Price.PriceWithVAT") : i.GetValue("CustomerSpecificProductInformation.CustomerRetailPrice.Price.PriceWithoutVAT"); 1791 formattedRetailPrice = Dynamicweb.Core.Converter.ToDouble(formattedRetailPrice) == 0.00 ? "" : formattedRetailPrice; 1792 <div class="col-xs-12 product-editable-area"> 1793 1794 @if (EnableEditableRetailPrice() && isDeliverable && !String.IsNullOrEmpty(i.GetString("CustomerSpecificProductInformation.CustomerRetailPrice"))) 1795 { 1796 <div class="product-selectable-edit pull-right"> 1797 <i class="glyphicon glyphicon-edit js-product-fields-edit product-fields-edit" data-source="#js-retail-price-@loopCounter"></i> 1798 </div> 1799 } 1800 <div class="js-product-field-retail-price"> 1801 <span class="pull-left">@Translate("Smartpage:eCom:CustomerSpecificInfo.RetailPrice", "Retail price")</span> 1802 <span class="pull-right">@formattedRetailPrice</span> 1803 </div> 1804 </div> 1805 } 1806 1807 1808 if (EnableCustomerItemNumber()) 1809 { 1810 <div class="col-xs-12 product-editable-area"> 1811 1812 @if (EnableEditableItemNumber() && isDeliverable) 1813 { 1814 <div class="product-selectable-edit pull-right"> 1815 <i class="glyphicon glyphicon-edit js-product-fields-edit product-fields-edit" data-source="#js-item-number-@loopCounter"></i> 1816 </div> 1817 } 1818 <div class="js-product-field-item-number text-left"> 1819 <span class="pull-left">@Translate("Smartpage:eCom:CustomerSpecificInfo.ItemNumber", "Item no.")</span> 1820 <span class="pull-right">@i.GetValue("CustomerSpecificProductInformation.CustomerItemNumber")</span> 1821 </div> 1822 </div> 1823 } 1824 1825 <div class="col-xs-12 product-editable-area push-last-row"> 1826 @if (EnableEditableBarcode() && isDeliverable) 1827 { 1828 <div class="pull-right product-selectable-edit"> 1829 <i class="glyphicon glyphicon-edit pull-right js-product-fields-edit product-fields-edit" data-source="#js-ean-number-@loopCounter"></i> 1830 </div> 1831 } 1832 @if (EnableCustomerBarcode() && !String.IsNullOrEmpty(i.GetString("CustomerSpecificProductInformation.EAN"))) 1833 { 1834 <div class="js-product-field-ean text-left"> 1835 <span class="pull-left">@Translate("Deres_EAN_nummer", "EAN")</span> 1836 <span class="pull-right">@i.GetValue("CustomerSpecificProductInformation.EAN")</span> 1837 </div> 1838 } 1839 </div> 1840 1841 <!-- ::::::product-editable-area::::::: --> 1842 1843 if (isDeliverable) 1844 { 1845 var placeholder = minQty > 0 ? String.Format("min. {0}", minQty) : minQty.ToString(); 1846 1847 <div class="col-xs-4 js-quantity-tooltip" data-placement="top" data-toggle="popover" data-trigger="manual" style="padding-right:0;"> 1848 @renderToolTip() 1849 <div class="form-group"> 1850 <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" /> 1851 </div> 1852 </div> 1853 foreach (var o in SortOrderLineFields(i.GetLoop("Product.OrderLineFields"))) 1854 { 1855 var inputName = o.GetString("Ecom:Product.OrderLineField.InputTextFieldName") + loopCounter; 1856 string placeholderText = o.GetString("Ecom:Product.OrderLineField.Name"); 1857 1858 switch (o.GetString("Ecom:Product.OrderLineField.SystemName")) 1859 { 1860 case "OrderLineComment": 1861 if (EnableComments()) 1862 { 1863 placeholderText = Translate("LineComment", "Comment"); 1864 <div class="col-xs-8"> 1865 <div class="form-group"> 1866 <input type="text" class="form-control" name='@inputName' maxlength="80" placeholder='@placeholderText' /> 1867 </div> 1868 </div> 1869 } 1870 break; 1871 case "OrderLineColliSize": 1872 <input type="hidden" name="@inputName" value='@i.GetValue("CustomerSpecificProductInformation.ColliSize")' /> 1873 break; 1874 case "OrderLineColliPerLayer": 1875 <input type="hidden" name="@inputName" value='@i.GetValue("CustomerSpecificProductInformation.ColliPerLayer")' /> 1876 break; 1877 case "OrderLineColliPerCC": 1878 <input type="hidden" name="@inputName" value='@i.GetValue("CustomerSpecificProductInformation.ColliPerCC")' /> 1879 break; 1880 case "OrderLineEAN": 1881 placeholderText = Translate("Deres_EAN_nummer-short", "EAN"); 1882 <div class="hidden"> 1883 <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" /> 1884 </div> 1885 break; 1886 case "OrderLineRetailPrice": 1887 placeholderText = Translate("Smartpage:eCom:CustomerSpecificInfo.RetailPrice", "Add retail price"); 1888 <div class="hidden"> 1889 <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" /> 1890 </div> 1891 break; 1892 case "OrderLineItemNumber": 1893 placeholderText = Translate("Smartpage:eCom:CustomerSpecificInfo.ItemNumber", "Item no."); 1894 <div class="hidden"> 1895 <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" /> 1896 </div> 1897 break; 1898 } 1899 } 1900 } 1901 else 1902 { 1903 <div class="col-sm-12 text-center product-not-available"> 1904 <p>@Translate("Smartpage:Ecom.LeadDaysWarning.Short", "Available on") <span class="label label-warning">@(!string.IsNullOrEmpty(AvailableDeliveryDay(i.GetInteger("Ecom:Product:Field.Gasa:LeadDays.Value"))) ? AvailableDeliveryDay(i.GetInteger("Ecom:Product:Field.Gasa:LeadDays.Value")) : i.GetString("Ecom:Product:Field.SpAvailableFrom.Value"))</span></p> 1905 </div> 1906 } 1907 } 1908 </div> 1909 </div> 1910 } 1911 </div> 1912 <div class="clearfix"></div> 1913 </div> 1914 1915 1916 } 1917 </div> 1918 </div> 1919 1920 1921 1922 <input type="submit" value="Add to basket" class="sr-only" /> 1923 @if (isLoggedIn) 1924 { 1925 @SnippetStart("SmartpageAddToBasket") 1926 <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> 1927 @SnippetEnd("SmartpageAddToBasket") 1928 } 1929 </form> 1930 1931 } 1932 else if (viewMode == "photo") 1933 { 1934 <form method="post" class="js-basket-add js-set-tabindex row js-product-form-container" autocomplete="false" data-submit-url='@Pageview.Area.Item["JsonCart"]'> 1935 <input type="hidden" name="CartCmd" value="addmulti" /> 1936 @{ 1937 var isLoggedIn = Dynamicweb.Security.UserManagement.User.IsExtranetUserLoggedIn(); 1938 var pagenum = 1; 1939 var defaultImage = !string.IsNullOrWhiteSpace(Dynamicweb.Core.Converter.ToString(Pageview.Area.Item["DefaultImage"])) ? Dynamicweb.Core.Converter.ToString(Pageview.Area.Item["DefaultImage"]) : "/Files/images/default-image.png"; 1940 1941 if (Dynamicweb.Core.Converter.ToInt32(Dynamicweb.Context.Current.Request["pagenum"]) > 0) 1942 { 1943 pagenum = Dynamicweb.Core.Converter.ToInt32(Dynamicweb.Context.Current.Request["pagenum"]); 1944 } 1945 1946 var baseLoopCounter = GetInteger("Ecom:ProductList.PageSize") * (pagenum - 1); 1947 } 1948 <div class="col-xs-12"> 1949 <div class="product-grid photo-group js-grid-group"> 1950 @foreach (LoopItem i in GetLoop("Products")) 1951 { 1952 var manufacturerName = i.GetString("Ecom:Manufacturer.Name"); 1953 var manufacturerWebsiteUrl = i.GetString("Ecom:Manufacturer.Web"); 1954 var manufacturerId = i.GetString("Ecom:Manufacturer.ID"); 1955 1956 int minQty = i.GetInteger("Ecom:Product:Field.Gasa:MinimumPurchaseQuantityLimit"); 1957 if (minQty == 0) 1958 { 1959 switch (i.GetString("Ecom:Product:Field.Gasa:MinimumPurchaseQuantity").ToLower().Trim()) 1960 { 1961 case "layer": 1962 minQty = i.GetInteger("CustomerSpecificProductInformation.ColliPerLayer"); 1963 break; 1964 case "cc": 1965 minQty = i.GetInteger("CustomerSpecificProductInformation.ColliPerCC"); 1966 break; 1967 default: 1968 minQty = 1; 1969 break; 1970 } 1971 } 1972 1973 bool isDeliverable = string.IsNullOrEmpty(AvailableDeliveryDay(i.GetInteger("Ecom:Product:Field.Gasa:LeadDays.Value"))) && Converter.ToInt32(i.GetValue("CustomerSpecificProductInformation.PricePerColli.UnitPrice.Price")) > 0; 1974 string cssIDSelector = "js-" + i.GetString("Ecom:Product.ID"); 1975 1976 /*<pre>@string.Join("\n", i.Values.Select(e => string.Format("{0}: {1}", e.Key, System.Web.HttpUtility.HtmlEncode(e.Value))).ToArray())</pre>*/ 1977 <div class='photo-group-item col-xs-12 clearfix js-product js-grid-product' data-min-quantity="@minQty" id="@cssIDSelector"> 1978 <div class="col-sm-6 col-md-3"> 1979 <div class="photo-group-item-img"> 1980 <a href='@i.GetValue("Ecom:Product.LinkGroup.Clean")' class="js-product-title"> 1981 @{ 1982 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; 1983 } 1984 <img src="@imageUrl" alt='@HttpUtility.HtmlEncode(i.GetString("Ecom:Product.Name"))' class="img-responsive" /> 1985 </a> 1986 @if (i.GetLoop("Ecom:Product.Images.Medium").Count > 1) 1987 { 1988 <span class="label label-info label-amount-pictures"><i class="glyphicon glyphicon-picture"></i> @i.GetLoop("Ecom:Product.Images.Medium").Count</span> 1989 } 1990 @AddedToCart(i, "absolute") 1991 </div> 1992 </div> 1993 1994 <div class="col-sm-6 col-md-4 photo-group-item-details"> 1995 <h2 class="grid-item-name grid-item-name-photo"> 1996 <a href="@i.GetValue("Ecom:Product.LinkGroup.Clean")" class="js-product-title">@i.GetValue("Ecom:Product.Name")</a> 1997 @if (i.GetBoolean("Ecom:Product:Field.NewProduct.Value")) 1998 { 1999 <span class="label label-warning">@Translate("Smartpage:NewProduct", "NEW")</span> 2000 } 2001 @if (i.GetBoolean("Ecom:Product:Field.Bestseller.Value")) 2002 { 2003 <span class="label label-warning">@Translate("Smartpage:Bestseller", "BESTSELLER")</span> 2004 } 2005 @if (!string.IsNullOrEmpty(i.GetString("Ecom:Product:Field.NavCompanyCode"))) 2006 { 2007 var flagImgPath = "/Admin/Images/Flags/Small/flag_" + i.GetValue("Ecom:Product:Field.NavCompanyCode") + ".png"; 2008 <img src='@flagImgPath' alt='@i.GetValue("Ecom:Product:Field.NavCompanyCode")' title='@i.GetValue("Ecom:Product:Field.NavCompanyCode")' /> 2009 } 2010 </h2> 2011 <div class="product-description"> 2012 @i.GetValue("Ecom:Product.ShortDescription") 2013 @ListStockStatus(i, "photo") 2014 </div> 2015 <div class="product-unit"> 2016 &Oslash; @FormatDiameter(i.GetString("Ecom:Product:Field.PotSize.Value") + " cm H: " + i.GetString("Ecom:Product:Field.Height.Value")) cm <br /> 2017 @RenderManufacturer(manufacturerId, manufacturerName, manufacturerWebsiteUrl) 2018 </div> 2019 2020 @if (isLoggedIn) 2021 { 2022 <div class="product-price"> 2023 <table class="table"> 2024 <thead> 2025 <tr> 2026 <td>&nbsp;</td> 2027 <th> 2028 <div class="pictogram"> 2029 <div class="pictogram-box"></div> 2030 </div> 2031 </th> 2032 <th> 2033 <div class="pictogram"> 2034 <div class="pictogram-layer"></div> 2035 </div> 2036 </th> 2037 <th> 2038 <div class="pictogram"> 2039 <div class="pictogram-container"></div> 2040 </div> 2041 </th> 2042 </tr> 2043 </thead> 2044 <tbody> 2045 <tr> 2046 <td> 2047 @Translate("Pcs", "Stk") 2048 </td> 2049 <td> 2050 1 &times; 2051 @i.GetValue("CustomerSpecificProductInformation.ColliSize") 2052 </td> 2053 <td> 2054 <span class="js-colli-per-layer">@i.GetValue("CustomerSpecificProductInformation.ColliPerLayer")</span> 2055 &times; @i.GetValue("CustomerSpecificProductInformation.ColliSize") 2056 </td> 2057 <td> 2058 <span class="js-colli-per-cc">@i.GetValue("CustomerSpecificProductInformation.ColliPerCC")</span> 2059 &times; @i.GetValue("CustomerSpecificProductInformation.ColliSize") 2060 </td> 2061 </tr> 2062 @if (!DisablePrices()) 2063 { 2064 <tr> 2065 <td> 2066 @Translate("price", "Pris") 2067 </td> 2068 <td class="js-product-field-price js-product-field-price-colli"> 2069 @if (DisplayPricesInclVat()) 2070 { 2071 if (Converter.ToInt32(i.GetValue("CustomerSpecificProductInformation.PricePerColli.UnitPrice.PriceWithVAT.Value")) > 0) 2072 { 2073 @:@i.GetValue("CustomerSpecificProductInformation.PricePerColli.UnitPrice.PriceWithVAT.Value") 2074 } 2075 } 2076 else 2077 { 2078 if (Converter.ToInt32(i.GetValue("CustomerSpecificProductInformation.PricePerColli.UnitPrice.PriceWithoutVAT.Value")) > 0) 2079 { 2080 @:@i.GetValue("CustomerSpecificProductInformation.PricePerColli.UnitPrice.PriceWithoutVAT.Value") 2081 } 2082 } 2083 </td> 2084 <td class="js-product-field-price js-product-field-price-layer"> 2085 @if (DisplayPricesInclVat()) 2086 { 2087 if (Converter.ToInt32(i.GetValue("CustomerSpecificProductInformation.PricePerLayer.UnitPrice.PriceWithVAT.Value")) > 0) 2088 { 2089 @:@i.GetValue("CustomerSpecificProductInformation.PricePerLayer.UnitPrice.PriceWithVAT.Value") 2090 } 2091 } 2092 else 2093 { 2094 if (Converter.ToInt32(i.GetValue("CustomerSpecificProductInformation.PricePerLayer.UnitPrice.PriceWithoutVAT.Value")) > 0) 2095 { 2096 @:@i.GetValue("CustomerSpecificProductInformation.PricePerLayer.UnitPrice.PriceWithoutVAT.Value") 2097 } 2098 } 2099 </td> 2100 <td class="js-product-field-price js-product-field-price-cc"> 2101 @if (DisplayPricesInclVat()) 2102 { 2103 if (Converter.ToInt32(i.GetValue("CustomerSpecificProductInformation.PricePerCC.UnitPrice.PriceWithVAT.Value")) > 0) 2104 { 2105 @:@i.GetValue("CustomerSpecificProductInformation.PricePerCC.UnitPrice.PriceWithVAT.Value") 2106 } 2107 } 2108 else 2109 { 2110 if (Converter.ToInt32(i.GetValue("CustomerSpecificProductInformation.PricePerCC.UnitPrice.PriceWithoutVAT.Value")) > 0) 2111 { 2112 @:@i.GetValue("CustomerSpecificProductInformation.PricePerCC.UnitPrice.PriceWithoutVAT.Value") 2113 } 2114 } 2115 </td> 2116 </tr> 2117 } 2118 </tbody> 2119 </table> 2120 </div> 2121 } 2122 </div> 2123 2124 <div class="clearfix visible-sm visible-xs"></div> 2125 <div class="col-md-5 col-sm-6 hidden-xs"></div> 2126 <div class="col-md-5 col-sm-6 col-xs-12"> 2127 <div class="product-informations"> 2128 @* if (!String.IsNullOrEmpty(i.GetString("CustomerSpecificProductInformation.CustomerItemNumber"))) 2129 { 2130 <span class="detail-info"> 2131 @Translate("Deres_varenummer", "Your Item No."): @i.GetValue("CustomerSpecificProductInformation.CustomerItemNumber") 2132 </span> 2133 <br /> 2134 } 2135 @if (i.GetDouble("CustomerSpecificProductInformation.CustomerRetailPrice") > 0) 2136 { 2137 <span class="detail-info"> 2138 @Translate("Deres_udsalgspris", "Your Retail Price"): @i.GetValue("CustomerSpecificProductInformation.CustomerRetailPrice.Price") 2139 </span> 2140 <br /> 2141 }*@ 2142 @if (!String.IsNullOrEmpty(i.GetString("CustomerSpecificProductInformation.CustomerSpecificRemark"))) 2143 { 2144 <span class="detail-info"> 2145 @Translate("Deres_bemaerkning", "Your Comment"): @i.GetValue("CustomerSpecificProductInformation.CustomerSpecificRemark") 2146 </span> 2147 <br /> 2148 } 2149 </div> 2150 <div class="product-photo-price"> 2151 @if (isLoggedIn) 2152 { 2153 var loopCounter = i.GetInteger("Products.LoopCounter") + baseLoopCounter; 2154 var nameProductLoopCounter = "ProductLoopCounter" + loopCounter; 2155 var nameProductIdCounter = "ProductID" + loopCounter; 2156 var nameVariantIdCounter = "VariantID" + loopCounter; 2157 var nameUnitIdCounter = "UnitID" + loopCounter; 2158 var namewishListIdCounter = "wishListID" + loopCounter; 2159 var cssIsAvailable = isDeliverable ? "available" : "not-available"; 2160 var retailPriceValue = DisplayPricesInclVat() ? i.GetValue("CustomerSpecificProductInformation.CustomerRetailPrice.Price.PriceWithVAT") : i.GetValue("CustomerSpecificProductInformation.CustomerRetailPrice.Price.PriceWithoutVAT"); 2161 retailPriceValue = Dynamicweb.Core.Converter.ToInt32(retailPriceValue) == 0 ? "" : FormatPrice(retailPriceValue.ToString()); 2162 2163 <input type="hidden" value='@loopCounter' name='@nameProductLoopCounter'> 2164 <input type="hidden" value='@i.GetValue("Ecom:Product.ID")' name="@nameProductIdCounter"> 2165 <input type="hidden" value="" name="@nameVariantIdCounter"> 2166 <input type="hidden" value="" name="@nameUnitIdCounter"> 2167 <input type="hidden" value="0" name="@namewishListIdCounter"> 2168 2169 <div class='row product-photo-price-element @cssIsAvailable'> 2170 2171 @if (EnableDisplayOfGrossMargin() && isDeliverable) 2172 { 2173 double customerSalesPrice = DisplayPricesInclVat() ? i.GetDouble("CustomerSpecificProductInformation.PricePerColli.UnitPrice.PriceWithVAT") : i.GetDouble("CustomerSpecificProductInformation.PricePerColli.UnitPrice.PriceWithoutVAT"); 2174 <div class="col-xs-9 col-xs-offset-3 product-editable-area"> 2175 <i class="js-product-field-gross-margin text-muted"> 2176 <span class="pull-left">@Translate("Smartpage:eCom:CustomerSpecificInfo.GrossMargin", "Gross margin")</span> 2177 <span class="pull-right js-gross-margin-value"> 2178 @if (i.GetInteger("CustomerSpecificProductInformation.CustomerRetailPrice") > 0) 2179 { 2180 @GetGrossMargin(i.GetDouble("CustomerSpecificProductInformation.CustomerRetailPrice"), customerSalesPrice); 2181 } 2182 else 2183 { 2184 @Translate("Smartpage:ecom:CustomerSpecificInfo.GrossMargin.NA", "N/A") 2185 } 2186 </span> 2187 </i> 2188 </div> 2189 } 2190 2191 @if (EnableCustomerRetailPrice() && isDeliverable) 2192 { 2193 var formattedRetailPrice = DisplayPricesInclVat() ? i.GetValue("CustomerSpecificProductInformation.CustomerRetailPrice.Price.PriceWithVAT") : i.GetValue("CustomerSpecificProductInformation.CustomerRetailPrice.Price.PriceWithoutVAT"); 2194 formattedRetailPrice = Dynamicweb.Core.Converter.ToDouble(formattedRetailPrice) == 0.00 ? "" : formattedRetailPrice; 2195 <div class="col-xs-9 col-xs-offset-3 product-editable-area"> 2196 2197 @if (EnableEditableRetailPrice() && isDeliverable && !String.IsNullOrEmpty(i.GetString("CustomerSpecificProductInformation.CustomerRetailPrice"))) 2198 { 2199 <div class="product-selectable-edit pull-right"> 2200 <i class="glyphicon glyphicon-edit js-product-fields-edit product-fields-edit" data-source="#js-retail-price-@loopCounter"></i> 2201 </div> 2202 } 2203 <div class="js-product-field-retail-price"> 2204 <span class="pull-left">@Translate("Smartpage:eCom:CustomerSpecificInfo.RetailPrice", "Retail price")</span> 2205 <span class="pull-right">@formattedRetailPrice</span> 2206 </div> 2207 </div> 2208 } 2209 2210 @if (EnableCustomerItemNumber()) 2211 { 2212 <div class="col-xs-9 col-xs-offset-3 product-editable-area"> 2213 2214 @if (EnableEditableItemNumber() && isDeliverable) 2215 { 2216 <div class="product-selectable-edit pull-right"> 2217 <i class="glyphicon glyphicon-edit js-product-fields-edit product-fields-edit" data-source="#js-item-number-@loopCounter"></i> 2218 </div> 2219 } 2220 <div class="js-product-field-item-number text-left"> 2221 <span class="pull-left">@Translate("Smartpage:eCom:CustomerSpecificInfo.ItemNumber", "Item no.")</span> 2222 <span class="pull-right">@i.GetValue("CustomerSpecificProductInformation.CustomerItemNumber")</span> 2223 </div> 2224 </div> 2225 } 2226 2227 2228 <div class="col-xs-9 col-xs-offset-3 product-editable-area"> 2229 @if (EnableEditableBarcode() && isDeliverable) 2230 { 2231 <div class="pull-right product-selectable-edit"> 2232 <i class="glyphicon glyphicon-edit pull-right js-product-fields-edit product-fields-edit" data-source="#js-ean-number-@loopCounter"></i> 2233 </div> 2234 } 2235 @if (EnableCustomerBarcode() && !String.IsNullOrEmpty(i.GetString("CustomerSpecificProductInformation.EAN"))) 2236 { 2237 <div class="js-product-field-ean text-left"> 2238 <span class="pull-left">@Translate("Deres_EAN_nummer", "EAN")</span> 2239 <span class="pull-right">@i.GetValue("CustomerSpecificProductInformation.EAN")</span> 2240 </div> 2241 } 2242 </div> 2243 2244 @if (isDeliverable) 2245 { 2246 var placeholder = minQty > 0 ? String.Format("min. {0}", minQty) : minQty.ToString(); 2247 2248 <div class="col-xs-3 js-quantity-tooltip" data-placement="top" data-toggle="popover" data-trigger="manual"> 2249 @renderToolTip() 2250 @{ 2251 var quantityFieldName = "Quantity" + loopCounter; 2252 bool isServiceProduct = i.GetInteger("Ecom:Product.Type") == 1; 2253 2254 <div class="form-group"> 2255 <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" /> 2256 </div> 2257 } 2258 </div> 2259 <div class="col-xs-9"> 2260 @foreach (var o in SortOrderLineFields(i.GetLoop("Product.OrderLineFields"))) 2261 { 2262 var inputName = o.GetString("Ecom:Product.OrderLineField.InputTextFieldName") + loopCounter; 2263 string placeholderText = o.GetString("Ecom:Product.OrderLineField.Name"); 2264 2265 switch (o.GetString("Ecom:Product.OrderLineField.SystemName")) 2266 { 2267 case "OrderLineComment": 2268 if (EnableComments()) 2269 { 2270 placeholderText = Translate("LineComment", "Comment"); 2271 <div class="form-group"> 2272 <input type="text" class="form-control" maxlength="80" name="@inputName" placeholder="@placeholderText" /> 2273 </div> 2274 } 2275 break; 2276 case "OrderLineColliSize": 2277 <input type="hidden" name="@inputName" value='@i.GetValue("CustomerSpecificProductInformation.ColliSize")' /> 2278 break; 2279 case "OrderLineColliPerLayer": 2280 <input type="hidden" name="@inputName" value='@i.GetValue("CustomerSpecificProductInformation.ColliPerLayer")' /> 2281 break; 2282 case "OrderLineColliPerCC": 2283 <input type="hidden" name="@inputName" value='@i.GetValue("CustomerSpecificProductInformation.ColliPerCC")' /> 2284 break; 2285 case "OrderLineRetailPrice": 2286 placeholderText = Translate("Smartpage:eCom:CustomerSpecificInfo.RetailPrice", "Add retail price"); 2287 <div class="hidden"> 2288 <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" /> 2289 </div> 2290 break; 2291 case "OrderLineItemNumber": 2292 placeholderText = Translate("Smartpage:eCom:CustomerSpecificInfo.ItemNumber", "Item no."); 2293 <div class="hidden"> 2294 <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" /> 2295 </div> 2296 break; 2297 case "OrderLineEAN": 2298 placeholderText = Translate("Deres_EAN_nummer-short", "EAN"); 2299 <div class="hidden"> 2300 <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" /> 2301 </div> 2302 break; 2303 } 2304 } 2305 </div> 2306 } 2307 else 2308 { 2309 <div class="col-xs-9 col-xs-offset-3"> 2310 <span class="pull-left">@Translate("Smartpage:Ecom.LeadDaysWarning.Short", "Available on")</span> <span class="label label-warning pull-right not-deliverable">@(!string.IsNullOrEmpty(AvailableDeliveryDay(i.GetInteger("Ecom:Product:Field.Gasa:LeadDays.Value"))) ? AvailableDeliveryDay(i.GetInteger("Ecom:Product:Field.Gasa:LeadDays.Value")) : i.GetString("Ecom:Product:Field.SpAvailableFrom.Value"))</span> 2311 </div> 2312 } 2313 </div> 2314 } 2315 </div> 2316 </div> 2317 </div> 2318 } 2319 </div> 2320 </div> 2321 2322 <input type="submit" value="Add to basket" class="sr-only" /> 2323 2324 @if (isLoggedIn) 2325 { 2326 @SnippetStart("SmartpageAddToBasket") 2327 <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> 2328 @SnippetEnd("SmartpageAddToBasket") 2329 } 2330 </form> 2331 2332 } 2333 else if (viewMode == "quicklist") 2334 { 2335 <form method="post" class="js-basket-add js-set-tabindex js-product-form-container" autocomplete="false" data-submit-url='@Pageview.Area.Item["JsonCart"]'> 2336 <input type="hidden" name="CartCmd" value="addmulti" /> 2337 @{ 2338 2339 int pageNum = Math.Max(Dynamicweb.Core.Converter.ToInt32(Dynamicweb.Context.Current.Request["PageNum"]), 1); 2340 var isLoggedIn = Dynamicweb.Security.UserManagement.User.IsExtranetUserLoggedIn(); 2341 var pagenum = 1; 2342 var defaultImage = !string.IsNullOrWhiteSpace(Dynamicweb.Core.Converter.ToString(Pageview.Area.Item["DefaultImage"])) ? Dynamicweb.Core.Converter.ToString(Pageview.Area.Item["DefaultImage"]) : "/Files/images/default-image.png"; 2343 2344 if (Dynamicweb.Core.Converter.ToInt32(Dynamicweb.Context.Current.Request["pagenum"]) > 0) 2345 { 2346 pagenum = Dynamicweb.Core.Converter.ToInt32(Dynamicweb.Context.Current.Request["pagenum"]); 2347 } 2348 2349 var baseLoopCounter = GetInteger("Ecom:ProductList.PageSize") * (pagenum - 1); 2350 } 2351 <div class="clearfix"></div> 2352 <div class="col-sm-12"> 2353 <div class="product-list list-group js-grid-group"> 2354 2355 @foreach (LoopItem i in GetLoop("Products")) 2356 { 2357 2358 var manufacturerName = i.GetString("Ecom:Manufacturer.Name"); 2359 var manufacturerWebsiteUrl = i.GetString("Ecom:Manufacturer.Web"); 2360 var manufacturerId = i.GetString("Ecom:Manufacturer.ID"); 2361 2362 int minQty = i.GetInteger("Ecom:Product:Field.Gasa:MinimumPurchaseQuantityLimit"); 2363 if (minQty == 0) 2364 { 2365 switch (i.GetString("Ecom:Product:Field.Gasa:MinimumPurchaseQuantity").ToLower().Trim()) 2366 { 2367 case "layer": 2368 minQty = i.GetInteger("CustomerSpecificProductInformation.ColliPerLayer"); 2369 break; 2370 case "cc": 2371 minQty = i.GetInteger("CustomerSpecificProductInformation.ColliPerCC"); 2372 break; 2373 default: 2374 minQty = 1; 2375 break; 2376 } 2377 } 2378 2379 bool isDeliverable = string.IsNullOrEmpty(AvailableDeliveryDay(i.GetInteger("Ecom:Product:Field.Gasa:LeadDays.Value"))) && Converter.ToInt32(i.GetValue("CustomerSpecificProductInformation.PricePerColli.UnitPrice.Price")) > 0; 2380 2381 /*<pre>@string.Join("\n", i.Values.Select(e => string.Format("{0}: {1}", e.Key, System.Web.HttpUtility.HtmlEncode(e.Value))).ToArray())</pre>*/ 2382 2383 string cssIDSelector = "js-" + i.GetString("Ecom:Product.ID"); 2384 2385 <div class="list-group-item row js-product border-bottom js-grid-product" data-min-quantity='@minQty' id="@cssIDSelector" data-page-num="@pageNum"> 2386 2387 @*<div class="col-sm-1 list-group-item-img"> 2388 @{ 2389 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"; 2390 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; 2391 } 2392 <a class="js-preview js-product-title" href='@i.GetValue("Ecom:Product.LinkGroup.Clean")' data-preview='@previewImageUrl'> 2393 <img src="@imageUrl" alt='@HttpUtility.HtmlEncode(i.GetString("Ecom:Product.Name"))' class="img-responsive" /> 2394 </a> 2395 @if (i.GetLoop("Ecom:Product.Images.Medium").Count > 1) 2396 { 2397 <span class="label label-info label-amount-pictures"><i class="glyphicon glyphicon-picture"></i> @i.GetLoop("Ecom:Product.Images.Medium").Count</span> 2398 } 2399 </div>*@ 2400 2401 <div class="col-sm-4"> 2402 2403 <h2 class="grid-item-name-list grid-item-name"> 2404 2405 @{ 2406 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; 2407 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; 2408 } 2409 2410 <a class="js-preview" href='@i.GetValue("Ecom:Product.LinkGroup.Clean")' data-preview='@previewImageUrl'> 2411 <img src="@imageUrl" alt='@HttpUtility.HtmlEncode(i.GetString("Ecom:Product.Name"))' class="img-responsive" style="display:inline-block;border:1px solid #8ec13c;" /> 2412 </a> 2413 2414 <a href="@i.GetValue("Ecom:Product.LinkGroup.Clean")" class="js-product-title">@i.GetValue("Ecom:Product.Name")</a> 2415 2416 @if (i.GetBoolean("Ecom:Product:Field.NewProduct.Value")) 2417 { 2418 <span class="label label-warning">@Translate("Smartpage:NewProduct", "NEW")</span> 2419 } 2420 @if (i.GetBoolean("Ecom:Product:Field.Bestseller.Value")) 2421 { 2422 <span class="label label-warning">@Translate("Smartpage:Bestseller", "BESTSELLER")</span> 2423 } 2424 @if (!string.IsNullOrEmpty(i.GetString("Ecom:Product:Field.NavCompanyCode"))) 2425 { 2426 var flagImgPath = "/Admin/Images/Flags/Small/flag_" + i.GetValue("Ecom:Product:Field.NavCompanyCode") + ".png"; 2427 <img src='@flagImgPath' alt='@i.GetValue("Ecom:Product:Field.NavCompanyCode")' title='@i.GetValue("Ecom:Product:Field.NavCompanyCode")' /> 2428 } 2429 2430 </h2> 2431 2432 <div class="shortdescription"> 2433 @AddedToCart(i, "standard") 2434 <p style="margin:0;">@i.GetValue("Ecom:Product.ShortDescription")</p> 2435 @ListStockStatus(i, "list") 2436 </div> 2437 2438 <div class="manufacturer-website hidden-sm hidden-xs"> 2439 @RenderManufacturer(manufacturerId, manufacturerName, manufacturerWebsiteUrl) <br /> 2440 @*@FormatDiameter("H: " + i.GetString("Ecom:Product:Field.Height.Value") + " cm")*@ 2441 </div> 2442 2443 </div> 2444 <div class="col-md-1 col-sm-5"> 2445 <div class="potsize text-right hidden-sm hidden-xs "> 2446 @FormatDiameter(i.GetString("Ecom:Product:Field.PotSize.Value") + " cm ") 2447 </div> 2448 <div class="hidden-md hidden-lg"> 2449 @FormatDiameter(i.GetString("Ecom:Product:Field.PotSize.Value")) cm 2450 @RenderManufacturer(manufacturerId, manufacturerName, manufacturerWebsiteUrl) <br /> 2451 @*@FormatDiameter("H: " + i.GetString("Ecom:Product:Field.Height.Value") + " cm")*@ 2452 </div> 2453 </div> 2454 <div class="clearfix visible-sm"></div> 2455 <div class="col-md-4 col-sm-6"> 2456 @if (isLoggedIn) 2457 { 2458 <div class="product-price"> 2459 <table class="table"> 2460 @*<thead> 2461 <tr> 2462 <td>&nbsp;</td> 2463 <th> 2464 <div class="pictogram"> 2465 <div class="pictogram-box"></div> 2466 </div> 2467 </th> 2468 <th> 2469 <div class="pictogram"> 2470 <div class="pictogram-layer"></div> 2471 </div> 2472 </th> 2473 <th> 2474 <div class="pictogram"> 2475 <div class="pictogram-container"></div> 2476 </div> 2477 </th> 2478 </tr> 2479 </thead>*@ 2480 <tbody> 2481 <tr> 2482 <td> 2483 @Translate("Pcs", "Stk") 2484 </td> 2485 <td> 2486 1 &times; 2487 @i.GetValue("CustomerSpecificProductInformation.ColliSize") 2488 </td> 2489 <td> 2490 <span class="js-colli-per-layer">@i.GetValue("CustomerSpecificProductInformation.ColliPerLayer")</span> 2491 &times; @i.GetValue("CustomerSpecificProductInformation.ColliSize") 2492 </td> 2493 <td> 2494 <span class="js-colli-per-cc">@i.GetValue("CustomerSpecificProductInformation.ColliPerCC")</span> 2495 &times; @i.GetValue("CustomerSpecificProductInformation.ColliSize") 2496 </td> 2497 </tr> 2498 @if (!DisablePrices()) 2499 { 2500 <tr> 2501 <td> 2502 @Translate("price", "Pris") 2503 </td> 2504 <td class="js-product-field-price js-product-field-price-colli"> 2505 @if (DisplayPricesInclVat()) 2506 { 2507 if (Converter.ToInt32(i.GetValue("CustomerSpecificProductInformation.PricePerColli.UnitPrice.PriceWithVAT.Value")) > 0) 2508 { 2509 @:@i.GetValue("CustomerSpecificProductInformation.PricePerColli.UnitPrice.PriceWithVAT.Value") 2510 } 2511 } 2512 else 2513 { 2514 if (Converter.ToInt32(i.GetValue("CustomerSpecificProductInformation.PricePerColli.UnitPrice.PriceWithoutVAT.Value")) > 0) 2515 { 2516 @:@i.GetValue("CustomerSpecificProductInformation.PricePerColli.UnitPrice.PriceWithoutVAT.Value") 2517 } 2518 } 2519 </td> 2520 <td class="js-product-field-price js-product-field-price-layer"> 2521 @if (DisplayPricesInclVat()) 2522 { 2523 if (Converter.ToInt32(i.GetValue("CustomerSpecificProductInformation.PricePerLayer.UnitPrice.PriceWithVAT.Value")) > 0) 2524 { 2525 @:@i.GetValue("CustomerSpecificProductInformation.PricePerLayer.UnitPrice.PriceWithVAT.Value") 2526 } 2527 } 2528 else 2529 { 2530 if (Converter.ToInt32(i.GetValue("CustomerSpecificProductInformation.PricePerLayer.UnitPrice.PriceWithoutVAT.Value")) > 0) 2531 { 2532 @:@i.GetValue("CustomerSpecificProductInformation.PricePerLayer.UnitPrice.PriceWithoutVAT.Value") 2533 } 2534 } 2535 </td> 2536 <td class="js-product-field-price js-product-field-price-cc"> 2537 @if (DisplayPricesInclVat()) 2538 { 2539 if (Converter.ToInt32(i.GetValue("CustomerSpecificProductInformation.PricePerCC.UnitPrice.PriceWithVAT.Value")) > 0) 2540 { 2541 @:@i.GetValue("CustomerSpecificProductInformation.PricePerCC.UnitPrice.PriceWithVAT.Value") 2542 } 2543 } 2544 else 2545 { 2546 if (Converter.ToInt32(i.GetValue("CustomerSpecificProductInformation.PricePerCC.UnitPrice.PriceWithoutVAT.Value")) > 0) 2547 { 2548 @:@i.GetValue("CustomerSpecificProductInformation.PricePerCC.UnitPrice.PriceWithoutVAT.Value") 2549 } 2550 } 2551 </td> 2552 </tr> 2553 } 2554 </tbody> 2555 </table> 2556 </div> 2557 } 2558 </div> 2559 <br class="hidden-sm hidden-md hidden-lg" /> 2560 <div class="col-md-3 col-sm-6"> 2561 @if (isLoggedIn && i.GetInteger("Ecom:Product.VariantCount") == 0) 2562 { 2563 2564 var loopCounter = i.GetInteger("Products.LoopCounter") + baseLoopCounter; 2565 var nameProductLoopCounter = "ProductLoopCounter" + loopCounter; 2566 var nameProductIdCounter = "ProductID" + loopCounter; 2567 var nameVariantIdCounter = "VariantID" + loopCounter; 2568 var nameUnitIdCounter = "UnitID" + loopCounter; 2569 var namewishListIdCounter = "wishListID" + loopCounter; 2570 var retailPriceValue = DisplayPricesInclVat() ? i.GetValue("CustomerSpecificProductInformation.CustomerRetailPrice.Price.PriceWithVAT") : i.GetValue("CustomerSpecificProductInformation.CustomerRetailPrice.Price.PriceWithoutVAT"); 2571 retailPriceValue = Dynamicweb.Core.Converter.ToInt32(retailPriceValue) == 0 ? "" : FormatPrice(retailPriceValue.ToString()); 2572 2573 <input type="hidden" value='@loopCounter' name='@nameProductLoopCounter'> 2574 <input type="hidden" class="js-product-id" value='@i.GetValue("Ecom:Product.ID")' name="@nameProductIdCounter"> 2575 <input type="hidden" value="" name="@nameVariantIdCounter"> 2576 <input type="hidden" value="" name="@nameUnitIdCounter"> 2577 <input type="hidden" value="0" name="@namewishListIdCounter"> 2578 2579 if (isDeliverable) 2580 { 2581 <div class="row"> 2582 @renderToolTip() 2583 <div class="col-xs-3 js-quantity-tooltip" data-placement="right" data-toggle="popover" data-trigger="manual"> 2584 @{ 2585 var quantityFieldName = "Quantity" + loopCounter; 2586 bool isServiceProduct = i.GetInteger("Ecom:Product.Type") == 1; 2587 2588 var placeholder = minQty > 0 ? String.Format("min. {0}", minQty) : minQty.ToString(); 2589 2590 <div class="product-list-number"> 2591 <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" /> 2592 </div> 2593 } 2594 </div> 2595 2596 <div class="col-xs-9"> 2597 @foreach (var o in i.GetLoop("Product.OrderLineFields")) 2598 { 2599 var inputName = o.GetString("Ecom:Product.OrderLineField.InputTextFieldName") + loopCounter; 2600 string placeholderText = o.GetString("Ecom:Product.OrderLineField.Name"); 2601 switch (o.GetString("Ecom:Product.OrderLineField.SystemName")) 2602 { 2603 case "OrderLineComment": 2604 if (EnableComments()) 2605 { 2606 placeholderText = Translate("LineComment", "Comment"); 2607 <input type="text" class="form-control" maxlength="80" name="@inputName" placeholder="@placeholderText" /> 2608 } 2609 break; 2610 case "OrderLineColliSize": 2611 <input type="hidden" name="@inputName" value='@i.GetValue("CustomerSpecificProductInformation.ColliSize")' /> 2612 break; 2613 case "OrderLineColliPerLayer": 2614 <input type="hidden" name="@inputName" value='@i.GetValue("CustomerSpecificProductInformation.ColliPerLayer")' /> 2615 break; 2616 case "OrderLineColliPerCC": 2617 <input type="hidden" name="@inputName" value='@i.GetValue("CustomerSpecificProductInformation.ColliPerCC")' /> 2618 break; 2619 case "OrderLineRetailPrice": 2620 placeholderText = Translate("Smartpage:eCom:CustomerSpecificInfo.RetailPrice", "Add retail price"); 2621 <div class="hidden"> 2622 <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" /> 2623 </div> 2624 break; 2625 case "OrderLineItemNumber": 2626 placeholderText = Translate("Smartpage:eCom:CustomerSpecificInfo.ItemNumber", "Item no."); 2627 <div class="hidden"> 2628 <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" /> 2629 </div> 2630 break; 2631 case "OrderLineEAN": 2632 placeholderText = Translate("Deres_EAN_nummer-short", "EAN"); 2633 2634 <div class="hidden"> 2635 <div class="editable" data-placeholder="my placeholder"> 2636 <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" /> 2637 </div> 2638 </div> 2639 2640 break; 2641 default: 2642 <text>@inputName</text> 2643 break; 2644 } 2645 } 2646 </div> 2647 </div> 2648 } 2649 2650 @*if (EnableDisplayOfGrossMargin() && isDeliverable) 2651 { 2652 double customerSalesPrice = DisplayPricesInclVat() ? i.GetDouble("CustomerSpecificProductInformation.PricePerColli.UnitPrice.PriceWithVAT") : i.GetDouble("CustomerSpecificProductInformation.PricePerColli.UnitPrice.PriceWithoutVAT"); 2653 <div class="row"> 2654 <div class="col-sm-12 col-md-12 col-lg-offset-3 col-lg-9 text-right product-retail-price product-gross-margin-list"> 2655 <i class="js-product-field-gross-margin text-muted"> 2656 <span class="pull-left">@Translate("Smartpage:eCom:CustomerSpecificInfo.GrossMargin", "Gross margin")</span> 2657 <span class="pull-right js-gross-margin-value"> 2658 @if (i.GetInteger("CustomerSpecificProductInformation.CustomerRetailPrice") > 0) 2659 { 2660 @GetGrossMargin(i.GetDouble("CustomerSpecificProductInformation.CustomerRetailPrice"), customerSalesPrice); 2661 } 2662 else 2663 { 2664 @Translate("Smartpage:ecom:CustomerSpecificInfo.GrossMargin.NA", "N/A") 2665 } 2666 </span> 2667 </i> 2668 </div> 2669 </div> 2670 }*@ 2671 2672 @*if (EnableCustomerRetailPrice() && isDeliverable) 2673 { 2674 //var formattedRetailPrice = DisplayPricesInclVat() ? i.GetValue("CustomerSpecificProductInformation.CustomerRetailPrice.Price.PriceWithVAT") : i.GetValue("CustomerSpecificProductInformation.CustomerRetailPrice.Price.PriceWithoutVAT"); 2675 //formattedRetailPrice = Dynamicweb.Base.ChkDouble(formattedRetailPrice) == 0.00 ? "" : formattedRetailPrice; 2676 2677 <div class="row"> 2678 <div class="col-sm-12 col-md-12 col-lg-offset-3 col-lg-9 text-right product-retail-price product-editable-area"> 2679 2680 @if (EnableEditableRetailPrice() && isDeliverable && !String.IsNullOrEmpty(i.GetString("CustomerSpecificProductInformation.CustomerRetailPrice"))) 2681 { 2682 <div class="product-selectable-edit pull-right"> 2683 <i class="glyphicon glyphicon-edit js-product-fields-edit product-fields-edit" data-source="#js-retail-price-@loopCounter"></i> 2684 </div> 2685 } 2686 <div class="js-product-field-retail-price"> 2687 <span class="pull-left">@Translate("Smartpage:eCom:CustomerSpecificInfo.RetailPrice", "Retail price")</span> 2688 <span class="pull-right">@retailPriceValue</span> 2689 </div> 2690 </div> 2691 </div> 2692 }*@ 2693 2694 @*if (EnableCustomerItemNumber()) 2695 { 2696 <div class="row"> 2697 2698 <div class="col-sm-12 col-md-12 col-lg-offset-3 col-lg-9 text-right product-item-number product-editable-area"> 2699 2700 @if (EnableEditableItemNumber() && isDeliverable) 2701 { 2702 <div class="product-selectable-edit pull-right"> 2703 <i class="glyphicon glyphicon-edit js-product-fields-edit product-fields-edit" data-source="#js-item-number-@loopCounter"></i> 2704 </div> 2705 } 2706 <div class="js-product-field-item-number text-left"> 2707 <span class="pull-left">@Translate("Smartpage:eCom:CustomerSpecificInfo.ItemNumber", "Item no.")</span> 2708 <span class="pull-right">@i.GetValue("CustomerSpecificProductInformation.CustomerItemNumber")</span> 2709 </div> 2710 </div> 2711 </div> 2712 }*@ 2713 2714 @*<div class="row"> 2715 <div class="hidden-xs col-sm-3 hidden-md hidden-lg"></div> 2716 <div class="col-sm-12 col-md-12 col-lg-offset-3 col-lg-9 text-right product-editable-area"> 2717 @if (EnableEditableBarcode() && isDeliverable && !String.IsNullOrEmpty(i.GetString("CustomerSpecificProductInformation.EAN"))) 2718 { 2719 <div class="product-selectable-edit pull-right"> 2720 <i class="glyphicon glyphicon-edit js-product-fields-edit product-fields-edit" data-source="#js-ean-number-@loopCounter"></i> 2721 </div> 2722 } 2723 @if (EnableCustomerBarcode() && !String.IsNullOrEmpty(i.GetString("CustomerSpecificProductInformation.EAN"))) 2724 { 2725 <div class="js-product-field-ean text-left"> 2726 <span class="pull-left">@Translate("Deres_EAN_nummer-short", "EAN")</span> 2727 <span class="pull-right">@i.GetValue("CustomerSpecificProductInformation.EAN")</span> 2728 </div> 2729 } 2730 </div> 2731 </div>*@ 2732 2733 if (!isDeliverable) 2734 { 2735 <div class="row"> 2736 <div class="hidden-xs col-sm-3 hidden-md hidden-lg"></div> 2737 <div class="col-sm-9 col-md-12 col-lg-offset-3 col-lg-9 product-editable-area"> 2738 <p>@Translate("Smartpage:Ecom.LeadDaysWarning", "Available on") <span class="label label-warning">@(!string.IsNullOrEmpty(AvailableDeliveryDay(i.GetInteger("Ecom:Product:Field.Gasa:LeadDays.Value"))) ? AvailableDeliveryDay(i.GetInteger("Ecom:Product:Field.Gasa:LeadDays.Value")) : i.GetString("Ecom:Product:Field.SpAvailableFrom.Value"))</span></p> 2739 </div> 2740 </div> 2741 } 2742 2743 } 2744 </div> 2745 </div> 2746 } 2747 </div> 2748 2749 </div> 2750 2751 <input type="submit" value="Add to basket" class="sr-only" /> 2752 2753 @if (isLoggedIn) 2754 { 2755 @SnippetStart("SmartpageAddToBasket") 2756 <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> 2757 @SnippetEnd("SmartpageAddToBasket") 2758 } 2759 </form> 2760 } 2761 } 2762 </div> 2763 </div> 2764 <div class="clearfix"></div> 2765 </div> 2766 <div class="productlistnavigation navigation-bottom"> 2767 @*<span class="pagecount"> 2768 @Translate("SmartPage:Product.Paging.Page", "Side") 2769 @GetValue("Ecom:ProductList.CurrentPage") 2770 @Translate("SmartPage:Product.Paging.Of", "af") 2771 @GetValue("Ecom:ProductList.TotalPages") 2772 </span>*@ 2773 <span class="productcount"> 2774 @GetValue("Ecom:ProductList.PageProdCnt") 2775 @Translate("SmartPage:Product.Paging.ProductsFound", "produkter fundet") 2776 </span> 2777 @*<div class="pagenavigation pull-right js-product-pagination"> 2778 <ul class="list-inline"> 2779 @if (!String.IsNullOrEmpty(GetString("Ecom:ProductList.PrevPage.Clean"))) 2780 { 2781 <li><a class="prevpage js-previous-page" href="@GetValue("Ecom:ProductList.PrevPage.Clean")">@Translate("PreviousPage", "Forrige")</a></li> 2782 } 2783 <li>@Translate("Smartpage:ProductList.Page", "side")</li> 2784 @if (GetInteger("Ecom:ProductList.TotalPages") > 1) 2785 { 2786 var pageTotal = GetInteger("Ecom:ProductList.TotalPages") + 1; 2787 <li> 2788 <select class="js-select-page-number form-control"> 2789 @for (var page = 1; page < pageTotal; page++) 2790 { 2791 string pageLink = Dynamicweb.Base.ReplaceQueryString(queryString, "PageNum", page.ToString()); 2792 string isCurrent = page == GetInteger("Ecom:ProductList.CurrentPage") ? "selected" : ""; 2793 <option @isCurrent value='@pageLink'>@page</option> 2794 } 2795 </select> 2796 </li> 2797 } 2798 else 2799 { 2800 <li><span>@GetValue("Ecom:ProductList.CurrentPage")</span></li> 2801 } 2802 <li>@Translate("Smartpage:ProductList.PageTotal", "ud af") @GetInteger("Ecom:ProductList.TotalPages")</li> 2803 @if (!String.IsNullOrEmpty(GetString("Ecom:ProductList.NextPage.Clean"))) 2804 { 2805 <li><a class="nextpage js-next-page" href="@GetValue("Ecom:ProductList.NextPage.Clean")">@Translate("NextPage", "Næste")</a></li> 2806 } 2807 </ul> 2808 </div>*@ 2809 2810 @{ 2811 var pages = GetLoop("Ecom:ProductList.Pages"); 2812 if (pages.Any()) 2813 { 2814 foreach (var i in pages.Where(i => i.GetBoolean("Ecom:ProductList.Pages.Page.IsCurrent"))) 2815 { 2816 <input type="hidden" class="current-page js-current-page-number" value='@i.GetValue("Ecom:ProductList.Pages.Page.Number")' /> 2817 } 2818 } 2819 } 2820 2821 </div> 2822 2823 2824 2825 <div class="clearfix"></div> 2826 @PricesWithVATStatus("bottom") 2827 2828