Error compiling template "Designs/Rapido/eCom7/CartV2/Step/DownloadCart.cshtml"
Line 87: 'ProductService.GetProductByNumber(string, bool)' is obsolete: 'Please use an overload with the languageId parameter'
Line 87: 'Product.GetProductFieldValue(string)' is obsolete: 'Use 'ProductService.GetProductFieldValue' instead'
Line 111: 'ProductService.GetProductByNumber(string, bool)' is obsolete: 'Please use an overload with the languageId parameter'
Line 111: 'Product.GetProductFieldValue(string)' is obsolete: 'Use 'ProductService.GetProductFieldValue' instead'
Line 514: 'Services' is an ambiguous reference between 'Dynamicweb.Content.Services' and 'Dynamicweb.Ecommerce.Services'
Line 709: 'Services' is an ambiguous reference between 'Dynamicweb.Content.Services' and 'Dynamicweb.Ecommerce.Services'
Line 786: 'Extensions.GetPageService(IServiceLocator)' is obsolete: 'Use Dynamicweb.Content.Services.Pages instead.'

1 //------------------------------------------------------------------------------ 2 // <auto-generated> 3 // This code was generated by a tool. 4 // Runtime Version:4.0.30319.42000 5 // 6 // Changes to this file may cause incorrect behavior and will be lost if 7 // the code is regenerated. 8 // </auto-generated> 9 //------------------------------------------------------------------------------ 10 11 namespace CompiledRazorTemplates.Dynamic { 12 using System; 13 using System.Collections.Generic; 14 15 #line 6 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 16 using System.Linq; 17 18 #line default 19 #line hidden 20 21 #line 2 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 22 using Dynamicweb.Ecommerce; 23 24 #line default 25 #line hidden 26 27 #line 3 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 28 using Dynamicweb.Ecommerce.Orders; 29 30 #line default 31 #line hidden 32 33 #line 4 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 34 using Dynamicweb.Content; 35 36 #line default 37 #line hidden 38 39 #line 5 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 40 using Dynamicweb.Extensibility; 41 42 #line default 43 #line hidden 44 45 #line 7 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 46 using System.Web; 47 48 #line default 49 #line hidden 50 51 #line 8 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 52 using Dynamicweb.Core; 53 54 #line default 55 #line hidden 56 57 #line 11 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 58 using Custom.Thermex.Helpers; 59 60 #line default 61 #line hidden 62 63 64 public class RazorEngine_3bad2af05c5d49a99b94941cac8aed1f : Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> { 65 66 #line hidden 67 68 #line 23 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 69 70 public string GetProductImage(LoopItem productObject = null) 71 { 72 string theImage = ""; 73 string missingImage = "missing_image"; 74 75 if (productObject == null) 76 { 77 theImage = GetString("Ecom:Product.ImageDefault.Default.Clean"); 78 theImage = String.IsNullOrEmpty(theImage) ? GetString("Ecom:Product.ImageLarge.Clean") : theImage; 79 theImage = String.IsNullOrEmpty(theImage) ? GetString("Ecom:Product.ImageMedium.Clean") : theImage; 80 theImage = String.IsNullOrEmpty(theImage) ? GetString("Ecom:Product.ImageSmall.Clean") : theImage; 81 theImage = String.IsNullOrEmpty(theImage) ? GetString("Ecom:Product.ImageLarge.Default.Clean") : theImage; 82 83 if (String.IsNullOrWhiteSpace(theImage) || theImage.Contains(missingImage)) 84 { 85 try 86 { 87 theImage = ImageHelper.GetFirstImage(Dynamicweb.Ecommerce.Services.Products.GetProductByNumber(GetString("Ecom:Product.Number"), true).GetProductFieldValue("ImagePaths").ToString()); 88 if (string.IsNullOrEmpty(theImage)) 89 { 90 theImage = "/Images/missing_image.jpg"; 91 } 92 } 93 catch 94 { 95 // Do nothing 96 } 97 } 98 } 99 else 100 { 101 theImage = productObject.GetString("Ecom:Product.ImageDefault.Default.Clean"); 102 theImage = String.IsNullOrEmpty(theImage) ? productObject.GetString("Ecom:Product.ImageLarge.Clean") : theImage; 103 theImage = String.IsNullOrEmpty(theImage) ? productObject.GetString("Ecom:Product.ImageMedium.Clean") : theImage; 104 theImage = String.IsNullOrEmpty(theImage) ? productObject.GetString("Ecom:Product.ImageSmall.Clean") : theImage; 105 theImage = String.IsNullOrEmpty(theImage) ? productObject.GetString("Ecom:Product.ImageLarge.Default.Clean") : theImage; 106 107 if (String.IsNullOrWhiteSpace(theImage) || theImage.Contains(missingImage)) 108 { 109 try 110 { 111 theImage = ImageHelper.GetFirstImage(Dynamicweb.Ecommerce.Services.Products.GetProductByNumber(productObject.GetString("Ecom:Product.Number"), true).GetProductFieldValue("ImagePaths").ToString()); 112 if (string.IsNullOrEmpty(theImage)) 113 { 114 theImage = "/Images/missing_image.jpg"; 115 } 116 } 117 catch 118 { 119 // Do nothing 120 } 121 } 122 } 123 124 return theImage; 125 } 126 127 #line default 128 #line hidden 129 130 131 public RazorEngine_3bad2af05c5d49a99b94941cac8aed1f() { 132 } 133 134 public override void Execute() { 135 WriteLiteral("\r\n"); 136 137 WriteLiteral("\r\n"); 138 139 WriteLiteral("\r\n\r\n"); 140 141 WriteLiteral("\r\n\r\n"); 142 143 144 #line 83 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 145 146 string exportPageId = GetPageIdByNavigationTag("ProductExportFeed").ToString(); 147 int pdfFolderId = GetPageIdByNavigationTag("DownloadCartPDFTemplates"); 148 149 150 #line default 151 #line hidden 152 WriteLiteral("\r\n\r\n<section"); 153 154 WriteLiteral(" class=\"multiple-paragraphs-container u-color-light-gray--bg paragraph-container-" + 155 "-full-width u-min-h500px\""); 156 157 WriteLiteral(">\r\n <div"); 158 159 WriteLiteral(" class=\"center-container center-container--with-background-image dw-mod\""); 160 161 WriteLiteral(">\r\n <div"); 162 163 WriteLiteral(" class=\"paragraph-container u-padding\""); 164 165 WriteLiteral(">\r\n <div"); 166 167 WriteLiteral(" class=\"grid\""); 168 169 WriteLiteral(">\r\n <div"); 170 171 WriteLiteral(" class=\"grid__col-12\""); 172 173 WriteLiteral(">\r\n <div"); 174 175 WriteLiteral(" class=\"u-margin-bottom\""); 176 177 WriteLiteral(">\r\n <h2"); 178 179 WriteLiteral(" class=\"u-no-margin\""); 180 181 WriteLiteral(">"); 182 183 184 #line 94 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 185 Write(Translate("Downloads")); 186 187 188 #line default 189 #line hidden 190 WriteLiteral("</h2>\r\n </div>\r\n </div>\r\n <div"); 191 192 WriteLiteral(" class=\"grid__col-8\""); 193 194 WriteLiteral(">\r\n <div"); 195 196 WriteLiteral(" class=\"card-header u-color-light--bg dw-mod\""); 197 198 WriteLiteral(">\r\n <h3><i"); 199 200 WriteLiteral(" class=\"fas fa-download\""); 201 202 WriteLiteral("></i> "); 203 204 205 #line 99 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 206 Write(Translate("Items ready to download")); 207 208 209 #line default 210 #line hidden 211 WriteLiteral(" (<span"); 212 213 WriteLiteral(" id=\"cart_items_counter\""); 214 215 WriteLiteral(">"); 216 217 218 #line 99 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 219 Write(GetString("Ecom:Order.OrderLines.TotalProductQuantity")); 220 221 222 #line default 223 #line hidden 224 WriteLiteral("</span>)</h3>\r\n </div>\r\n <div"); 225 226 WriteLiteral(" class=\"card u-color-light--bg dw-mod\""); 227 228 WriteLiteral(">\r\n <ul"); 229 230 WriteLiteral(" class=\"panel-list\""); 231 232 WriteLiteral(" id=\"download_cart_list\""); 233 234 WriteLiteral(">\r\n"); 235 236 237 #line 103 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 238 239 240 #line default 241 #line hidden 242 243 #line 103 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 244 foreach (LoopItem orderline in GetLoop("OrderLines").Where(o => o.GetInteger("Ecom:Order:OrderLine.Type") != (int)OrderLineType.Tax).ToList()) 245 { 246 if (orderline.GetBoolean("Ecom:Order:OrderLine.IsProduct")) 247 { 248 249 250 #line default 251 #line hidden 252 WriteLiteral(" <li"); 253 254 WriteLiteral(" class=\"panel-list__item\""); 255 256 WriteLiteral(" data-id=\""); 257 258 259 #line 107 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 260 Write(orderline.GetString("Ecom:Product.ID")); 261 262 263 #line default 264 #line hidden 265 WriteLiteral("\""); 266 267 WriteLiteral(">\r\n <img"); 268 269 WriteLiteral(" class=\"u-margin-right b-lazy\""); 270 271 WriteLiteral(" src=\"/Files/Images/placeholder.gif\""); 272 273 WriteLiteral(" data-src=\"/Admin/Public/GetImage.ashx?width=60&height=60&crop=5&Compression=75&i" + 274 "mage="); 275 276 277 #line 108 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 278 Write(GetProductImage(orderline)); 279 280 281 #line default 282 #line hidden 283 WriteLiteral("\""); 284 285 WriteAttribute("alt", Tuple.Create(" alt=\"", 5373), Tuple.Create("\"", 5435) 286 287 #line 108 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 288 , Tuple.Create(Tuple.Create("", 5379), Tuple.Create<System.Object, System.Int32>(orderline.GetString("Ecom:Order:OrderLine.ProductName") 289 290 #line default 291 #line hidden 292 , 5379), false) 293 ); 294 295 WriteLiteral(">\r\n <div"); 296 297 WriteLiteral(" class=\"panel-list__item-name\""); 298 299 WriteLiteral(">\r\n <div"); 300 301 WriteLiteral(" class=\"u-truncate-text\""); 302 303 WriteLiteral(">"); 304 305 306 #line 110 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 307 Write(orderline.GetString("Ecom:Order:OrderLine.ProductName")); 308 309 310 #line default 311 #line hidden 312 WriteLiteral("</div>\r\n <small>"); 313 314 315 #line 111 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 316 Write(orderline.GetString("Ecom:Order:OrderLine.ProductNumber")); 317 318 319 #line default 320 #line hidden 321 WriteLiteral("</small>\r\n </div>\r\n " + 322 " <div"); 323 324 WriteLiteral(" class=\"panel-list__item-actions\""); 325 326 WriteLiteral(">\r\n <button"); 327 328 WriteLiteral(" type=\"button\""); 329 330 WriteAttribute("title", Tuple.Create(" title=\"", 5965), Tuple.Create("\"", 5993) 331 332 #line 114 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 333 , Tuple.Create(Tuple.Create("", 5973), Tuple.Create<System.Object, System.Int32>(Translate("Remove") 334 335 #line default 336 #line hidden 337 , 5973), false) 338 ); 339 340 WriteLiteral(" class=\"btn btn--primary btn--condensed u-no-margin dw-mod\""); 341 342 WriteAttribute("onclick", Tuple.Create(" onclick=\"", 6053), Tuple.Create("\"", 6144) 343 , Tuple.Create(Tuple.Create("", 6063), Tuple.Create("RemoveOrderLineFromList(\'", 6063), true) 344 345 #line 114 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 346 , Tuple.Create(Tuple.Create("", 6088), Tuple.Create<System.Object, System.Int32>(orderline.GetString("Ecom:Order:OrderLine.Id") 347 348 #line default 349 #line hidden 350 , 6088), false) 351 , Tuple.Create(Tuple.Create("", 6135), Tuple.Create("\',", 6135), true) 352 , Tuple.Create(Tuple.Create(" ", 6137), Tuple.Create("this);", 6138), true) 353 ); 354 355 WriteLiteral(">\r\n <i"); 356 357 WriteLiteral(" class=\"fas fa-minus\""); 358 359 WriteLiteral("></i> <span>"); 360 361 362 #line 115 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 363 Write(Translate("Remove")); 364 365 366 #line default 367 #line hidden 368 WriteLiteral("</span>\r\n </button>\r\n " + 369 " </div>\r\n </li>\r\n"); 370 371 372 #line 119 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 373 } 374 } 375 376 377 #line default 378 #line hidden 379 WriteLiteral(" </ul>\r\n <div"); 380 381 WriteLiteral(" class=\"u-border-top u-padding-top--lg\""); 382 383 WriteLiteral(">\r\n <button"); 384 385 WriteLiteral(" type=\"button\""); 386 387 WriteAttribute("title", Tuple.Create(" title=\"", 6622), Tuple.Create("\"", 6654) 388 389 #line 123 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 390 , Tuple.Create(Tuple.Create("", 6630), Tuple.Create<System.Object, System.Int32>(Translate("Empty cart") 391 392 #line default 393 #line hidden 394 , 6630), false) 395 ); 396 397 WriteLiteral(" class=\"btn btn--secondary btn--condensed dw-mod u-pull--left u-no-margin\""); 398 399 WriteLiteral(" onclick=\"EmptyCart();\""); 400 401 WriteLiteral(">"); 402 403 404 #line 123 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 405 Write(Translate("Empty cart")); 406 407 408 #line default 409 #line hidden 410 WriteLiteral("</button>\r\n </div>\r\n </div>\r\n " + 411 " </div>\r\n <div"); 412 413 WriteLiteral(" class=\"grid__col-4\""); 414 415 WriteLiteral(">\r\n <div"); 416 417 WriteLiteral(" class=\"card-header u-color-light--bg dw-mod\""); 418 419 WriteLiteral(">\r\n <h3><i"); 420 421 WriteLiteral(" class=\"fas fa-file\""); 422 423 WriteLiteral("></i> "); 424 425 426 #line 129 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 427 Write(Translate("Export")); 428 429 430 #line default 431 #line hidden 432 WriteLiteral("</h3>\r\n </div>\r\n <div"); 433 434 WriteLiteral(" class=\"card u-color-light--bg dw-mod u-margin-bottom--lg\""); 435 436 WriteLiteral(">\r\n <form"); 437 438 WriteAttribute("action", Tuple.Create(" action=\"", 7212), Tuple.Create("\"", 7251) 439 , Tuple.Create(Tuple.Create("", 7221), Tuple.Create("/Default.aspx?ID=", 7221), true) 440 441 #line 132 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 442 , Tuple.Create(Tuple.Create("", 7238), Tuple.Create<System.Object, System.Int32>(exportPageId 443 444 #line default 445 #line hidden 446 , 7238), false) 447 ); 448 449 WriteLiteral(" method=\"post\""); 450 451 WriteLiteral(" class=\"u-no-margin\""); 452 453 WriteLiteral(" onsubmit=\"FillHiddenFieldWithProductIds(\'productIds\')\""); 454 455 WriteLiteral(">\r\n <input"); 456 457 WriteLiteral(" name=\"ID\""); 458 459 WriteLiteral(" type=\"hidden\""); 460 461 WriteLiteral(" value=\"532\""); 462 463 WriteLiteral(" />\r\n <input"); 464 465 WriteLiteral(" id=\"download\""); 466 467 WriteLiteral(" name=\"download\""); 468 469 WriteLiteral(" type=\"hidden\""); 470 471 WriteLiteral(" value=\"true\""); 472 473 WriteLiteral(" />\r\n <input"); 474 475 WriteLiteral(" id=\"productIds\""); 476 477 WriteLiteral(" name=\"ProductIds\""); 478 479 WriteLiteral(" type=\"hidden\""); 480 481 WriteLiteral(" value=\"\""); 482 483 WriteLiteral(" />\r\n <label"); 484 485 WriteLiteral(" for=\"exportLanguage\""); 486 487 WriteLiteral(">"); 488 489 490 #line 136 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 491 Write(Translate("Language")); 492 493 494 #line default 495 #line hidden 496 WriteLiteral("</label>\r\n <select"); 497 498 WriteLiteral(" id=\"exportLanguage\""); 499 500 WriteLiteral(" name=\"RequestLanguageId\""); 501 502 WriteLiteral(" class=\"u-full-width\""); 503 504 WriteLiteral(">\r\n"); 505 506 507 #line 138 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 508 509 510 #line default 511 #line hidden 512 513 #line 138 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 514 foreach (var lang in Services.Languages.GetLanguages().OrderBy(l => l.Name)) 515 { 516 var selected = lang.IsDefault ? "selected" : ""; 517 518 519 #line default 520 #line hidden 521 WriteLiteral(" <option"); 522 523 WriteAttribute("value", Tuple.Create(" value=\"", 8078), Tuple.Create("\"", 8102) 524 525 #line 141 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 526 , Tuple.Create(Tuple.Create("", 8086), Tuple.Create<System.Object, System.Int32>(lang.LanguageId 527 528 #line default 529 #line hidden 530 , 8086), false) 531 ); 532 533 WriteLiteral(" "); 534 535 536 #line 141 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 537 Write(selected); 538 539 540 #line default 541 #line hidden 542 WriteLiteral(">"); 543 544 545 #line 141 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 546 Write(lang.Name); 547 548 549 #line default 550 #line hidden 551 WriteLiteral("</option>\r\n"); 552 553 554 #line 142 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 555 } 556 557 558 #line default 559 #line hidden 560 WriteLiteral(" </select>\r\n\r\n <label"); 561 562 WriteLiteral(" for=\"exportFormat\""); 563 564 WriteLiteral(">"); 565 566 567 #line 145 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 568 Write(Translate("Export format")); 569 570 571 #line default 572 #line hidden 573 WriteLiteral("</label>\r\n <select"); 574 575 WriteLiteral(" id=\"exportFormat\""); 576 577 WriteLiteral(" name=\"format\""); 578 579 WriteLiteral(" class=\"u-full-width\""); 580 581 WriteLiteral(">\r\n <option"); 582 583 WriteLiteral(" value=\"csv\""); 584 585 WriteLiteral(">Csv</option>\r\n <option"); 586 587 WriteLiteral(" value=\"json\""); 588 589 WriteLiteral(">Json</option>\r\n <option"); 590 591 WriteLiteral(" value=\"xml\""); 592 593 WriteLiteral(">Xml</option>\r\n </select>\r\n " + 594 " <input"); 595 596 WriteLiteral(" type=\"submit\""); 597 598 WriteAttribute("title", Tuple.Create(" title=\"", 8680), Tuple.Create("\"", 8708) 599 600 #line 151 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 601 , Tuple.Create(Tuple.Create("", 8688), Tuple.Create<System.Object, System.Int32>(Translate("Submit") 602 603 #line default 604 #line hidden 605 , 8688), false) 606 ); 607 608 WriteLiteral(" class=\"btn btn--full btn--primary dw-mod u-no-margin\""); 609 610 WriteAttribute("value", Tuple.Create(" value=\"", 8763), Tuple.Create("\"", 8791) 611 612 #line 151 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 613 , Tuple.Create(Tuple.Create("", 8771), Tuple.Create<System.Object, System.Int32>(Translate("Submit") 614 615 #line default 616 #line hidden 617 , 8771), false) 618 ); 619 620 WriteLiteral(" />\r\n </form>\r\n </div>\r\n\r\n " + 621 " <div"); 622 623 WriteLiteral(" class=\"card-header u-color-light--bg dw-mod\""); 624 625 WriteLiteral(">\r\n <h3><i"); 626 627 WriteLiteral(" class=\"fas fa-print\""); 628 629 WriteLiteral("></i> "); 630 631 632 #line 156 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 633 Write(Translate("PDF catalog")); 634 635 636 #line default 637 #line hidden 638 WriteLiteral("</h3>\r\n </div>\r\n <div"); 639 640 WriteLiteral(" class=\"card u-color-light--bg dw-mod\""); 641 642 WriteLiteral(">\r\n <form"); 643 644 WriteLiteral(" action=\"/Default.aspx?Pdf=true\""); 645 646 WriteLiteral(" method=\"post\""); 647 648 WriteLiteral(" class=\"u-no-margin\""); 649 650 WriteLiteral(" onsubmit=\"FillHiddenFieldWithProductIds(\'pdfProductIds\')\""); 651 652 WriteLiteral(">\r\n <input"); 653 654 WriteLiteral(" type=\"hidden\""); 655 656 WriteLiteral(" name=\"siteUrl\""); 657 658 WriteAttribute("value", Tuple.Create(" value=\"", 9333), Tuple.Create("\"", 9448) 659 660 #line 160 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 661 , Tuple.Create(Tuple.Create("", 9341), Tuple.Create<System.Object, System.Int32>(string.Format("{0}://{1}", GetGlobalValue("Global:Request.Scheme"), GetGlobalValue("Global:Request.Host")) 662 663 #line default 664 #line hidden 665 , 9341), false) 666 ); 667 668 WriteLiteral(" />\r\n <input"); 669 670 WriteLiteral(" id=\"pdfProductIds\""); 671 672 WriteLiteral(" name=\"MainProductID\""); 673 674 WriteLiteral(" type=\"hidden\""); 675 676 WriteLiteral(" value=\"\""); 677 678 WriteLiteral(" />\r\n <label"); 679 680 WriteLiteral(" for=\"pdfLanguage\""); 681 682 WriteLiteral(">"); 683 684 685 #line 162 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 686 Write(Translate("Language")); 687 688 689 #line default 690 #line hidden 691 WriteLiteral("</label>\r\n <select"); 692 693 WriteLiteral(" id=\"pdfLanguage\""); 694 695 WriteLiteral(" name=\"RequestLanguageID\""); 696 697 WriteLiteral(" class=\"u-full-width\""); 698 699 WriteLiteral(">\r\n"); 700 701 702 #line 164 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 703 704 705 #line default 706 #line hidden 707 708 #line 164 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 709 foreach (var lang in Services.Languages.GetLanguages().OrderBy(l => l.Name)) 710 { 711 var selected = lang.IsDefault ? "selected" : ""; 712 713 714 #line default 715 #line hidden 716 WriteLiteral(" <option"); 717 718 WriteAttribute("value", Tuple.Create(" value=\"", 10017), Tuple.Create("\"", 10041) 719 720 #line 167 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 721 , Tuple.Create(Tuple.Create("", 10025), Tuple.Create<System.Object, System.Int32>(lang.LanguageId 722 723 #line default 724 #line hidden 725 , 10025), false) 726 ); 727 728 WriteLiteral(" "); 729 730 731 #line 167 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 732 Write(selected); 733 734 735 #line default 736 #line hidden 737 WriteLiteral(">"); 738 739 740 #line 167 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 741 Write(lang.Name); 742 743 744 #line default 745 #line hidden 746 WriteLiteral("</option>\r\n"); 747 748 749 #line 168 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 750 } 751 752 753 #line default 754 #line hidden 755 WriteLiteral(" </select>\r\n\r\n <label"); 756 757 WriteLiteral(" for=\"pdfTemplate\""); 758 759 WriteLiteral(">"); 760 761 762 #line 171 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 763 Write(Translate("Template")); 764 765 766 #line default 767 #line hidden 768 WriteLiteral("</label>\r\n <select"); 769 770 WriteLiteral(" id=\"pdfTemplate\""); 771 772 WriteLiteral(" name=\"ID\""); 773 774 WriteLiteral(" class=\"u-full-width\""); 775 776 WriteLiteral(">\r\n"); 777 778 779 #line 173 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 780 781 782 #line default 783 #line hidden 784 785 #line 173 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 786 foreach (Dynamicweb.Content.Page page in ServiceLocator.Current.GetPageService().GetPagesByParentID(pdfFolderId)) 787 { 788 789 790 #line default 791 #line hidden 792 WriteLiteral(" <option"); 793 794 WriteAttribute("value", Tuple.Create(" value=\"", 10547), Tuple.Create("\"", 10583) 795 796 #line 175 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 797 , Tuple.Create(Tuple.Create("", 10555), Tuple.Create<System.Object, System.Int32>(Converter.ToString(page.ID) 798 799 #line default 800 #line hidden 801 , 10555), false) 802 ); 803 804 WriteLiteral(">"); 805 806 807 #line 175 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 808 Write(page.MenuText); 809 810 811 #line default 812 #line hidden 813 WriteLiteral("</option>\r\n"); 814 815 816 #line 176 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 817 } 818 819 820 #line default 821 #line hidden 822 WriteLiteral(" </select>\r\n\r\n <input"); 823 824 WriteLiteral(" type=\"submit\""); 825 826 WriteAttribute("title", Tuple.Create(" title=\"", 10734), Tuple.Create("\"", 10762) 827 828 #line 179 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 829 , Tuple.Create(Tuple.Create("", 10742), Tuple.Create<System.Object, System.Int32>(Translate("Submit") 830 831 #line default 832 #line hidden 833 , 10742), false) 834 ); 835 836 WriteLiteral(" class=\"btn btn--full btn--primary dw-mod u-no-margin\""); 837 838 WriteAttribute("value", Tuple.Create(" value=\"", 10817), Tuple.Create("\"", 10845) 839 840 #line 179 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 841 , Tuple.Create(Tuple.Create("", 10825), Tuple.Create<System.Object, System.Int32>(Translate("Submit") 842 843 #line default 844 #line hidden 845 , 10825), false) 846 ); 847 848 WriteLiteral(@" /> 849 </form> 850 </div> 851 </div> 852 </div> 853 </div> 854 </div> 855 </section> 856 857 <script> 858 function RemoveOrderLineFromList(orderLineId, button) { 859 downloadCart.RemoveFromDownloadCart(orderLineId, button, function (result) { 860 button.closest(""li.panel-list__item"").remove(); 861 ReduceCartItemsCounter(); 862 }); 863 } 864 865 function ReduceCartItemsCounter() { 866 let span = document.getElementById(""cart_items_counter""); 867 let count = parseInt(span.innerText); 868 if (count - 1 == 0) { 869 location.reload(); 870 } else { 871 span.innerText = count - 1; 872 } 873 } 874 875 function FillHiddenFieldWithProductIds(hiddenID) { 876 let productIds = []; 877 document.querySelectorAll(""#download_cart_list > li"").forEach(function (product) { 878 productIds.push(product.getAttribute(""data-id"")); 879 }); 880 document.getElementById(hiddenID).value = productIds.join("",""); 881 } 882 883 function EmptyCart() { 884 document.location.href = ""/Default.aspx?ID="); 885 886 887 #line 215 "E:\Solutions\Thermex\Files\Templates\Designs\Rapido\eCom7\CartV2\Step\DownloadCart.cshtml" 888 Write(Pageview.Page.ID); 889 890 891 #line default 892 #line hidden 893 WriteLiteral("&OrderContext=\" + downloadCart.settings.contextId + \"&cartcmd=emptycart\";\r\n }\r" + 894 "\n</script>"); 895 896 } 897 } 898 } 899

1 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2 @using Dynamicweb.Ecommerce 3 @using Dynamicweb.Ecommerce.Orders 4 @using Dynamicweb.Content 5 @using Dynamicweb.Extensibility 6 @using System.Linq 7 @using System.Web 8 @using Dynamicweb.Core 9 10 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 11 @using Custom.Thermex.Helpers; 12 13 @* 14 This is a temporary fallback for the DefaultImage. The image pattern MUST be set up like this: 15 16 ImageSmall = /{ProductNumber}.jpg 17 ImageMedium = /{ProductNumber}{VariantOptionLevel1}.jpg 18 ImageLarge = /{ProductNumber}{VariantComboName}.jpg 19 20 In addition to the ImageDefault setting 21 *@ 22 23 @functions { 24 public string GetProductImage(LoopItem productObject = null) 25 { 26 string theImage = ""; 27 string missingImage = "missing_image"; 28 29 if (productObject == null) 30 { 31 theImage = GetString("Ecom:Product.ImageDefault.Default.Clean"); 32 theImage = String.IsNullOrEmpty(theImage) ? GetString("Ecom:Product.ImageLarge.Clean") : theImage; 33 theImage = String.IsNullOrEmpty(theImage) ? GetString("Ecom:Product.ImageMedium.Clean") : theImage; 34 theImage = String.IsNullOrEmpty(theImage) ? GetString("Ecom:Product.ImageSmall.Clean") : theImage; 35 theImage = String.IsNullOrEmpty(theImage) ? GetString("Ecom:Product.ImageLarge.Default.Clean") : theImage; 36 37 if (String.IsNullOrWhiteSpace(theImage) || theImage.Contains(missingImage)) 38 { 39 try 40 { 41 theImage = ImageHelper.GetFirstImage(Dynamicweb.Ecommerce.Services.Products.GetProductByNumber(GetString("Ecom:Product.Number"), true).GetProductFieldValue("ImagePaths").ToString()); 42 if (string.IsNullOrEmpty(theImage)) 43 { 44 theImage = "/Images/missing_image.jpg"; 45 } 46 } 47 catch 48 { 49 // Do nothing 50 } 51 } 52 } 53 else 54 { 55 theImage = productObject.GetString("Ecom:Product.ImageDefault.Default.Clean"); 56 theImage = String.IsNullOrEmpty(theImage) ? productObject.GetString("Ecom:Product.ImageLarge.Clean") : theImage; 57 theImage = String.IsNullOrEmpty(theImage) ? productObject.GetString("Ecom:Product.ImageMedium.Clean") : theImage; 58 theImage = String.IsNullOrEmpty(theImage) ? productObject.GetString("Ecom:Product.ImageSmall.Clean") : theImage; 59 theImage = String.IsNullOrEmpty(theImage) ? productObject.GetString("Ecom:Product.ImageLarge.Default.Clean") : theImage; 60 61 if (String.IsNullOrWhiteSpace(theImage) || theImage.Contains(missingImage)) 62 { 63 try 64 { 65 theImage = ImageHelper.GetFirstImage(Dynamicweb.Ecommerce.Services.Products.GetProductByNumber(productObject.GetString("Ecom:Product.Number"), true).GetProductFieldValue("ImagePaths").ToString()); 66 if (string.IsNullOrEmpty(theImage)) 67 { 68 theImage = "/Images/missing_image.jpg"; 69 } 70 } 71 catch 72 { 73 // Do nothing 74 } 75 } 76 } 77 78 return theImage; 79 } 80 } 81 82 83 @{ 84 string exportPageId = GetPageIdByNavigationTag("ProductExportFeed").ToString(); 85 int pdfFolderId = GetPageIdByNavigationTag("DownloadCartPDFTemplates"); 86 } 87 88 <section class="multiple-paragraphs-container u-color-light-gray--bg paragraph-container--full-width u-min-h500px"> 89 <div class="center-container center-container--with-background-image dw-mod"> 90 <div class="paragraph-container u-padding"> 91 <div class="grid"> 92 <div class="grid__col-12"> 93 <div class="u-margin-bottom"> 94 <h2 class="u-no-margin">@Translate("Downloads")</h2> 95 </div> 96 </div> 97 <div class="grid__col-8"> 98 <div class="card-header u-color-light--bg dw-mod"> 99 <h3><i class="fas fa-download"></i> @Translate("Items ready to download") (<span id="cart_items_counter">@GetString("Ecom:Order.OrderLines.TotalProductQuantity")</span>)</h3> 100 </div> 101 <div class="card u-color-light--bg dw-mod"> 102 <ul class="panel-list" id="download_cart_list"> 103 @foreach (LoopItem orderline in GetLoop("OrderLines").Where(o => o.GetInteger("Ecom:Order:OrderLine.Type") != (int)OrderLineType.Tax).ToList()) 104 { 105 if (orderline.GetBoolean("Ecom:Order:OrderLine.IsProduct")) 106 { 107 <li class="panel-list__item" data-id="@orderline.GetString("Ecom:Product.ID")"> 108 <img class="u-margin-right b-lazy" src="/Files/Images/placeholder.gif" data-src="/Admin/Public/GetImage.ashx?width=60&height=60&crop=5&Compression=75&image=@GetProductImage(orderline)" alt="@orderline.GetString("Ecom:Order:OrderLine.ProductName")"> 109 <div class="panel-list__item-name"> 110 <div class="u-truncate-text">@orderline.GetString("Ecom:Order:OrderLine.ProductName")</div> 111 <small>@orderline.GetString("Ecom:Order:OrderLine.ProductNumber")</small> 112 </div> 113 <div class="panel-list__item-actions"> 114 <button type="button" title="@Translate("Remove")" class="btn btn--primary btn--condensed u-no-margin dw-mod" onclick="RemoveOrderLineFromList('@orderline.GetString("Ecom:Order:OrderLine.Id")', this);"> 115 <i class="fas fa-minus"></i> <span>@Translate("Remove")</span> 116 </button> 117 </div> 118 </li> 119 } 120 } 121 </ul> 122 <div class="u-border-top u-padding-top--lg"> 123 <button type="button" title="@Translate("Empty cart")" class="btn btn--secondary btn--condensed dw-mod u-pull--left u-no-margin" onclick="EmptyCart();">@Translate("Empty cart")</button> 124 </div> 125 </div> 126 </div> 127 <div class="grid__col-4"> 128 <div class="card-header u-color-light--bg dw-mod"> 129 <h3><i class="fas fa-file"></i> @Translate("Export")</h3> 130 </div> 131 <div class="card u-color-light--bg dw-mod u-margin-bottom--lg"> 132 <form action="/Default.aspx?ID=@exportPageId" method="post" class="u-no-margin" onsubmit="FillHiddenFieldWithProductIds('productIds')"> 133 <input name="ID" type="hidden" value="532" /> 134 <input id="download" name="download" type="hidden" value="true" /> 135 <input id="productIds" name="ProductIds" type="hidden" value="" /> 136 <label for="exportLanguage">@Translate("Language")</label> 137 <select id="exportLanguage" name="RequestLanguageId" class="u-full-width"> 138 @foreach (var lang in Services.Languages.GetLanguages().OrderBy(l => l.Name)) 139 { 140 var selected = lang.IsDefault ? "selected" : ""; 141 <option value="@lang.LanguageId" @selected>@lang.Name</option> 142 } 143 </select> 144 145 <label for="exportFormat">@Translate("Export format")</label> 146 <select id="exportFormat" name="format" class="u-full-width"> 147 <option value="csv">Csv</option> 148 <option value="json">Json</option> 149 <option value="xml">Xml</option> 150 </select> 151 <input type="submit" title="@Translate("Submit")" class="btn btn--full btn--primary dw-mod u-no-margin" value="@Translate("Submit")" /> 152 </form> 153 </div> 154 155 <div class="card-header u-color-light--bg dw-mod"> 156 <h3><i class="fas fa-print"></i> @Translate("PDF catalog")</h3> 157 </div> 158 <div class="card u-color-light--bg dw-mod"> 159 <form action="/Default.aspx?Pdf=true" method="post" class="u-no-margin" onsubmit="FillHiddenFieldWithProductIds('pdfProductIds')"> 160 <input type="hidden" name="siteUrl" value="@string.Format("{0}://{1}", GetGlobalValue("Global:Request.Scheme"), GetGlobalValue("Global:Request.Host"))" /> 161 <input id="pdfProductIds" name="MainProductID" type="hidden" value="" /> 162 <label for="pdfLanguage">@Translate("Language")</label> 163 <select id="pdfLanguage" name="RequestLanguageID" class="u-full-width"> 164 @foreach (var lang in Services.Languages.GetLanguages().OrderBy(l => l.Name)) 165 { 166 var selected = lang.IsDefault ? "selected" : ""; 167 <option value="@lang.LanguageId" @selected>@lang.Name</option> 168 } 169 </select> 170 171 <label for="pdfTemplate">@Translate("Template")</label> 172 <select id="pdfTemplate" name="ID" class="u-full-width"> 173 @foreach (Dynamicweb.Content.Page page in ServiceLocator.Current.GetPageService().GetPagesByParentID(pdfFolderId)) 174 { 175 <option value="@Converter.ToString(page.ID)">@page.MenuText</option> 176 } 177 </select> 178 179 <input type="submit" title="@Translate("Submit")" class="btn btn--full btn--primary dw-mod u-no-margin" value="@Translate("Submit")" /> 180 </form> 181 </div> 182 </div> 183 </div> 184 </div> 185 </div> 186 </section> 187 188 <script> 189 function RemoveOrderLineFromList(orderLineId, button) { 190 downloadCart.RemoveFromDownloadCart(orderLineId, button, function (result) { 191 button.closest("li.panel-list__item").remove(); 192 ReduceCartItemsCounter(); 193 }); 194 } 195 196 function ReduceCartItemsCounter() { 197 let span = document.getElementById("cart_items_counter"); 198 let count = parseInt(span.innerText); 199 if (count - 1 == 0) { 200 location.reload(); 201 } else { 202 span.innerText = count - 1; 203 } 204 } 205 206 function FillHiddenFieldWithProductIds(hiddenID) { 207 let productIds = []; 208 document.querySelectorAll("#download_cart_list > li").forEach(function (product) { 209 productIds.push(product.getAttribute("data-id")); 210 }); 211 document.getElementById(hiddenID).value = productIds.join(","); 212 } 213 214 function EmptyCart() { 215 document.location.href = "/Default.aspx?ID=@(Pageview.Page.ID)&OrderContext=" + downloadCart.settings.contextId + "&cartcmd=emptycart"; 216 } 217 </script>