Error executing template "Designs/Default/_parsed/PageEcom.parsed.cshtml"
System.IO.IOException: The process cannot access the file 'E:\Dynamicweb.net\Solutions\Webshop\Files\Templates\Designs\Default\Translations.xml' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at Dynamicweb.Rendering.Translation.Source.WriteDocument(XmlDocument document)
   at Dynamicweb.Rendering.Translation.Source.Save()
   at Dynamicweb.Rendering.Translation.Source.UpdateTranslationSource(Source source, IEnumerable`1 newKeys, String designName, IEnumerable`1 cultures)
   at Dynamicweb.Rendering.TemplateBase`1.Translate(String text, String defaultValue, String cultureName)
   at CompiledRazorTemplates.Dynamic.RazorEngine_9a4bcef86cff4274b7882e6294e2dce6.Execute() in E:\Dynamicweb.net\Solutions\Webshop\Files\Templates\Designs\Default\_parsed\PageEcom.parsed.cshtml:line 1111
   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 Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2 @using System; 3 @using System.Linq; 4 @using System.Web; 5 @using Dynamicweb; 6 @using Dynamicweb.Core; 7 8 @{ 9 var designBaseUrl = GetString("Template:DesignBaseUrl").TrimEnd('/'); 10 bool overrideCSS = Converter.ToBoolean(Pageview.Area.Item["OverrideCss"]); 11 bool noPayOff = false; // string.IsNullOrWhiteSpace(Base.ChkString(Pageview.Area.Item["PayOffLineOne"])) && string.IsNullOrWhiteSpace(Base.ChkString(Pageview.Area.Item["PayOffLineTwo"])); 12 var isLoggedIn = Dynamicweb.Security.UserManagement.User.IsExtranetUserLoggedIn(); 13 //var cssRightMenuClass = !isLoggedIn ? "col-sm-2" : "col-sm-8"; 14 string favIconURL = !string.IsNullOrWhiteSpace(Converter.ToString(Pageview.Area.Item["FavIcon"])) ? Converter.ToString(Pageview.Area.Item["FavIcon"]) : designBaseUrl + "/Assets/images/ico/favicon.ico"; 15 16 var deliveryDeadlineDateTime = Converter.ToDateTime(GetGlobalValue("Smartpage:SelectedDeliveryDeadline.Clean")); 17 var deliveryDateTime = Converter.ToDateTime(GetGlobalValue("Smartpage:SelectedDeliveryDate")); 18 var deliveryDate = ""; 19 if (deliveryDateTime != DateTime.MinValue) 20 { 21 deliveryDate = deliveryDateTime.ToString("yyyy-MM-dd"); 22 } 23 24 bool hasOrderExceededDeadline = deliveryDeadlineDateTime <= DateTime.Now && deliveryDateTime.AddDays(1).AddSeconds(-1) >= DateTime.Now; 25 26 var languages = GetLoop("Languages"); 27 } 28 29 @functions { 30 string getLanguageUrl(LoopItem language = null) 31 { 32 /* 33 var keys = HttpContext.Current.Request.Form.AllKeys; 34 if (keys.Any()) 35 { 36 var parameters = ""; 37 for (int i = 0; i < keys.Length; i++) 38 { 39 if (keys[i].ToLower() != "id") 40 { 41 parameters += "&" + keys[i] + "=" + HttpContext.Current.Request.Form[keys[i]]; 42 } 43 } 44 return "/Default.aspx?ID=" + language.GetString("PageID") + parameters; 45 } 46 else 47 { 48 return Base.ReplaceQueryString("ID", language.GetString("PageID")); 49 } 50 */ 51 52 var url = string.Empty; 53 54 if (language != null) 55 { 56 Dynamicweb.Content.PageService ps = new Dynamicweb.Content.PageService(); 57 var page = ps.GetPage(language.GetInteger("FirstActivePageID")); 58 url = string.Format("/Default.aspx?ID={0}&LanguageID={1}", language.GetString("PageID"), page.Area.EcomLanguageId); 59 } 60 61 return url; 62 } 63 } 64 65 <!DOCTYPE html> 66 <html lang="en"> 67 <head> 68 <meta charset="utf-8"> 69 <meta http-equiv="X-UA-Compatible" content="IE=edge"> 70 <meta name="viewport" content="width=device-width, initial-scale=1"> 71 72 <meta name="author" content=""> 73 <link rel="shortcut icon" type="image/x-icon" href='@favIconURL'> 74 75 <title>@GetValue("Title")</title> 76 @GetValue("MetaTags") 77 @GetValue("CopyRightNotice") 78 79 80 @RenderSnippet("StyleSheet") 81 <link href="@designBaseUrl/Assets/styles/main.min.css?v85" rel="stylesheet"> 82 83 @if (overrideCSS) 84 { 85 if (!string.IsNullOrEmpty(Converter.ToString(Pageview.Area.Item["HeadingFontScript"]))) 86 { 87 @Pageview.Area.Item["HeadingFontScript"] 88 } 89 if (!string.IsNullOrEmpty(Converter.ToString(Pageview.Area.Item["BodyFontScript"]))) 90 { 91 @Pageview.Area.Item["BodyFontScript"] 92 } 93 94 var cssUrl = "/" + Pageview.Area.Item["CssPageLink"] + "&Purge=true"; 95 96 <link href="@cssUrl" rel="stylesheet"> 97 } 98 99 <!--[if lt IE 9]> 100 <script src="@designBaseUrl/Assets/plugins/html5shiv-3.7.0.js"></script> 101 <script src="@designBaseUrl/Assets/plugins/respond-1.4.2.min.js"></script> 102 <![endif]--> 103 <!--[if gte IE 9]> 104 <style type="text/css"> 105 .gradient { 106 filter: none; 107 } 108 </style> 109 <![endif]--> 110 111 <script> 112 var _pageId = @Dynamicweb.Frontend.PageView.Current().Page.ID; 113 var pageUrl = '<!--@Global:Pageview.Url.Raw.JSEncoded()-->'; 114 var _isDesktop = @Converter.ToBoolean(GetGlobalValue("Global:Device.IsDesktop")).ToString().ToLower(); 115 </script> 116 @GetValue("Stylesheets") 117 @GetValue("Javascripts") 118 </head> 119 120 @*<style> 121 * { box-shadow: 0 0 2px red inset; } 122 </style>*@ 123 124 <body data-exceeded-deadline="@hasOrderExceededDeadline" data-delivery-datetime='@deliveryDate'> 125 <div class="outer-wrapper container"> 126 <header class="header"> 127 <div class="row js-header"> 128 <div class="top-header bg-service clearfix navbar navbar-inverse"> 129 <div class="col-xs-12 visible-xs"> 130 @{ 131 var homeLink = "/"; 132 if (isLoggedIn) 133 { 134 homeLink = Converter.ToString(Pageview.Area.Item["ShopMore"]); 135 } 136 } 137 <a class="navbar-brand visible-xs col-xs-4" href="@homeLink"><img class="img-responsive logo-padding-mobil" src='@Pageview.Area.Item["Logo"]?v=1' alt='@Pageview.Area.Item["CompanyName"]'></a> 138 139 140 <div class="pull-right"> 141 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".js-top-navigation"> 142 <span class="sr-only">Toggle navigation</span> 143 <span class="icon-bar"></span> 144 <span class="icon-bar"></span> 145 <span class="icon-bar"></span> 146 </button> 147 <a href="#" class="navbar-toggle" data-toggle="collapse" data-target=".js-product-navigation"><img src="/Files/Templates/Designs/Default/Assets/images/icon_flower.png" alt="Products"></a> 148 @if (isLoggedIn) 149 { 150 var miniCartIcon = Converter.ToString(Pageview.Area.Item["MiniCartIcon"]); 151 if (string.IsNullOrEmpty(miniCartIcon)) 152 { 153 miniCartIcon = GetString("Template:DesignBaseUrl") + "Assets/images/icon_basket.png"; 154 } 155 156 <a href='@Pageview.Area.Item["Cart"]' class="navbar-toggle mobile-basket-link"><span class="basket-count js-basket-count text-danger"></span><img src='@miniCartIcon' alt="minicart icon"></a> 157 } 158 else 159 { 160 var loginText = HttpUtility.HtmlEncode(Translate("Smartpage:Login", "Login")); 161 162 <a href="#" data-toggle="modal" data-target="#modal-login"><img src="/Files/Templates/Designs/Default/Assets/images/icon_login.png" alt="@loginText"></a> 163 } 164 </div> 165 166 <div class="pull-right" style="padding-right:10px;"> 167 @if (languages.Any()) 168 { 169 <div id="languages-mobile" class="dropdown languages js-languages"> 170 <a class="dropdown-toggle" data-toggle="dropdown"> 171 @GetString("Lang").ToUpper() 172 <span class="caret"></span> 173 </a> 174 <ul class="dropdown-menu"> 175 @foreach (var language in languages /*.Where(l => l.GetString("Culture") != "fi-FI")*/) 176 { 177 var languageCode = language.GetString("Culture").Substring(0, 2); 178 var culture = new System.Globalization.CultureInfo(languageCode); 179 var flagUrl = string.Format("/Admin/Images/Flags/Small/flag_{0}.png", language.GetString("Culture").Substring(3, 2).ToLower()); 180 var url = getLanguageUrl(language); 181 182 <li> 183 <a class="js-change-context" role="menuitem" tabindex="-1" href="@url"> 184 <img src="@flagUrl" alt='@language.GetString("Culture")'> 185 @culture.NativeName 186 </a> 187 </li> 188 } 189 </ul> 190 </div> 191 } 192 </div> 193 194 </div> 195 <div class="clearfix visible-xs"></div> 196 197 @if (isLoggedIn) 198 { 199 <div class="col-lg-6 col-md-5 col-sm-4 col-xs-12"> 200 <p class="user-logged-in">@Translate("Smartpage:UserLoggedInAs", "Logged in as") <strong>@GetString("DWextranet_AccessUserUserName")</strong></p> 201 </div> 202 } 203 204 <div class='col-lg-4 col-md-5 col-sm-6 col-xs-12 pull-right'> 205 <div class="js-top-navigation js-collapse-elm navbar-collapse collapse "> 206 <div class="pull-right nav-mobil row"> 207 @GetValue("DwNavigation(topnavigation)") 208 </div> 209 </div> 210 </div> 211 212 <div class="col-xs-2 pull-right hidden-xs"> 213 @if (languages.Any()) 214 { 215 <div id="languages-desktop" class="dropdown languages pull-right js-languages"> 216 <a class="dropdown-toggle" data-toggle="dropdown"> 217 @Translate("Smartpage:Language", "Languages") 218 <span class="caret"></span> 219 </a> 220 <ul class="dropdown-menu"> 221 @foreach (var language in languages /*.Where(l => l.GetString("Culture") != "fi-FI")*/) 222 { 223 var languageCode = language.GetString("Culture").Substring(0, 2); 224 var culture = new System.Globalization.CultureInfo(languageCode); 225 var flagUrl = string.Format("/Admin/Images/Flags/Small/flag_{0}.png", language.GetString("Culture").Substring(3, 2).ToLower()); 226 var url = getLanguageUrl(language); 227 228 <li> 229 <a class="js-change-context" role="menuitem" tabindex="-1" href="@url"> 230 <img src="@flagUrl" alt='@language.GetString("Culture")'> 231 @culture.NativeName 232 </a> 233 </li> 234 } 235 </ul> 236 </div> 237 } 238 </div> 239 </div> 240 241 <div class="clearfix upper-part"> 242 @{ 243 var cssClassPayOff = noPayOff ? "col-sm-2 col-lg-5" : "col-sm-3 col-md-3 col-lg-4"; 244 var cssClassLogo = noPayOff ? "col-sm-5 col-lg-3 col-xs-4" : "col-sm-3 col-lg-2 col-xs-4"; 245 } 246 <div class='navbar-header @cssClassLogo'> 247 <a class="navbar-brand hidden-xs" href="@homeLink"><img class="img-responsive logo-padding" src='@Pageview.Area.Item["Logo"]?v=1' alt='@Pageview.Area.Item["CompanyName"]'></a> 248 </div> 249 <div class='payoff hidden-xs @cssClassPayOff'> 250 @if (Pageview.Area.Item["PayOffLineOne"] != null) 251 { 252 <div class="payoff-one"> 253 @Pageview.Area.Item["PayOffLineOne"] 254 </div> 255 } 256 @if (Pageview.Area.Item["PayOffLineTwo"] != null) 257 { 258 <div class="payoff-two"> 259 @Pageview.Area.Item["PayOffLineTwo"] 260 </div> 261 } 262 </div> 263 <div class="col-xs-12 col-sm-6 col-md-6 col-lg-6"> 264 @if (!isLoggedIn) 265 { 266 var loginText = HttpUtility.HtmlEncode(Translate("Smartpage:Login", "Login")); 267 <a href="#" class="pull-right login-link visible-md visible-lg visible-sm" data-toggle="modal" data-target="#modal-login"> 268 <span class="h3 login-link-text">@loginText</span> 269 <img src="/Files/Templates/Designs/Default/Assets/images/padlock.png" alt="@loginText"> 270 </a> 271 } 272 else 273 { 274 <div id="minicart" class="minicart-container clearfix"> 275 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 276 @using Dynamicweb; 277 @using System.Web 278 279 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 280 @using Dynamicweb; 281 @using Dynamicweb.Ecommerce.Orders; 282 @using System.Globalization; 283 @using Dynamicweb.Core; 284 @using Dynamicweb.Security.UserManagement; 285 @using Dynamicweb.Security.UserManagement.Common.CustomFields; 286 287 @* Note that this file will be inserted directly into another one by Dynamicweb IncludeFile 288 before evaluating the Razor code, so keep the syntax right *@ 289 290 291 @* global functions *@ 292 293 @functions { 294 bool checkIfFileExists(string imgURL) 295 { 296 return System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath(imgURL)); 297 } 298 string FormatDiameter(string value) 299 { 300 if (string.IsNullOrEmpty(value)) 301 { 302 return value; 303 } 304 305 Decimal d; 306 if (Decimal.TryParse(value, out d)) 307 { 308 return Converter.ToDouble(value).ToString("0.0", Dynamicweb.Frontend.PageView.Current().Area.CultureInfo.NumberFormat); 309 //return d.ToString("0.0", Base.GetCulture(true)); 310 } 311 312 return value; 313 } 314 315 string FormatPrice(string value) 316 { 317 if (string.IsNullOrEmpty(value)) 318 { 319 return value; 320 } 321 322 Decimal d; 323 if (Decimal.TryParse(value, out d)) 324 { 325 return Converter.ToDouble(value).ToString("0.00", Dynamicweb.Frontend.PageView.Current().Area.CultureInfo.NumberFormat); 326 } 327 328 return value; 329 } 330 331 string AvailableDeliveryDay(int leadDays) 332 { 333 DateTime today = DateTime.Now.Date; 334 DateTime availableDate = today; 335 DateTime deliveryDate = Dynamicweb.Ecommerce.Common.Context.OrderTime; 336 TimeSpan daysDifference = deliveryDate - today; 337 CultureInfo localLanguage = System.Threading.Thread.CurrentThread.CurrentCulture; 338 string result; 339 340 int leadWeekendDays = 0; 341 342 343 // check how many weekends within lead days 344 for (var i = 0; i < leadDays; i++) 345 { 346 if (availableDate.AddDays(i).DayOfWeek == DayOfWeek.Saturday) 347 { 348 leadWeekendDays++; 349 } 350 else if (availableDate.AddDays(i).DayOfWeek == DayOfWeek.Sunday) 351 { 352 leadWeekendDays++; 353 } 354 } 355 356 // check how many weekends after lead weekdays 357 for (var i = 0; i < leadWeekendDays; i++) 358 { 359 if (availableDate.AddDays(leadDays + i).DayOfWeek == DayOfWeek.Saturday) 360 { 361 leadWeekendDays++; 362 } 363 else if (availableDate.AddDays(leadDays + i).DayOfWeek == DayOfWeek.Sunday) 364 { 365 leadWeekendDays++; 366 } 367 } 368 369 var leadDaysTotal = leadWeekendDays + leadDays; 370 371 availableDate = availableDate.AddDays(leadDaysTotal); 372 373 if (daysDifference.TotalDays >= leadDaysTotal && availableDate <= deliveryDate) 374 { 375 result = null; 376 } 377 else 378 { 379 result = availableDate.ToString("dd-MM-yyyy", localLanguage); 380 } 381 //result=daysDifference.TotalDays.ToString(); 382 return result; 383 } 384 385 /* 386 bool EnableEditing() 387 { 388 return EnableEditableBarcode(); 389 } 390 */ 391 392 bool? _enableManufacturerPage; 393 bool EnableManufacturerPage() 394 { 395 if (!_enableManufacturerPage.HasValue) 396 { 397 if (Pageview.Page.PropertyItem != null && Converter.ToBoolean(Pageview.Page.PropertyItem["EnableManufacturer"])) 398 { 399 _enableManufacturerPage = true; 400 } 401 else 402 { 403 _enableManufacturerPage = false; 404 } 405 } 406 return _enableManufacturerPage.Value; 407 } 408 409 ///* generic validation of custom user fields */ 410 //bool? returnCustomUserFieldValidation(string CustomerUserFieldString) 411 //{ 412 // return GetCustomUserField<bool>(user, CustomerUserFieldString); 413 //} 414 415 416 bool? _displayPricesInclVat; 417 bool DisplayPricesInclVat() 418 { 419 if (!_displayPricesInclVat.HasValue) 420 { 421 _displayPricesInclVat = GetCustomUserField<bool>("AccessUser_DisplayPricesInclVat"); 422 } 423 return _displayPricesInclVat.Value; 424 } 425 426 bool? _enableEditableItemNumber; 427 bool EnableEditableItemNumber() 428 { 429 if (!_enableEditableItemNumber.HasValue) 430 { 431 _enableEditableItemNumber = GetCustomUserField<bool>("AccessUser_EnableEditableItemNumber"); 432 } 433 return _enableEditableItemNumber.Value; 434 } 435 436 //AccessUser_EnableManufacturerFiltering 437 bool? _enableManufacturerFiltering; 438 bool EnableManufacturerFiltering(bool chkEnableManufacturerPageEnableManufacturerPage = true) 439 { 440 if (chkEnableManufacturerPageEnableManufacturerPage && !EnableManufacturerPage()) 441 return false; 442 443 if (!_enableManufacturerFiltering.HasValue) 444 { 445 _enableManufacturerFiltering = GetCustomUserField<bool>("AccessUser_EnableManufacturerFiltering"); 446 } 447 return _enableManufacturerFiltering.Value; 448 } 449 450 bool? _enableCustomerItemNumber; 451 bool EnableCustomerItemNumber() 452 { 453 if (!_enableCustomerItemNumber.HasValue) 454 { 455 _enableCustomerItemNumber = GetCustomUserField<bool>("AccessUser_EnableCustomerItemNumber"); 456 } 457 return _enableCustomerItemNumber.Value; 458 } 459 460 bool? _enableEditableRetailPrice; 461 bool EnableEditableRetailPrice() 462 { 463 if (!_enableEditableRetailPrice.HasValue) 464 { 465 _enableEditableRetailPrice = GetCustomUserField<bool>("AccessUser_EnableEditableRetailPrice"); 466 } 467 return _enableEditableRetailPrice.Value; 468 } 469 470 bool? _enableEditableBarcode; 471 bool EnableEditableBarcode() 472 { 473 if (!_enableEditableBarcode.HasValue) 474 { 475 _enableEditableBarcode = GetCustomUserField<bool>("AccessUser_EnableEditableBarcode"); 476 } 477 return _enableEditableBarcode.Value; 478 } 479 480 bool? _enableCustomerRetailPrice; 481 bool EnableCustomerRetailPrice() 482 { 483 if (!_enableCustomerRetailPrice.HasValue) 484 { 485 _enableCustomerRetailPrice = GetCustomUserField<bool>("AccessUser_EnableCustomerRetailPrice"); 486 } 487 return _enableCustomerRetailPrice.Value; 488 } 489 490 bool? _enableCustomerBarcode; 491 bool EnableCustomerBarcode() 492 { 493 if (!_enableCustomerBarcode.HasValue) 494 { 495 _enableCustomerBarcode = GetCustomUserField<bool>("AccessUser_EnableCustomerBarcode"); 496 } 497 return _enableCustomerBarcode.Value; 498 499 } 500 501 bool? _enableComments; 502 bool EnableComments() 503 { 504 if (!_enableComments.HasValue) 505 { 506 _enableComments = GetCustomUserField<bool>("AccessUser_EnableCommentOnLine"); 507 } 508 return _enableComments.Value; 509 } 510 511 bool? _enableMinimumCCQuantity; 512 bool EnableMinimumCCQuantity() 513 { 514 if (!_enableMinimumCCQuantity.HasValue) 515 { 516 _enableMinimumCCQuantity = GetCustomUserField<bool>("AccessUser_EnableMinimumCCQuantity"); 517 } 518 return _enableMinimumCCQuantity.Value; 519 } 520 bool? _enableFullCCCheck; 521 bool EnableFullCCCheck() 522 { 523 if (!_enableFullCCCheck.HasValue) 524 { 525 _enableFullCCCheck = GetCustomUserField<bool>("AccessUser_EnableFullCCCheck"); 526 } 527 return _enableFullCCCheck.Value; 528 } 529 530 bool? _enableDisplayGrossMargin; 531 bool EnableDisplayOfGrossMargin() 532 { 533 if (DisablePrices()) 534 return false; 535 536 if (!_enableDisplayGrossMargin.HasValue) 537 { 538 _enableDisplayGrossMargin = GetCustomUserField<bool>("AccessUser_DisplayGrossMargin"); 539 } 540 return _enableDisplayGrossMargin.Value; 541 } 542 543 string GetGrossMargin(double retailPrice, double salesPrice) 544 { 545 var resultValue = ((retailPrice - salesPrice) * 100) / retailPrice; 546 return Converter.ToString(Math.Round(resultValue, 2)) + "%"; 547 } 548 549 550 double? _minimumCCQuantity; 551 double MinimumCCQuantity(string flag = "") 552 { 553 if (!_minimumCCQuantity.HasValue) 554 { 555 _minimumCCQuantity = GetCustomUserField<double>("AccessUser_MinimumCCQuantity" + flag.ToUpper()); 556 } 557 return _minimumCCQuantity.Value; 558 } 559 560 bool? _disablePrices; 561 bool DisablePrices() 562 { 563 if (!_disablePrices.HasValue) 564 { 565 _disablePrices = GetCustomUserField<bool>("AccessUser_DisablePrices"); 566 } 567 return _disablePrices.Value; 568 } 569 570 double? _fullCCCheckDeviation; 571 double FullCCCheckDeviation() 572 { 573 if (!_fullCCCheckDeviation.HasValue) 574 { 575 _fullCCCheckDeviation = GetCustomUserField<double>("AccessUser_FullCCCheckDeviation"); 576 } 577 578 return _fullCCCheckDeviation.Value; 579 } 580 581 bool HasReachedMinimumQuantity() 582 { 583 if (!EnableMinimumCCQuantity()) 584 { 585 return true; 586 } 587 588 var orderlinesGroupByCode = GetLoop("OrderLines").GroupBy(o => o.GetString("Ecom:Product:Field.NavCompanyCode")) 589 .Select(o => new { 590 Flag = o.FirstOrDefault().GetString("Ecom:Product:Field.NavCompanyCode"), 591 CCRate = o.Sum(f => f.GetInteger("Ecom:Order:OrderLine.Quantity") * f.GetDouble("CustomerSpecificProductInformation.CCRate")) 592 }); 593 594 if (orderlinesGroupByCode.Count() == orderlinesGroupByCode.Where(o => o.CCRate >= MinimumCCQuantity(o.Flag)).Count()) 595 { 596 return true; 597 } 598 599 return false; 600 } 601 602 bool HasPassedFullCCCheckDeviationCheck() 603 { 604 if (!EnableFullCCCheck()) 605 { 606 return true; 607 } 608 609 var orderlinesGroupByCode = GetLoop("OrderLines").GroupBy(o => o.GetString("Ecom:Product:Field.NavCompanyCode")) 610 .Select(o => new { CCRate = o.Sum(f => f.GetInteger("Ecom:Order:OrderLine.Quantity") * f.GetDouble("CustomerSpecificProductInformation.CCRate")) }); 611 612 if (orderlinesGroupByCode.Count() == orderlinesGroupByCode.Where(o => (o.CCRate % 1) == 0 || LessOrEqual((o.CCRate % 1), FullCCCheckDeviation()) || LessOrEqual(Math.Abs(1 - (o.CCRate % 1)), FullCCCheckDeviation())).Count()) 613 { 614 return true; 615 } 616 617 return false; 618 } 619 620 //AE: Workaround for comparing doubles 621 bool LessOrEqual(double d1, double d2) 622 { 623 return d1 < d2 || Math.Abs(d1 - d2) <= 0.0000001; 624 } 625 626 /* 627 bool DisableComments() 628 { 629 User user = User.get_Current(PagePermissionLevels.Frontend); 630 631 return GetCustomField<bool>(user, "AccessUser_EnableCommentOnLine"); 632 } 633 */ 634 static T GetCustomOrderLineField<T>(OrderLine orderLine, string customSystemFieldName) 635 { 636 OrderLineFieldValue myFieldValue = 637 orderLine.OrderLineFieldValues.FirstOrDefault(cfv => cfv.OrderLineFieldSystemName == customSystemFieldName); 638 639 if (myFieldValue != null) 640 { 641 return (T)Convert.ChangeType(myFieldValue.Value, typeof(T)); 642 } 643 644 // Return default(T) which means you'll return null 645 return default(T); 646 } 647 648 static T GetCustomOrderLineField<T>(LoopItem orderLine, string customSystemFieldName) 649 { 650 var template = 651 orderLine.GetLoop("Order.OrderLineFields").FirstOrDefault(o => o.GetString("Ecom:Order:OrderLine.OrderLineField.SystemName") == customSystemFieldName); 652 653 if (template != null) 654 { 655 return (T)Convert.ChangeType(template.GetValue("Ecom:Order:OrderLine.OrderLineField.Value.Clean"), typeof(T)); 656 } 657 658 // Return default(T) which means you'll return null 659 return default(T); 660 } 661 662 Dynamicweb.Security.UserManagement.User _user = null; 663 T GetCustomUserField<T>(string customSystemFieldName) 664 { 665 if (_user == null) 666 { 667 _user = Dynamicweb.Security.UserManagement.User.GetCurrentExtranetUser(); 668 } 669 670 if (_user != null) 671 { 672 CustomFieldValue myFieldValue = _user.CustomFieldValues.FirstOrDefault(cfv => cfv.CustomField.SystemName == customSystemFieldName); 673 674 try 675 { 676 if (myFieldValue != null) 677 { 678 return (T)Convert.ChangeType(myFieldValue.Value, typeof(T)); 679 } 680 } 681 catch (Exception) 682 { 683 return default(T); 684 } 685 } 686 687 // Return default(T) which means you'll return null 688 return default(T); 689 } 690 691 692 ICollection<LoopItem> SortOrderLineFields(ICollection<LoopItem> loop) 693 { 694 return loop 695 .OrderByDescending(o => o.GetString("Ecom:Product.OrderLineField.SystemName") == "OrderLineComment") 696 .ThenByDescending(o => o.GetString("Ecom:Product.OrderLineField.SystemName") == "OrderLineRetailPrice") 697 .ThenByDescending(o => o.GetString("Ecom:Product.OrderLineField.SystemName") == "OrderLineItemNumber") 698 .ThenByDescending(o => o.GetString("Ecom:Product.OrderLineField.SystemName") == "OrderLineEAN").ToList(); 699 } 700 701 } 702 703 704 @* html helpers section *@ 705 706 707 @helper renderToolTip() 708 { 709 var jsSuggestionStock = "<span class='js-suggestion-stock'></span>"; 710 <div class="hide js-tooltip-content quantity-tooltip-content"> 711 <h4 class="title"> 712 @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> 713 </h4> 714 <button class="btn btn-xs btn-info js-package-size-cancel" data-toggle="clickover"><i class="glyphicon glyphicon-remove"></i></button> 715 <button class="btn btn-xs btn-primary js-package-size-ok" data-toggle="clickover"><i class="glyphicon glyphicon-ok"></i></button> 716 </div> 717 718 <div class="hide js-tooltip-smaller-quantity quantity-tooltip-content"> 719 <h4 class="title"> 720 @Translate("Smartpage:Popover.OutOfStockText.LessQuantity", "Varen blev ikke tilføjet til kurven, forsøg med et mindre antal") 721 </h4> 722 <button class="btn btn-xs btn-info js-close-out-of-stock" data-toggle="clickover"><i class="glyphicon glyphicon-ok"></i></button> 723 </div> 724 725 <div class="hide js-tooltip-stock-content quantity-tooltip-content"> 726 <h4 class="title"> 727 @Translate("Smartpage:Popover.OutOfStockText", "Varen blev ikke tilføjet til kurven, fordi vi har ikke flere på lager") 728 </h4> 729 <button class="btn btn-xs btn-info js-close-out-of-stock" data-toggle="clickover"><i class="glyphicon glyphicon-ok"></i></button> 730 </div> 731 732 <div class="hide js-tooltip-stock-suggestion quantity-tooltip-content"> 733 <h4 class="title"> 734 @Translate("Smartpage:Popover.OutOfStockText.Suggestion", String.Format("Vi har kun {0} på lager. Vil du ændre antal?", jsSuggestionStock)) 735 </h4> 736 <button class="btn btn-xs btn-info js-cancel-out-of-stock" data-toggle="clickover"><i class="glyphicon glyphicon-remove"></i></button> 737 <button class="btn btn-xs btn-info js-accept-out-of-stock" data-toggle="clickover"><i class="glyphicon glyphicon-ok"></i></button> 738 </div> 739 } 740 741 742 @helper AddedToCart(LoopItem i, string cssClass) 743 { 744 string cssIsInCart = i.GetBoolean("Ecom:Product.IsInCart") ? "" : "hide"; 745 <span class='label label-success js-in-cart in-cart @cssClass @cssIsInCart'><i class="glyphicon glyphicon-shopping-cart"></i> @Translate("Smartpage:AddedInCart", "added")</span> 746 } 747 748 @helper SingleAddedToCart() 749 { 750 string cssIsInCart = GetBoolean("Ecom:Product.IsInCart") ? "" : "hide"; 751 <span class='label label-success in-cart js-in-cart product @cssIsInCart'><i class="glyphicon glyphicon-shopping-cart"></i> @Translate("Smartpage:AddedInCart", "added")</span> 752 } 753 754 @helper SingleStockStatus() 755 { 756 bool outOfStock = GetInteger("Ecom:Product.AvailableAmount") <= 0; 757 bool isServiceProduct = GetInteger("Ecom:Product.Type") == 1; 758 759 <div class='stock-status single-product'> 760 @if (outOfStock && !isServiceProduct) 761 { 762 <span class="label label-danger js-out-of-stock">@Translate("Smartpage:OutOfStock", "Ikke på lager")</span> 763 } 764 </div> 765 } 766 767 @helper ListStockStatus(LoopItem i, string currentViewMode) 768 { 769 bool outOfStock = i.GetInteger("Ecom:Product.AvailableAmount") <= 0; 770 bool isServiceProduct = i.GetInteger("Ecom:Product.Type") == 1; 771 772 <div class='stock-status @currentViewMode'> 773 @if (outOfStock && !isServiceProduct) 774 { 775 <span class="label label-danger js-out-of-stock">@Translate("Smartpage:OutOfStock", "Ikke på lager")</span> 776 } 777 778 @if (!isServiceProduct && !outOfStock) { 779 <span class='label label-success'>@i.GetInteger("Ecom:Product.AvailableAmount") @Translate("GASA.LeftOnStock", "left on stock")</span> 780 } 781 782 </div> 783 } 784 785 786 @helper PricesWithVATStatus(string positionCSS) { 787 if (DisplayPricesInclVat()) 788 { 789 <p class='vat-message text-muted text-center @positionCSS'>@Translate("Smartpage:PricesIncludeVAT.Message", "Alle priser er inkl. Moms")</p> 790 } 791 else 792 { 793 <p class='vat-message text-muted text-center @positionCSS'>@Translate("Smartpage:PricesDoNotIncludeVAT.Message", "Alle priser er ekskl. Moms")</p> 794 } 795 } 796 797 @helper RenderManufacturer(string manufacturerId, string manufacturerName, string manufacturerWebsiteUrl) 798 { 799 if (EnableManufacturerFiltering()) 800 { 801 var name = manufacturerName + "/" + manufacturerId; 802 if (!string.IsNullOrEmpty(manufacturerWebsiteUrl)) 803 { 804 <a class="manufacturer-info-link" href="@manufacturerWebsiteUrl" target="_blank">@name</a> 805 } 806 else 807 { 808 <span class="manufacturer-info">@name</span> 809 } 810 } 811 } 812 813 @if (String.IsNullOrEmpty(HttpContext.Current.Request["CompletedOrderId"])) 814 { 815 <div class="minicart-shown js-regular-cart"> 816 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 817 @using System.Linq; 818 @using Dynamicweb; 819 @using Dynamicweb.Core; 820 821 @{ 822 var miniCartIcon = Converter.ToString(Pageview.Area.Item["MinicartIcon"]) != "" ? Pageview.Area.Item["MinicartIcon"] : "Files/System/container.png"; 823 var isValidDeliveryDate = Converter.ToBoolean(GetGlobalValue("Smartpage:Calendar.IsValidDeliveryDate")); 824 var orderlinesGroupByCode = GetLoop("OrderLines").GroupBy(o => o.GetString("Ecom:Product:Field.NavCompanyCode")).Select(x => new 825 { 826 Flag = x.FirstOrDefault().GetString("Ecom:Product:Field.NavCompanyCode"), 827 Quantity = x.Sum(f => f.GetInteger("Ecom:Order:OrderLine.Quantity")), 828 CCRate = x.Sum(f => f.GetInteger("Ecom:Order:OrderLine.Quantity") * f.GetDouble("CustomerSpecificProductInformation.CCRate")) 829 }); 830 } 831 832 <div class="minicart-preview js-cart-preview"> 833 834 <div class='@(orderlinesGroupByCode.Any() ? "col-sm-2 hidden-xs" : "col-sm-4 hidden-xs")'> 835 <img src="/Admin/Public/GetImage.ashx?image=@miniCartIcon&height=49" class="img-responsive pull-right"> 836 </div> 837 @if (orderlinesGroupByCode.Any()) 838 { 839 <div class="col-sm-4 col-md-3 hidden-xs" style="padding:0;"> 840 @foreach (var orderline in orderlinesGroupByCode) 841 { 842 <div> 843 @if (!string.IsNullOrEmpty(orderline.Flag)) 844 { 845 <img src="/Admin/Images/Flags/Small/flag_@(orderline.Flag).png" alt="@(orderline.Flag)" title="@(orderline.Flag)"> <br> 846 } 847 @Translate("Smartpage:Ecom.CartPreview.Items", "Items:") @orderline.Quantity (CC: @String.Format("{0:0.##}", (orderline.CCRate))) 848 </div> 849 } 850 </div> 851 } 852 853 <div class="col-sm-6 col-md-7 hidden-xs"> 854 @if (GetInteger("Ecom:Order.OrderLines.TotalProductQuantity") > 0 && isValidDeliveryDate) 855 { 856 <div class="total-containers hidden-xs"> 857 @Translate("Smartpage:Minicart.Items", "Items"): 858 @GetInteger("Ecom:Order.OrderLines.TotalProductQuantity") 859 (CC: @String.Format("{0:0.##}", GetDouble("CCShop"))) 860 <br> 861 @Translate("Smartpage:Minicart.TotalCC", "Total CC"): 862 @String.Format("{0:0.##}", GetDouble("CCTotal")) 863 @if (!DisablePrices()) 864 { 865 <br> 866 <text> 867 @Translate("Smartpage:Minicart.Total", "Total"): 868 </text> 869 if (DisplayPricesInclVat()) 870 { 871 @:@GetValue("Ecom:Order.OrderLines.Total.PriceWithVAT") 872 } 873 else 874 { 875 @:@GetValue("Ecom:Order.OrderLines.Total.PriceWithoutVAT") 876 } 877 878 } 879 </div> 880 881 @*<div class="pull-right hidden-xs"> 882 <a class="@cartJsLink btn btn-info pull-right"> 883 @Translate("showcart", "View cart") 884 </a> 885 </div>*@ 886 } 887 else 888 { 889 <span class="minicart-is-empty hidden-xs"> 890 @Translate("CartIsEmpty", "Cart is empty") 891 </span> 892 } 893 894 @if ((isValidDeliveryDate) && (Dynamicweb.Ecommerce.Common.Context.Cart != null) && (!string.IsNullOrEmpty(GetGlobalValue("Smartpage:SelectedDeliveryDate"))) && (!string.IsNullOrEmpty(GetGlobalValue("Smartpage:SelectedDeliveryDeadline.Clean")))) 895 { 896 var deliveryDeadlineDate = Converter.ToDateTime(GetGlobalValue("Smartpage:SelectedDeliveryDeadline.Clean")); 897 898 <div class="selected-delivery-deadline"> 899 <p class="deadline-counter-container">@Translate("Smartpage:DeliveryDate", "Delivery date"): @GetGlobalValue("Smartpage:SelectedDeliveryDate")</p> 900 <p class="deadline-counter-container"> 901 <span class="deadline-heading">@Translate("Delivery deadline", "Ordering deadline"):</span> 902 <span id="js-deadline-counter" class="js-deadline-counter deadline-counter-text" data-deadline-time='@deliveryDeadlineDate.ToString("MM/dd/yyyy HH:mm:ss", new System.Globalization.CultureInfo("en-GB"))' data-hours-text='@Translate("hours", "hours")' data-minutes-text='@Translate("minutes.short", "min")' data-seconds-text='@Translate("seconds.short", "sec")'> 903 </span> 904 </p> 905 </div> 906 } 907 </div> 908 </div> 909 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 910 911 <div class="minicart-hover-container"> 912 <div class="col-sm-12 minicart js-minicart" style="display:none;"> 913 @*<h3><a href='@Pageview.Area.Item["Cart"]'>@Translate("Smartpage:MiniCart.Heading", "Kurv")</a></h3>*@ 914 @if (String.IsNullOrWhiteSpace(GetString("Ecom:Order.IsEmpty"))) 915 { 916 int numRows = 0; 917 <table id="orderdetails" class="table table-condensed" data-count='@GetValue("Ecom:Order.OrderLines.TotalProductQuantity")'> 918 <tr class="tr-header"> 919 <th class="th-first">@Translate("Smartpage:Cart.Productname", "Produkt")</th> 920 <th class="text-right">@Translate("size", "Size")</th> 921 <th class="text-right hidden-xs">@Translate("Smartpage:Quantity", "Quantity")</th> 922 @if (!DisablePrices()) 923 { 924 <th class="text-right th-last">@Translate("price", "Unit price")</th> 925 } 926 </tr> 927 @foreach (LoopItem i in GetLoop("OrderLines")) 928 { 929 numRows++; 930 if (numRows < 10) 931 { 932 string orderlineClass = "orderline" + i.GetString("Ecom:Order:OrderLine.Type"); 933 <tr class="@orderlineClass orderline"> 934 <td class="orderline-text" nowrap=""> 935 @i.GetValue("Ecom:Order:OrderLine.ProductName.Short") 936 @if (!String.IsNullOrWhiteSpace(i.GetString("Ecom:Order:OrderLine.ProductVariantText"))) 937 { 938 @:(@i.GetString("Ecom:Order:OrderLine.ProductVariantText")) 939 } 940 </td> 941 <td class="text-right pot-size hidden-xs"> 942 @Translate("SmartPage.FormatDiameter", "Ø") 943 @FormatDiameter(i.GetString("Ecom:Product:Field.PotSize.Value")) 944 </td> 945 <td class="text-right"> 946 @i.GetValue("Ecom:Order:OrderLine.Quantity") x @i.GetValue("CustomerSpecificProductInformation.ColliSize") 947 </td> 948 @if(!DisablePrices()) 949 { 950 <td class="text-right"> 951 @if (DisplayPricesInclVat()) 952 { 953 @:@i.GetValue("Smartpage:PricePerColli.UnitPrice.PriceWithVATFormatted") 954 } 955 else 956 { 957 @:@i.GetValue("Smartpage:PricePerColli.UnitPrice.PriceWithoutVATFormatted") 958 } 959 </td> 960 } 961 </tr> 962 } 963 else if (numRows == 10) 964 { 965 <tr class="orderline more-orderlines"> 966 <td colspan="2"> 967 @Translate("Smartpage:MiniCart.SeeMore", "Vis kurven for at se alle varer") 968 </td> 969 <td><i class="glyphicon glyphicon-exclamation-sign"></i></td> 970 </tr> 971 } 972 } 973 974 <tr class="total totals hidden-lg hidden-md"> 975 <td colspan="3" class="text-right">@Translate("total", "Total")</td> 976 <td class="text-right">@GetValue("Ecom:Order.OrderLines.Total.PriceWithoutVAT")</td> 977 </tr> 978 </table> 979 @* 980 <a href='@Pageview.Area.Item["Cart"]' class="btn btn-primary btn-lg pull-right visible-xs-block">@Translate("Smartpage:MiniCart.GoToCart", "Vis kurv")</a> 981 *@ 982 <div class="clearfix"></div> 983 } 984 else 985 { 986 <p class="col-sm-12 empty-basket">@Translate("Smartpage:MiniCart.BasketIsEmpty", "Kurven er tom")</p> 987 } 988 </div> 989 </div> 990 991 </div> 992 } 993 </div> 994 } 995 </div> 996 </div> 997 <div class="product-navigation"> 998 <div class="navbar"> 999 <div class="navbar-collapse collapse js-product-navigation js-collapse-elm bg-header" role="navigation"> 1000 <div class="yamm"> 1001 @GetValue("DwNavigation(mainnavigation)") 1002 </div> 1003 </div><!--/.navbar-collapse --> 1004 </div> 1005 </div> 1006 </div> 1007 @if (isLoggedIn) 1008 { 1009 <div class="js-search-container row"> 1010 @{ 1011 var hasGroupID = HttpContext.Current.Request["groupid"] != null; 1012 } 1013 <div id="search" class="search-bar js-search-bar js-static-search hidden-print"> 1014 <div class="row"> 1015 <div class="clearfix"> 1016 <form name="EcomSearch" method="get" action="/default.aspx" class="col-sm-6 col-md-8 js-ecom-search"> 1017 <div class="form-group form-inline"> 1018 <input type="hidden" name="ID" value='@Pageview.Area.Item["SearchPage"]'> 1019 @if (hasGroupID) 1020 { 1021 <input class="js-group-hidden-input" type="hidden" name="groupid" value='@HttpContext.Current.Request["groupid"]'> 1022 } 1023 <div class="input-group"> 1024 <input type="text" name="q" class="form-control js-searchfield" placeholder='@Translate("Smartpage:Search.WriteSearch", "Indtast søgeord")' data-placeholder='@Translate("Smartpage:Search.WriteSearch", "Indtast søgeord")' value='@HttpUtility.HtmlEncode(HttpContext.Current.Request.QueryString["q"])'> 1025 @*<span class="input-group-addon"><i class="glyphicon glyphicon-search"></i></span>*@ 1026 <div class="input-group-btn"> 1027 @if (hasGroupID) 1028 { 1029 @RenderSnippet("NavigationGroups") 1030 } 1031 <button type="submit" class="btn btn-default js-search">@Translate("Smartpage:Search", "Søg")</button> 1032 </div> 1033 </div> 1034 </div> 1035 </form> 1036 <div class="col-sm-3 col-md-2 col-xs-6"> 1037 <div class="form-group"> 1038 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 1039 1040 <div class="cart-btn-box"> 1041 @{ 1042 var cartJsLink = "js-cart-link"; 1043 if (GetInteger("Ecom:Order.OrderLines.TotalProductQuantity") == 0) 1044 { 1045 cartJsLink = ""; 1046 } 1047 } 1048 <a href='@Pageview.Area.Item["Cart"]' class="@cartJsLink btn btn-block btn-info btn-lg js-view-cart hidden"> 1049 @Translate("showcart", "View cart") 1050 </a> 1051 </div> 1052 </div> 1053 </div> 1054 <div class="col-sm-3 col-md-2 col-xs-6"> 1055 <div class="form-group"> 1056 @RenderSnippet("SmartpageAddToBasket") 1057 </div> 1058 </div> 1059 </div> 1060 1061 1062 1063 </div> 1064 </div> 1065 </div> 1066 } 1067 </header> 1068 1069 1070 1071 1072 1073 1074 1075 @inherits RazorTemplateBase<RazorTemplateModel<Template>> 1076 @using Dynamicweb.Rendering 1077 1078 1079 1080 <div class="clearfix js-ecom-page-container content-wrapper"> 1081 <div class="row ecom-page js-ecom-page"> 1082 <div class="col-sm-3 col-md-2 col-xs-12 re-order-btn"> 1083 @RenderSnippet("SmartpageReorder") 1084 </div> 1085 <div class="col-sm-12 main"> 1086 <div id="main-content">@GetValue("DwContent(maincontent)")</div> 1087 </div> 1088 </div> 1089 </div> 1090 1091 1092 <!-- FOOTER --> 1093 <footer class="js-footer row footer"> 1094 <div class="footer-bottom"> 1095 @Pageview.Area.Item["FooterText"] 1096 </div> 1097 </footer> 1098 1099 <div class="toTop js-to-top"><i class="glyphicon glyphicon-chevron-up"></i></div> 1100 </div> 1101 1102 <!-- Modal --> 1103 <div id="navigation-warning" class="modal fade js-navigation-warning" tabindex="-1" role="dialog"> 1104 <div class="modal-dialog"> 1105 <div class="modal-content"> 1106 <div class="modal-header"> 1107 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> 1108 <h4 class="modal-title">@Translate("Smartpage:NavigationWarning.Error.Header", "Warning")</h4> 1109 </div> 1110 <div class="modal-body"> 1111 <p>@Translate("Smartpage:NavigationWarning.Error.Text", "There are entered items which have not been added to the basket")</p> 1112 </div> 1113 <div class="modal-footer"> 1114 <a class="btn btn-info js-navigation-link" href="#">@Translate("SmartPage:NavigationWarning.Error.BtnContinue", "Continue without adding products to basket")</a> 1115 <button class="btn btn-primary js-navigation-add-to-basket">@Translate("SmartPage:NavigationWarning.Error.BtnAddToBasket", "Place products in basket and continue")</button> 1116 </div> 1117 </div> 1118 </div> 1119 </div> 1120 <!-- modal errror quantity --> 1121 @*<div id="package-size-modal" class="modal fade js-package-size-modal" role="dialog"> 1122 <div class="modal-dialog"> 1123 <div class="modal-content"> 1124 <div class="modal-header"> 1125 <h4 class="modal-title">@Translate("Smartpage:Product.PackageSizeCeiled", "Antallet er blevet opskrevet")</h4> 1126 </div> 1127 <div class="modal-body"> 1128 <p class="js-package-size-single">@Translate("Smartpage:Product.PackageSizeCeiled.singleProduct.Text", "Det ønskede antal vare stemmer ikke overens med kollistørrelsen. Antallet er derfor blevet opskrevet til"): <span class="js-package-size-quantity"></span></p> 1129 <p class="js-package-size-multi hide">@Translate("Smartpage:Product.PackageSizeCeiled.multipleProducts.Text", "Det ønskede antal vare stemmer ikke overens med kollistørrelsen på flere produkter. Antallet er derfor blevet opskrevet på disse.")</p> 1130 </div> 1131 <div class="modal-footer"> 1132 <button class="btn btn-info js-package-size-cancel" data-dismiss="modal">@Translate("Smartpage:Product.PackageSizeCeiled.Cancel", "Annuller")</button> 1133 <button class="btn btn-primary js-package-size-ok" data-dismiss="modal">@Translate("Smartpage:Product.PackageSizeCeiled.Continue", "Fortsæt")</button> 1134 </div> 1135 </div> 1136 </div> 1137 </div>*@ 1138 1139 1140 @if (!String.IsNullOrEmpty(GetString("DW_extranet_error_dk")) || Converter.ToBoolean(GetGlobalValue("Smartpage:User.NotActive"))) 1141 { 1142 <div id="invalidUser-error" class="modal fade js-invalid-user-error"> 1143 <div class="modal-dialog modal-sm"> 1144 <div class="modal-content"> 1145 <div class="modal-header"> 1146 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> 1147 <h4 class="modal-title">@Translate("Smartpage:Extranet.WrongCredentials.Header", "Error")</h4> 1148 </div> 1149 <div class="modal-body"> 1150 @if (Converter.ToBoolean(GetGlobalValue("Smartpage:User.NotActive"))) 1151 { 1152 <p>@Translate("Smartpage:Extranet.UserNotActivated", "Your account is not activated")</p> 1153 } 1154 else 1155 { 1156 <div class="login-text"> 1157 @Pageview.Area.Item["LoginText"] 1158 </div> 1159 } 1160 </div> 1161 <div class="modal-footer"> 1162 <button type="button" class="btn btn-primary" data-dismiss="modal">@Translate("Smartpage:Modal.Close", "Luk")</button> 1163 </div> 1164 </div> 1165 </div> 1166 </div> 1167 } 1168 1169 <!-- modal error add to basket if deadline exceeded --> 1170 <div id="add-to-basket-warning" class="modal fade js-add-to-basket-warning" tabindex="-1" role="dialog"> 1171 <div class="modal-dialog"> 1172 <div class="modal-content"> 1173 <div class="modal-header"> 1174 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> 1175 <h4 class="modal-title">@Translate("Smartpage:AddToBasketWarning.Error.Header", "Warning")</h4> 1176 </div> 1177 <div class="modal-body"> 1178 <p>@Translate("Smartpage:AddToBasketWarning.Error.Text", "It is not possible to add products to the selected basket when deadline of delivery has exceeded.")</p> 1179 </div> 1180 <div class="modal-footer"> 1181 <button type="button" class="btn btn-primary" data-dismiss="modal">@Translate("Smartpage:Modal.Close", "Luk")</button> 1182 </div> 1183 </div> 1184 </div> 1185 </div> 1186 1187 <!-- modal for login --> 1188 <div id="modal-login" class="modal fade modal-login" tabindex="-1" role="dialog"> 1189 <div class="modal-dialog modal-sm"> 1190 <div class="modal-content"> 1191 <div class="modal-header"> 1192 <span class="h2">@Translate("Smartpage:Login.Header", "Login")</span> 1193 </div> 1194 <div class="modal-body"> 1195 <form class="js-login-form" role="form" method="post" action=''> 1196 <input type="hidden" name="DWExtranetUsernameRemember" value="True"> 1197 <input type="hidden" name="DWExtranetPasswordRemember" value="True"> 1198 <input type="hidden" name="AutoLogin" value="True"> 1199 <input type="hidden" name="Redirect" value='@HttpUtility.HtmlEncode(HttpContext.Current.Request.RawUrl)'> 1200 1201 <div class="form-group"> 1202 <input type="text" id="login-username" name="username" class="form-control js-login-username full-width" placeholder='@HttpUtility.HtmlEncode(Translate("Username", "Username"))'> 1203 </div> 1204 <div class="form-group"> 1205 <input type="password" id="login-password" name="password" class="form-control js-login-password full-width" placeholder='@HttpUtility.HtmlEncode(Translate("Password", "Password"))'> 1206 </div> 1207 <button type="submit" class="btn btn-info btn-login js-login btn-block">@Translate("Smartpage:User.SignIn", "Log ind")</button> 1208 </form> 1209 </div> 1210 </div> 1211 </div> 1212 </div> 1213 1214 <!-- Placed at the end of the document so the pages load faster --> 1215 <script src="@designBaseUrl/Assets/scripts/plugins.min.js?v0.3.4"></script> 1216 <script src="@designBaseUrl/Assets/scripts/scripts.js?v85"></script> 1217 1218 @RenderSnippet("JavaScript") 1219 </body> 1220 </html>