Error executing template "Designs/Rapido/eCom/Productlist/ConfiguratorRender.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_96abbad7e16548629b5773b1791d236e.<RenderPageTop>b__16_0(TextWriter __razor_helper_writer) in D:\Dynamicweb.net\Solutions\FactorAdman\egholm2019.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\eCom\Productlist\ConfiguratorRender.cshtml:line 1026
   at CompiledRazorTemplates.Dynamic.RazorEngine_96abbad7e16548629b5773b1791d236e.<RenderPageContainer>b__15_0(TextWriter __razor_helper_writer) in D:\Dynamicweb.net\Solutions\FactorAdman\egholm2019.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\eCom\Productlist\ConfiguratorRender.cshtml:line 969
   at RazorEngine.Templating.TemplateWriter.ToString()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at CompiledRazorTemplates.Dynamic.RazorEngine_96abbad7e16548629b5773b1791d236e.<>c__DisplayClass2_0.<RenderBlock>b__0(TextWriter __razor_helper_writer) in D:\Dynamicweb.net\Solutions\FactorAdman\egholm2019.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\eCom\Productlist\ConfiguratorRender.cshtml:line 169
   at CompiledRazorTemplates.Dynamic.RazorEngine_96abbad7e16548629b5773b1791d236e.<>c__DisplayClass1_0.<RenderBlockList>b__0(TextWriter __razor_helper_writer) in D:\Dynamicweb.net\Solutions\FactorAdman\egholm2019.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\eCom\Productlist\ConfiguratorRender.cshtml:line 83
   at CompiledRazorTemplates.Dynamic.RazorEngine_96abbad7e16548629b5773b1791d236e.Execute() in D:\Dynamicweb.net\Solutions\FactorAdman\egholm2019.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\eCom\Productlist\ConfiguratorRender.cshtml:line 964
   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.<RunCompile>b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
   at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2 @using Dynamicweb.Frontend.Devices 3 @using Dynamicweb.Extensibility 4 @using Dynamicweb.Content 5 @using Dynamicweb.Core 6 @using System 7 @using System.IO 8 @using System.Web 9 @using System.Collections.Generic; 10 @using System.Linq 11 @using System.Text.RegularExpressions 12 @using Dynamicweb.Rapido.Blocks 13 @using Dynamicweb.Ecommerce.Products; 14 15 @functions { 16 BlocksPage productListPage = BlocksPage.GetBlockPage("ProductList"); 17 } 18 19 @{ 20 Block pageContainer = new Block() 21 { 22 Id = "PageContainer", 23 Template = RenderPageContainer(), 24 SkipRenderBlocksList = true 25 }; 26 productListPage.Add(pageContainer); 27 28 Block productListNavigation = new Block() 29 { 30 Id = "Navigation", 31 SortId = 20, 32 Design = new Design 33 { 34 RenderType = RenderType.Column, 35 Size = "0" 36 } 37 }; 38 productListPage.Add("PageContainer", productListNavigation); 39 40 Block productListContainer = new Block() 41 { 42 Id = "ProductList", 43 SortId = 30, 44 Template = RenderProductList(), 45 SkipRenderBlocksList = true 46 }; 47 productListPage.Add("PageContainer", productListContainer); 48 49 Block productListSnippets = new Block() 50 { 51 Id = "BottomSnippets", 52 SortId = 40 53 }; 54 productListPage.Add(productListSnippets); 55 } 56 57 @* This is required for the product list feed to work *@ 58 @GetValue("DoNotRenderProductListTemplate") 59 60 @* Include the required Grid builder (Contains the methods @RenderBlockList and @RenderBlock) *@ 61 @using System.Text.RegularExpressions 62 @using System.Collections.Generic 63 @using System.Reflection 64 @using System.Web.UI.HtmlControls 65 @using Dynamicweb.Rapido.Blocks.Components 66 @using Dynamicweb.Rapido.Blocks.Components.Articles 67 @using Dynamicweb.Rapido.Blocks.Components.Documentation 68 @using Dynamicweb.Rapido.Blocks 69 70 71 @*--- START: Base block renderers ---*@ 72 73 @helper RenderBlockList(List<Block> blocks) 74 { 75 blocks = blocks.OrderBy(item => item.SortId).ToList(); 76 77 foreach (Block item in blocks) 78 { 79 <!-- START: @item.Id --> 80 81 if (item.Design == null) 82 { 83 @RenderBlock(item) 84 } 85 else if (item.Design.RenderType == RenderType.None) { 86 string cssClass = item.Design.CssClass != null ? item.Design.CssClass : ""; 87 88 <div class="@cssClass dw-mod"> 89 @RenderBlock(item) 90 </div> 91 } 92 else if (item.Design.RenderType != RenderType.Hide) 93 { 94 string cssClass = item.Design.CssClass != null ? item.Design.CssClass : ""; 95 96 if (!item.SkipRenderBlocksList) { 97 if (item.Design.RenderType == RenderType.Row) 98 { 99 <div class="grid grid--align-content-start @cssClass dw-mod" id="Block__@item.Id"> 100 @RenderBlock(item) 101 </div> 102 } 103 104 if (item.Design.RenderType == RenderType.Column) 105 { 106 string hidePadding = item.Design.HidePadding ? "u-no-padding" : ""; 107 string size = item.Design.Size ?? "12"; 108 size = Regex.IsMatch(size, @"\d") ? "md-" + item.Design.Size : item.Design.Size; 109 110 <div class="grid__col-lg-@item.Design.Size grid__col-md-@item.Design.Size grid__col-sm-12 grid__col-xs-12 @hidePadding @cssClass dw-mod" id="Block__@item.Id"> 111 @RenderBlock(item) 112 </div> 113 } 114 115 if (item.Design.RenderType == RenderType.Table) 116 { 117 <table class="table @cssClass dw-mod" id="Block__@item.Id"> 118 @RenderBlock(item) 119 </table> 120 } 121 122 if (item.Design.RenderType == RenderType.TableRow) 123 { 124 <tr class="@cssClass dw-mod" id="Block__@item.Id"> 125 @RenderBlock(item) 126 </tr> 127 } 128 129 if (item.Design.RenderType == RenderType.TableColumn) 130 { 131 <td class="@cssClass dw-mod" id="Block__@item.Id"> 132 @RenderBlock(item) 133 </td> 134 } 135 136 if (item.Design.RenderType == RenderType.CardHeader) 137 { 138 <div class="card-header @cssClass dw-mod"> 139 @RenderBlock(item) 140 </div> 141 } 142 143 if (item.Design.RenderType == RenderType.CardBody) 144 { 145 <div class="card @cssClass dw-mod"> 146 @RenderBlock(item) 147 </div> 148 } 149 150 if (item.Design.RenderType == RenderType.CardFooter) 151 { 152 <div class="card-footer @cssClass dw-mod"> 153 @RenderBlock(item) 154 </div> 155 } 156 } 157 else 158 { 159 @RenderBlock(item) 160 } 161 } 162 163 <!-- END: @item.Id --> 164 } 165 } 166 167 @helper RenderBlock(Block item) 168 { 169 if (item.Template != null) 170 { 171 @BlocksPage.RenderTemplate(item.Template) 172 } 173 174 if (item.Component != null) 175 { 176 string methodName = item.Component.HelperName; 177 dynamic[] methodParameters = new dynamic[1]; 178 methodParameters[0] = item.Component; 179 Type methodType = this.GetType(); 180 MethodInfo generalMethod = methodType.GetMethod(methodName); 181 182 if (generalMethod != null) { 183 @generalMethod.Invoke(this, methodParameters).ToString(); 184 } else { 185 throw new Exception(item.Component.GetType().Name + " method '" + methodName +"' could not be invoked"); 186 } 187 } 188 189 if (item.BlocksList.Count > 0 && !item.SkipRenderBlocksList) 190 { 191 @RenderBlockList(item.BlocksList) 192 } 193 } 194 195 @*--- END: Base block renderers ---*@ 196 197 198 @* Include the Blocks for the page *@ 199 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 200 @using Dynamicweb.Core 201 @using System 202 @using System.Web 203 @using System.Collections.Generic 204 @using Dynamicweb.Rapido.Blocks 205 206 @{ 207 BlocksPage productListProductsBlocksPage = BlocksPage.GetBlockPage("ProductList"); 208 209 Block productsBlock = new Block 210 { 211 Id = "Views", 212 SortId = 30, 213 Template = RenderProducts() 214 }; 215 216 productListProductsBlocksPage.Add("ProductList", productsBlock); 217 } 218 219 @helper RenderProducts() 220 { 221 @*This is part of a script template *@ 222 223 <div id="ProductsContainer" data-template="{{listTemplate}}" class="grid product-list grid--external-bleed-x dw-mod" data-save-cookie="true"> 224 {{#ProductsContainer}} 225 {{> (lookup . 'template') }} 226 {{/ProductsContainer}} 227 </div> 228 } 229 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 230 @using Dynamicweb.Core 231 @using System 232 @using System.Web 233 @using System.Collections.Generic 234 @using Dynamicweb.Rapido.Blocks 235 236 @if (Pageview.AreaSettings.GetItem("ProductList").GetBoolean("EnableGridView")) 237 { 238 BlocksPage productList = BlocksPage.GetBlockPage("ProductList"); 239 240 Block gridViewButton = new Block 241 { 242 Id = "ProductGridItemContainer", 243 Name = "th", 244 SortId = 20 245 }; 246 productList.Add("Views", gridViewButton); 247 248 249 Block gridViewScripts = new Block 250 { 251 Id = "GridViewScripts", 252 SortId = 20, 253 Template = GridView() 254 }; 255 256 Block modalContent = new Block 257 { 258 Id = "ModalContent", 259 SortId = 30, 260 Template = RenderModalContent() 261 }; 262 263 productList.Add("BottomSnippets", gridViewScripts); 264 productList.Add("BottomSnippets", modalContent); 265 } 266 267 @helper GridView() 268 { 269 bool onlyPreview = Pageview.AreaSettings.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Pageview.User == null; 270 bool pointShopOnly = Pageview.AreaSettings.GetItem("Ecommerce").GetBoolean("PointShopOnly"); 271 bool showPrice = !Pageview.AreaSettings.GetItem("ProductList").GetBoolean("HidePrice"); 272 string cartIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon") != null ? Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue : "fas fa-shopping-cart"; 273 string columnsCount = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetList("Columns") != null ? Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetList("Columns").SelectedValue : "4"; 274 bool showCartButton = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("ShowAddToCartButton"); 275 bool showViewButton = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("ShowViewButton"); 276 bool showFavoriteButton = !Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("HideFavoriteButton"); 277 bool showAddToDownloadButton = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("ShowAddToDownloadButton"); 278 bool showStock = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("ShowStockAndShipping"); 279 bool showNumber = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("ShowProductNumber"); 280 bool showStaticVariants = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("ShowStaticVariants"); 281 string cartButtonText = Translate("Add to cart"); 282 string viewMoreText = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetString("ViewMoreText")) ? Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetString("ViewMoreText") : "View"; 283 bool useGoogleTagManager = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("Settings").GetString("GoogleTagManagerID")); 284 bool showVATPrice = Pageview.AreaSettings.GetItem("ProductList").GetBoolean("ShowBothPricesWithWithoutVAT"); 285 bool isPricesWithVATEnabled = Converter.ToBoolean(Pageview.Area.EcomPricesWithVat); 286 string imageZoomOnHover = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("HoverImageZoom") ? "image-hover--zoom" : ""; 287 bool secondaryImage = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetString("HoverAlternatineImage") != null ? Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("HoverAlternatineImage") : false; 288 string footerClasses = showStaticVariants ? "u-min-h120px" : ""; 289 290 <script id="ProductGridItemContainer" type="text/x-template"> 291 {{#.}} 292 <div id="Product{{id}}" data-template="ProductGridItem" data-preloader="overlay" class="grid__col-lg-@columnsCount grid__col-md-@columnsCount grid__col-sm-@columnsCount grid__col-xs-6 product-list__grid-item @imageZoomOnHover dw-mod"> 293 {{#Product}} 294 {{>ProductGridItem}} 295 {{/Product}} 296 </div> 297 {{/.}} 298 </script> 299 300 <script id="ProductGridItem" type="text/x-template"> 301 {{#.}} 302 @if (useGoogleTagManager) 303 { 304 <text>{{{googleEnchantImpression 'Product catalogue' currency googleImpression}}}</text> 305 } 306 <input type="hidden" name="ProductLoopCounter{{id}}" value="{{id}}" /> 307 <input type="hidden" name="ProductID{{id}}" value="{{productId}}" /> 308 309 <div class="grid__cell product-list__grid-item__image dw-mod {{noImage}}"> 310 <img class="grid__cell-img b-lazy @*configurator-image*@" src="/Files/Images/placeholder.gif" 311 data-src="/Admin/Public/GetImage.ashx?width=377&amp;height=316&amp;crop=5&amp;Compression=85&amp;FillCanvas=true&amp;DoNotUpscale=false&amp;image={{image}}" 312 @if (secondaryImage) 313 { 314 <text> 315 {{#if secondaryImage}} 316 data-secondary-image-src="/Admin/Public/GetImage.ashx?width=300&amp;height=300&amp;crop=5&amp;Compression=75&amp;FillCanvas=true&amp;DoNotUpscale=true&amp;image={{secondaryImage}}" 317 {{/if}} 318 </text> 319 } 320 alt="{{name}}" /> 321 {{#StickersContainers}} 322 {{>StickersContainer}} 323 {{/StickersContainers}} 324 @if (showFavoriteButton) 325 { 326 <div class="favorites favorites--for-grid-view u-pull--right {{hasVariants}} dw-mod" {{hasVariants}}> 327 {{#Favorite}} 328 {{>FavoriteTemplate}} 329 {{/Favorite}} 330 </div> 331 } 332 </div> 333 334 <div class="grid__cell product-list__grid-item__price-info {{shortGridInfo}} dw-mod flex-configurator-product"> 335 <h2 class="u-condensed-text builder__content__card__header" title="{{name}}">{{name}}</h2> 336 <div class="builder__content__card__description">{{{description}}}</div> 337 {{#if TechnicalDocumentLink}} 338 <div class="configurator-technicalDocument-link"> 339 {{#if StandardEquipment}} 340 <div style="margin-top:5px;" class="attachment-content-information"> 341 <a href="javascript:void(0)" class="js-equipment-modal equipment-modal-trigger" data-prodid="{{productId}}" data-model="{{name}}" data-modalcontent="{{StandardEquipment}}"><strong>@Translate("view-attachment-equipment", "Se inkluderet standardudstyr")</strong></a> 342 </div> 343 {{/if}} 344 <a href="/Files/Files/{{TechnicalDocumentLink}}" target="_blank">@Translate("View Technical Data (pdf)")</a> 345 </div> 346 {{/if}} 347 @if (showPrice && !onlyPreview) 348 { 349 if (pointShopOnly) 350 { 351 <text> 352 {{#if havePointPrice}} 353 <div class="price price--product-list dw-mod">{{points}} @Translate("points")</div> 354 {{else}} 355 @Translate("Not available") 356 {{/if}} 357 </text> 358 } 359 else 360 { 361 <div class="price price--product-list dw-mod">{{price}}</div> 362 <div class="before-price {{onSale}} dw-mod">{{discount}}</div> 363 if (showVATPrice) 364 { 365 <div class="vat-price vat-price--product-list u-margin-top dw-mod"> 366 @if (isPricesWithVATEnabled) 367 { 368 <span>@Translate("excl. VAT")</span> 369 370 <span> ({{priceWithoutVAT}})</span> 371 } 372 else 373 { 374 <span>@Translate("incl. VAT")</span> 375 376 <span> ({{priceWithVAT}})</span> 377 } 378 379 380 381 382 </div> 383 } 384 } 385 386 387 } 388 <input type="hidden" value="{{unitId}}" name="Unit{{id}}" id="Unit_{{id}}" /> 389 <input type="hidden" value="{{variantid}}" name="VariantID{{id}}" id="Variant_{{id}}" /> 390 </div> 391 392 <div class="product-list__grid-item__footer @footerClasses dw-mod"> 393 <div class="u-ta-center u-inline-block u-full-width"> 394 <div class="buttons-collection {{hideBuyOptions}}"> 395 <button type="button" id="CartButton_{{id}}" class="js-cart-btn btn btn--secondary builder__content__btn dw-mod builder__content__btn--color-change--green u-full-width builder__mobile__btn {{disabledBuyButton}}" name="submit" data-prodid="{{productId}}" data-variantid="{{variantid}}" data-unitid="{{unitId}}" data-prodinfo="{{productInfo}}" {{#if HasRelatedProducts}} data-hasrelateditems="{{HasRelatedProducts}}" data-relatedproducts="{{SerializedRelatedProducts}}" data-image="{{image}}" {{/if}} data-isbrochure="{{IsBrochure}}" data-name="{{name}}" data-quantity="1" data-id="{{id}}" style="min-height: 42px !important;" 396 onclick="checkProductQuantity(event) {{disabledBuyButton}}"> 397 @cartButtonText 398 </button> 399 <input type="hidden" class="u-w80px u-pull--right use-btn-primary-height" id="Quantity_{{id}}" name="Quantity{{id}}" value="1" min="1"> 400 <input type="hidden" value="{{unitId}}" name="Unit{{id}}" id="Unit_{{id}}" /> 401 </div> 402 </div> 403 404 @if (!onlyPreview && showStock) 405 { 406 <div class="u-margin-top"> 407 <div><span class="stock-icon {{stockState}} u-no-margin dw-mod" title="{{stockText}}"></span> {{stockText}}</div> 408 <div> 409 {{#if deliveryText}} 410 {{deliveryText}} 411 {{else}} 412 - 413 {{/if}} 414 </div> 415 </div> 416 } 417 418 @if (showStaticVariants) 419 { 420 <text> 421 {{#Variants}} 422 {{>StaticVariantsTemplate}} 423 {{/Variants}} 424 425 {{#ifCond variantGroupsCount '>' 1}} 426 <div class="static-variant"> 427 @Translate("More options available") 428 </div> 429 {{/ifCond}} 430 431 {{#ifCond variantGroupsCount '==' 0}} 432 <div class="static-variant"></div> 433 {{/ifCond}} 434 </text> 435 } 436 437 @if (showAddToDownloadButton && Pageview.User != null) 438 { 439 <button type="button" class="btn btn--secondary u-no-margin u-margin-top btn--condensed dw-mod js-add-to-downloads" title="@Translate("Add")" data-product-id="{{productId}}"> 440 <i class="fas fa-plus js-button-icon"></i> 441 <span class="js-button-text">@Translate(viewMoreText)</span> 442 </button> 443 } 444 </div> 445 {{/.}} 446 </script> 447 } 448 449 @* Render modal content and script to close modal *@ 450 451 @helper RenderModalContent() 452 { 453 <div class="equipment-modal" id="equipment-modal"> 454 <div class="equipment-modal-header"> 455 <span id="equipment-modal-close" class="equipment-modal-close">&times;</span> 456 <div class="equipment-modal-header-item-name"> 457 @Translate("standard-equipment", "Standardudstyr") 458 </div> 459 <div class="equipment-modal-content"> 460 461 </div> 462 </div> 463 </div> 464 465 <script> 466 467 468 document.addEventListener("DOMContentLoaded",function (){ 469 470 471 var modal = document.getElementById("equipment-modal"); 472 var span = document.getElementsByClassName("equipment-modal-close")[0]; 473 474 span.addEventListener("click", function () { 475 modal.style.display = "none"; 476 477 document.documentElement.style.overflow = "auto"; 478 }); 479 480 window.addEventListener("click", function (event) { 481 if (event.target === modal) { 482 modal.style.display = "none"; 483 document.documentElement.style.overflow = "auto"; 484 } 485 }); 486 487 488 }) 489 490 </script> 491 } 492 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 493 @using Dynamicweb.Core 494 @using System 495 @using System.Web 496 @using System.Collections.Generic 497 @using Dynamicweb.Rapido.Blocks 498 499 @{ 500 BlocksPage productListPromotionsBlocksPage = BlocksPage.GetBlockPage("ProductList"); 501 502 Block productListPromotions = new Block 503 { 504 Id = "Promotions", 505 SortId = 10, 506 Template = RenderProductListPromotions() 507 }; 508 productListPromotionsBlocksPage.Add("PageContainer", productListPromotions); 509 } 510 511 @helper RenderProductListPromotions() 512 { 513 @*This is part of a script template *@ 514 515 string listId = HttpContext.Current.Request.QueryString.Get("ListID"); 516 bool isFavoriteList = !string.IsNullOrEmpty(listId); 517 518 if (!isFavoriteList) 519 { 520 switch (Pageview.AreaSettings.GetItem("ProductList").GetList("PromotionBlockDesign").SelectedValue) 521 { 522 case "OnlyText": 523 <article class="grid__col-12 u-margin-bottom"> 524 <h1>{{groupName}}</h1> 525 {{{groupDescription}}} 526 </article> 527 break; 528 case "TextAndImage": 529 <article class="grid__col-12 u-margin-bottom"> 530 <div class="grid grid--bleed"> 531 <div class="grid__col-md-6"> 532 <h1>{{groupName}}</h1> 533 {{{groupDescription}}} 534 </div> 535 {{#ifCond groupPromotionImage "!==" ""}} 536 <div class="grid__col-md-6"> 537 <img src="/Admin/Public/GetImage.ashx?width=600&crop=5&Compression=75&DoNotUpscale=true&image={{groupPromotionImage}}" alt="{{groupName}}" class="background-image__cover" /> 538 </div> 539 {{/ifCond}} 540 </div> 541 </article> 542 break; 543 case "Banner": 544 <text> 545 {{#ifCond groupPromotionImage "!==" ""}} 546 <article class="grid__col-12 u-margin-bottom"> 547 <div class="u-color-light grid center-container center-container--with-background-image u-padding" style="background-image:url('{{groupPromotionImage}}'); background-size: cover;"> 548 <div class="grid__col-12 u-middle"> 549 <div class="grid__cell"> 550 {{{groupDescription}}} 551 </div> 552 </div> 553 </div> 554 </article> 555 {{/ifCond}} 556 </text> 557 break; 558 } 559 } 560 } 561 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 562 @using Dynamicweb.Core 563 @using System 564 @using System.Web 565 @using System.Collections.Generic 566 @using Dynamicweb.Rapido.Blocks 567 568 @{ 569 BlocksPage productListMenuBlocksPage = BlocksPage.GetBlockPage("ProductList"); 570 571 if (Pageview.Page.PropertyItem["LeftMenu"] != null && Converter.ToString(Pageview.Page.PropertyItem["LeftMenu"]) == "True" && Pageview.Page.NavigationSettings != null && Pageview.Page.NavigationSettings.UseEcomGroups) { 572 Block productListMenuBlock = new Block 573 { 574 Id = "Menu", 575 SortId = 20, 576 Template = RenderProductListMenu() 577 }; 578 579 productListMenuBlocksPage.Add("Navigation", productListMenuBlock); 580 } 581 } 582 583 @helper RenderProductListMenu() 584 { 585 var navigationMarkup = RenderNavigation(new 586 { 587 id = "leftnav", 588 cssclass = "dwnavigation", 589 startLevel = 1, 590 endlevel = 5, 591 template = "LeftNavigation.xslt", 592 mode = "ecom" 593 }); 594 595 <h2 class="u-margin-bottom">@Translate("Product categories")</h2> 596 597 <div class="u-padding-bottom--lg"> 598 @navigationMarkup 599 </div> 600 } 601 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 602 @using Dynamicweb.Core 603 @using System 604 @using System.Web 605 @using System.Collections.Generic 606 @using Dynamicweb.Rapido.Blocks 607 608 @{ 609 BlocksPage productListBottomSnippetsPage = BlocksPage.GetBlockPage("ProductList"); 610 611 Block productListStickers = new Block 612 { 613 Id = "Stickers", 614 SortId = 10, 615 Template = RenderStickersTemplates() 616 }; 617 productListBottomSnippetsPage.Add("BottomSnippets", productListStickers); 618 619 Block productListUnits = new Block 620 { 621 Id = "Units", 622 SortId = 20, 623 Template = RenderUnitTemplates() 624 }; 625 productListBottomSnippetsPage.Add("BottomSnippets", productListUnits); 626 627 Block productListVariants = new Block 628 { 629 Id = "Variants", 630 SortId = 30, 631 Template = RenderVariantTemplates() 632 }; 633 productListBottomSnippetsPage.Add("BottomSnippets", productListVariants); 634 635 Block productListFavorites = new Block 636 { 637 Id = "Favorites", 638 SortId = 40, 639 Template = RenderFavoritesTemplates() 640 }; 641 productListBottomSnippetsPage.Add("BottomSnippets", productListFavorites); 642 643 Block productListPreRender = new Block 644 { 645 Id = "PreRenders", 646 SortId = 50, 647 Template = RenderPreRenderTemplates() 648 }; 649 productListBottomSnippetsPage.Add("BottomSnippets", productListPreRender); 650 651 Block productListInitializers = new Block 652 { 653 Id = "Initializers", 654 SortId = 60, 655 Template = RenderInitializers() 656 }; 657 productListBottomSnippetsPage.Add("BottomSnippets", productListInitializers); 658 } 659 660 @helper RenderStickersTemplates() { 661 <script id="StickersContainer" type="text/x-template"> 662 <div class="stickers-container stickers-container--{{position}} dw-mod"> 663 {{#Stickers}} 664 {{>Sticker}} 665 {{/Stickers}} 666 </div> 667 </script> 668 669 <script id="Sticker" type="text/x-template"> 670 <div class="stickers-container__tag {{className}} dw-mod">{{text}}</div> 671 </script> 672 673 <script id="MiniSticker" type="text/x-template"> 674 <div class="stickers-container__tag stickers-container__tag--micro {{className}} dw-mod">{{text}}</div> 675 </script> 676 } 677 678 @helper RenderUnitTemplates() { 679 <script id="UnitOption" type="text/x-template"> 680 <div class="dropdown__item dw-mod" onclick="HandlebarsBolt.UpdateContent('Product{{id}}', '{{link}}&feed=true&UnitID={{value}}&rid={{id}}')">{{name}}</div> 681 </script> 682 } 683 684 @helper RenderVariantTemplates() { 685 <script id="VariantsTemplate" type="text/x-template"> 686 {{#.}} 687 <div> 688 <div class="u-bold">{{name}}</div> 689 <div> 690 {{#VariantOptions}} 691 {{>VariantOption}} 692 {{/VariantOptions}} 693 </div> 694 </div> 695 {{/.}} 696 </script> 697 698 <script id="VariantOption" type="text/x-template"> 699 {{#if color}} 700 <button type="button" data-variant-id="{{variantId}}" data-variant-group="{{groupId}}" onclick="MatchVariants.SelectThis(event)" class="btn btn--colorbox u-margin-right {{disabled}} {{selected}} js-variant-option" data-check="{{selected}}" {{disabled}} style="background-color: {{color}}"></button> 701 {{else}} 702 {{#if image}} 703 <img data-variant-id="{{variantId}}" data-variant-group="{{groupId}}" src="{{image}}" onclick="MatchVariants.SelectThis(event)" alt="{{name}}" title="{{name}}" class="btn btn--tag {{selected}} js-variant-option" data-check="{{selected}}" /> 704 {{else}} 705 <button type="button" data-variant-id="{{variantId}}" data-variant-group="{{groupId}}" onclick="MatchVariants.SelectThis(event)" class="btn btn--tag {{disabled}} {{selected}} js-variant-option" data-check="{{selected}}" {{disabled}}>{{name}}</button> 706 {{/if}} 707 {{/if}} 708 </script> 709 710 <script id="StaticVariantsTemplate" type="text/x-template"> 711 {{#.}} 712 {{#if isFirstGroup}} 713 <div> 714 {{#VariantOptions}} 715 {{>StaticVariantOption}} 716 {{/VariantOptions}} 717 </div> 718 {{/if}} 719 {{/.}} 720 </script> 721 722 <script id="StaticVariantOption" type="text/x-template"> 723 {{#if color}} 724 <div class="static-variant static-variant--color dw-mod" style="background-color: {{color}}" title="{{name}}"></div> 725 {{else}} 726 <div class="static-variant dw-mod">{{name}} </div> 727 {{/if}} 728 </script> 729 730 <script id="VariantOptionImage" type="text/x-template"> 731 <img data-variant-id="{{variantId}}" data-friends="{{friendsList}}" data-variant-group="{{groupId}}" onclick="MatchVariants.SelectThis(event)" src="/Admin/Public/GetImage.ashx?width=100&amp;height=50&amp;crop=5&amp;Compression=75&amp;image=/Images/{{image}}" alt="{{name}}" title="{{name}}" class="btn btn--tag {{disabled}} {{selected}} js-variant-option" data-check="{{selected}}" {{disabled}} /> 732 </script> 733 } 734 735 @helper RenderFavoritesTemplates() { 736 <script id="FavoriteTemplate" type="text/x-template"> 737 <div class="favorites-list u-ta-left"> 738 <label for="FavoriteTrigger_{{id}}" class="u-no-margin js-favorite-btn"><i class="{{favoriteIcon}} fa-1_5x"></i></label> 739 <input type="checkbox" id="FavoriteTrigger_{{id}}" class="dropdown-trigger" /> 740 <div class="dropdown dropdown--absolute-position"> 741 <div class="dropdown__content dropdown__content--show-left dropdown__content--padding u-w220px dw-mod"> 742 <ul class="list list--clean dw-mod"> 743 {{#FavoriteLists}} 744 {{>FavoriteListItem}} 745 {{/FavoriteLists}} 746 </ul> 747 </div> 748 <label class="dropdown-trigger-off" for="FavoriteTrigger_{{id}}"></label> 749 </div> 750 </div> 751 </script> 752 753 <script id="FavoriteListItem" type="text/x-template"> 754 <li> 755 <a href="{{link}}" class="list__link u-no-underline dw-mod" onclick="Scroll.SavePosition(event); {{facebookPixelAction}}"><i class="{{favoriteIcon}}"></i> {{name}}</a> 756 </li> 757 </script> 758 } 759 760 @helper RenderPreRenderTemplates() { 761 string facetsViewMode = !String.IsNullOrEmpty(Pageview.AreaSettings.GetItem("ProductList").GetString("FacetsViewMode")) ? Pageview.AreaSettings.GetItem("ProductList").GetString("FacetsViewMode").ToLower() : "left"; 762 763 <script id="ProductPreRenderContainer" type="text/x-template"> 764 @if (facetsViewMode == "left" && Pageview.Device.ToString() != "Mobile") 765 { 766 <div class="grid__col-3"> 767 <div class="pre-render-element pre-render-element--xs"></div> 768 <div class="pre-render-element pre-render-element--md"></div> 769 <div class="pre-render-element pre-render-element--md"></div> 770 <div class="pre-render-element pre-render-element--md"></div> 771 </div> 772 } 773 <div class="grid__col-auto"> 774 <div class="pre-render-element pre-render-element--xs"></div> 775 <div class="pre-render-element pre-render-element--lg"></div> 776 <div class="pre-render-element pre-render-element--lg"></div> 777 <div class="pre-render-element pre-render-element--lg"></div> 778 <div class="pre-render-element pre-render-element--lg"></div> 779 </div> 780 </script> 781 } 782 783 @helper RenderInitializers() { 784 <script> 785 document.addEventListener("DOMContentLoaded", function (event) { 786 document.getElementById("productList").addEventListener('contentLoaded', function (e) { 787 if (getTarget(e).id === "productList") { 788 Search.Init(); 789 Facets.Init("selectedFacets", "productList"); 790 } 791 }, false); 792 }); 793 </script> 794 } 795 796 @if (File.Exists(HttpContext.Current.Server.MapPath("/Files/Templates/Designs/Rapido/eCom/ProductList/Blocks/Custom__Blocks.cshtml"))) 797 { 798 <text>@inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 799 @using System 800 @using System.Web.UI 801 @using Dynamicweb.Ecommerce.Products; 802 803 @{ 804 BlocksPage customBlocksPage = BlocksPage.GetBlockPage("ProductList"); 805 BlocksPage masterBlocksPage = BlocksPage.GetBlockPage("Master"); 806 807 Block freeReturns = new Block 808 { 809 Id = "freeReturns", 810 SortId = 99, 811 Template = RenderFreeReturns() 812 }; 813 customBlocksPage.Add("PageContainer", freeReturns); 814 } 815 816 @helper RenderFreeReturns() 817 { 818 int optionsPageId = GetPageIdByNavigationTag("OptionsPage"); 819 int attachmentsPageId = GetPageIdByNavigationTag("AttachmentsPage"); 820 int documentsPageId = GetPageIdByNavigationTag("DocumentsPage"); 821 int cartPageId = GetPageIdByNavigationTag("CartPage"); 822 823 int currentPage = Convert.ToInt32(GetGlobalValue("Global:Page.ID")); 824 string nextPage = currentPage.ToString(); 825 826 string modelId = Dynamicweb.Context.Current.Request.QueryString["Model"]; 827 828 bool existingProduct = (Dynamicweb.Context.Current.Request.QueryString["Existing"] != null) ? Convert.ToBoolean(Dynamicweb.Context.Current.Request.QueryString["Existing"].ToString().ToLower()) : false; 829 830 string nextPageText = Translate("Continue"); 831 832 if (currentPage == attachmentsPageId) 833 { 834 if (!existingProduct) 835 { 836 if (!Egholm.Helpers.Users.IsInGroupConfigurator()) 837 { 838 nextPage = cartPageId.ToString() + "&Model=" + modelId + "&Existing=" + existingProduct; 839 nextPageText = Translate("Generate proposal - enduser"); 840 } 841 else 842 { 843 nextPage = documentsPageId.ToString() + "&Model=" + modelId + "&Existing=" + existingProduct; 844 nextPageText = Translate("Select documents"); 845 } 846 } 847 else 848 { 849 if (!Egholm.Helpers.Users.IsInGroupConfigurator()) 850 { 851 nextPage = cartPageId.ToString() + "&Model=" + modelId + "&Existing=" + existingProduct; 852 nextPageText = Translate("Generate proposal - enduser"); 853 } 854 else 855 { 856 nextPage = documentsPageId.ToString() + "&Model=" + modelId + "&Existing=" + existingProduct; 857 nextPageText = Translate("Select documents"); 858 } 859 } 860 } 861 862 if (currentPage == optionsPageId) 863 { 864 if (Egholm.Helpers.Users.IsInGroupConfigurator()) 865 { 866 if (!existingProduct) 867 { 868 nextPage = attachmentsPageId.ToString() + "&Model=" + modelId + "&Existing=" + existingProduct; 869 nextPageText = Translate("Select tools"); 870 } 871 else 872 { 873 nextPage = documentsPageId.ToString() + "&Model=" + modelId + "&Existing=" + existingProduct; 874 nextPageText = Translate("Select documents"); 875 } 876 } 877 else 878 { 879 if (existingProduct != false) 880 { 881 nextPage = cartPageId.ToString() + "&Model=" + modelId + "&Existing=" + existingProduct; 882 nextPageText = Translate("Generate proposal - enduser"); 883 } 884 else 885 { 886 nextPage = attachmentsPageId.ToString() + "&Model=" + modelId + "&Existing=False"; 887 nextPageText = Translate("Select tools"); 888 } 889 } 890 } 891 if (currentPage == documentsPageId) 892 { 893 nextPage = cartPageId.ToString() + "&Model=" + modelId + "&Existing=" + existingProduct; 894 if (!Egholm.Helpers.Users.IsInGroupConfigurator()) 895 { 896 nextPageText = Translate("Generate proposal - enduser"); 897 } 898 else 899 { 900 nextPageText = Translate("Generate proposal - dealer"); 901 } 902 } 903 904 <div class="grid__col-lg-4"> 905 <div class="builder__cart"> 906 @{ 907 Product product = new ProductService().GetProductsByGroupId("GROUP254", true, Pageview.Area.EcomLanguageId, false).FirstOrDefault(x => x.Number.Equals(modelId)); 908 if (product != null) 909 { 910 <div class="grid__col-12"> 911 <h2 class="builder__header--fontsize-28 u-mb-0px">@product.Name</h2> 912 </div> 913 } 914 915 <div>&nbsp;</div> 916 <div id="egholmCart"></div> 917 <input value="@Translate("Cart_Remove", "Remove")" id="egholmCartRemoveTranslations" type="hidden"/> 918 @*KR 09222020*@ 919 <input value="@Translate("Total", "Total")" id="egholmCartTotalTranslations" type="hidden"/> 920 <input value="@Translate("Price without VAT", "Price without VAT")" id="egholmCartPriceWithoutVATTranslations" type="hidden"/> 921 @*\KR 09222020*@ 922 } 923 <div class="grid__col-12"></div> 924 <div class="grid__col-12"> 925 <a href="/Default.aspx?ID=@nextPage" class="btn btn--secondary builder__content__btn builder__content__btn--orange builder__content__btn--width100 u-mt-20px">@nextPageText</a> 926 </div> 927 </div> 928 <div class="grid__col-12"> 929 @if ((currentPage == attachmentsPageId || currentPage == documentsPageId) && !existingProduct) 930 { 931 <a href="Default.aspx?ID=@optionsPageId&Model=@modelId&Existing=@existingProduct.ToString()" class="btn btn--secondary builder__content__btn builder__content__btn--grey u-mt-20px">@Translate("Back to Accessories")</a> 932 } 933 @if (currentPage == documentsPageId && !existingProduct) 934 { 935 <a href="Default.aspx?ID=@attachmentsPageId&Model=@modelId&Existing=@existingProduct.ToString()" class="btn btn--secondary builder__content__btn builder__content__btn--grey u-mt-10px">@Translate("Back to Attachments")</a> 936 } 937 <a href="/Default.aspx?ID=@GetPageIdByNavigationTag("CartPage")&cartcmd=emptycart&Redirect=@Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(GetPageIdByNavigationTag("ConfiguratorPage"))" class="btn btn--secondary builder__content__btn builder__content__btn--grey u-mt-10px">@Translate("Clear and restart")</a> 938 939 <!-- 940 <a href="#" onclick="Cart.EmptyCart(event); return false; window.location = '/configurator';" id="restart" name="restart" class="btn btn--secondary builder__content__btn builder__content__btn--grey u-mt-10px">@Translate("Clear and restart")</a> 941 --> 942 943 </div> 944 </div> 945 }</text> 946 } 947 948 @if (productListNavigation.BlocksList.Count < 1) 949 { 950 productListNavigation.Design.RenderType = RenderType.Hide; 951 } 952 <input type="hidden" id="CartOrderlinesFeed" name="CartOrderlinesFeed" value="@GetPageIdByNavigationTag("CartOrderlinesFeed")"/> 953 <input type="hidden" id="CartOrderlinesFeedDOM" name="CartOrderlinesFeedDOM" value="@GetPageIdByNavigationTag("CartOrderlinesFeedDOM")"/> 954 <input type="hidden" id="OptionsPage" name="OptionsPage" value="@GetPageIdByNavigationTag("OptionsPage")"/> 955 <input type="hidden" id="AttachmentsPage" name="AttachmentsPage" value="@GetPageIdByNavigationTag("AttachmentsPage")" /> 956 <input type="hidden" id="PageID" name="PageID" value="@Pageview.Page.ID" /> 957 <input type="hidden" id="DomainUrl" name="DomainUrl" value="@HttpContext.Current.Request.Url.ToString().Substring(0, HttpContext.Current.Request.Url.ToString().IndexOf("/Default.aspx"))"/> 958 <input type="hidden" id="ConfiguratorPath" name="ConfiguratorPath" value="@Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(GetPageIdByNavigationTag("ConfiguratorPage"))"/> 959 <input type="hidden" id="alertTranslation" name="alertTranslation" value="@Translate("already_in_cart", "Already in the cart")"/> 960 <input type="hidden" id="emptyCartTranslation" name="emptyCartTranslation" value="@Translate("empty_configurator", "Your configurator is empty")"/> 961 <form name="multiForm" id="multiForm" method="post"> 962 <input type="hidden" name="CartCmd" id="attachmentCartCmd" value="addMulti"/> 963 @* The @RenderBlockList base helper is included in Components/GridBuilder.cshtml *@ 964 @RenderBlockList(productListPage.BlocksRoot.BlocksList) 965 </form> 966 967 @helper RenderPageContainer() 968 { 969 @RenderPageTop() 970 971 List<Block> subBlocks = this.productListPage.GetBlockListById("PageContainer").OrderBy(item => item.SortId).ToList(); 972 973 string pageUrl = GetGlobalValue("Global:Pageview.Url.Raw"); 974 string listId = HttpContext.Current.Request.QueryString.Get("ListID"); 975 bool isFavoriteList = !string.IsNullOrEmpty(listId); 976 string feedFullUrl = pageUrl + "&feed=true"; 977 feedFullUrl += !isFavoriteList ? "&DoNotShowVariantsAsSingleProducts=True" : ""; 978 string smallDeviceCss = Pageview.Device.ToString() == "Mobile" ? "" : ""; 979 980 <div class="grid grid--align-content-start @smallDeviceCss js-handlebars-root rearrangecart" id="productList" data-template="ProductContainer" data-pre-render-template="ProductPreRenderContainer" data-json-feed="@feedFullUrl" data-preloader="overlay"></div> 981 982 <script id="ProductContainer" type="text/x-template"> 983 {{#each .}} 984 @RenderBlockList(subBlocks) 985 {{else}} 986 <div class="grid__col-12"> 987 <h2 class="u-ta-center">@Translate("Your search gave 0 results")</h2> 988 </div> 989 {{/each}} 990 </script> 991 } 992 993 @helper RenderPageTop() 994 { 995 string modelId = Dynamicweb.Context.Current.Request.QueryString["Model"]; 996 Product product = new ProductService().GetProductsByGroupId("GROUP254", true, Pageview.Area.EcomLanguageId, false).FirstOrDefault(x => x.Number.Equals(modelId)); 997 998 int attachmentsPageId = GetPageIdByNavigationTag("AttachmentsPage"); 999 int accessoriesPageId = GetPageIdByNavigationTag("OptionsPage"); 1000 int documentsPageId = GetPageIdByNavigationTag("DocumentsPage"); 1001 int currentPage = Convert.ToInt32(GetGlobalValue("Global:Page.ID")); 1002 1003 string heading = string.Empty; 1004 string paragraph = string.Empty; 1005 string clientString = string.Empty; 1006 string paragraphText = string.Empty; 1007 1008 if (currentPage == attachmentsPageId) 1009 { 1010 paragraph = Translate("Now select your attachments for"); 1011 } 1012 if (currentPage == accessoriesPageId) 1013 { 1014 paragraph = Translate("Now select your accessories for"); 1015 } 1016 if (currentPage == documentsPageId) 1017 { 1018 paragraph = Translate("Now select your documents for"); 1019 paragraphText = Translate("Document textarea"); 1020 } 1021 if (Egholm.Helpers.Users.IsInGroupConfigurator()) 1022 { 1023 clientString = Translate(" for client"); 1024 } 1025 1026 <h2>@Translate("Building") @product.Name @clientString</h2> 1027 <h4>@paragraph @product.Name</h4> 1028 if (!String.IsNullOrEmpty(paragraphText)) 1029 { 1030 <p>@paragraphText</p> 1031 } 1032 } 1033 1034 @helper RenderProductList() 1035 { 1036 @*This is part of a script template *@ 1037 1038 List<Block> subBlocks = productListPage.GetBlockListById("ProductList").OrderBy(item => item.SortId).ToList(); 1039 1040 string pageId = GetGlobalValue("Global:Page.ID"); 1041 string pageUrl = GetGlobalValue("Global:Pageview.Url.Raw"); 1042 string listId = HttpContext.Current.Request.QueryString.Get("ListID"); 1043 bool isFavoriteList = !string.IsNullOrEmpty(listId); 1044 string feedFullUrl = pageUrl + "&feed=true"; 1045 feedFullUrl += !isFavoriteList ? "&DoNotShowVariantsAsSingleProducts=True" : ""; 1046 string smallDeviceCss = Pageview.Device.ToString() == "Mobile" ? "u-no-padding" : ""; 1047 1048 <div class="grid__col-lg-8 @smallDeviceCss u-no-padding"> 1049 @if (isFavoriteList) 1050 { 1051 string searchPlaceholder = Translate("Search favorite products", "Search favorite products"); 1052 string searchValue = HttpContext.Current.Request.QueryString.Get("Search") ?? ""; 1053 1054 <div class="grid__cell"> 1055 <div class="u-pull--left"> 1056 <h2 class="u-no-margin"><i class="{{headerIcon}}"></i>{{header}}</h2> 1057 </div> 1058 <div class="grid__col--bleed grid__col-6 u-pull--right"> 1059 <div class="u-margin-bottom"> 1060 <div class="typeahead u-color-inherit js-typeahead" data-page-size="10" id="FavoritesSearch" data-list-id="@listId" data-search-feed-id="@pageId&feed=true" data-result-page-id="@pageId"> 1061 <input type="text" class="typeahead-search-field u-no-margin u-full-width js-typeahead-search-field" placeholder="@searchPlaceholder" value="@searchValue"> 1062 <ul class="dropdown dropdown--absolute-position u-full-width js-handlebars-root js-typeahead-search-content u-min-w220px u-full-width dw-mod" id="FavoritesSearchContent" data-template="SearchProductsTemplate" data-json-feed="@feedFullUrl&ListID=@listId" data-init-onload="false" data-preloader="minimal"></ul> 1063 <button type="button" class="btn btn--condensed btn--primary u-no-margin dw-mod js-typeahead-enter-btn"> 1064 <i class="fas fa-search"></i> 1065 </button> 1066 </div> 1067 </div> 1068 </div> 1069 </div> 1070 } 1071 1072 <div class="grid__cell"> 1073 @RenderBlockList(subBlocks) 1074 </div> 1075 </div> 1076 } 1077 <div class="options-modal" id="options-modal" data-currentlocation="configurator"> 1078 <div class="options-modal-header"> 1079 <span id="options-modal-close" class="options-modal-close">&times;</span> 1080 <div class="options-modal-header-item-name"> 1081 Rotary/mulch mover 1200 1082 </div> 1083 <div class="options-modal-content"> 1084 <p class="text">@Translate("has_options_text", "This item has options - please specify your preferred configuration below.")</p> 1085 <div class="options-container"> 1086 <div class="grid"> 1087 <div class="grid__col-lg-6 grid__col-md-8 u-padding-0"> 1088 <div class="js-options-container"> 1089 1090 </div> 1091 <button class="btn btn--secondary options-modal-btn js-add-options" disabled onclick="configuratorAddPartsToCart(event)">@Translate("add_to_selection", "ADD TO SELECTION")</button> 1092 <button class="btn btn--secondary options-modal-btn js-no-option-please" style="margin-bottom: 0px;" onclick="configuratorSkipOptions(event)">@Translate("no_options_please", "NO OPTIONS PLEASE")</button> 1093 </div> 1094 <div class="grid__col-lg-6 grid__col-md-4 u-padding-0"> 1095 <img class="js-options-modal-content-img" src=""/> 1096 </div> 1097 </div> 1098 </div> 1099 </div> 1100 </div> 1101 </div> 1102 1103 <script> 1104 var modal = document.getElementById("options-modal"); 1105 1106 var btn = document.getElementById("myBtn"); 1107 1108 var span = document.getElementsByClassName("options-modal-close")[0]; 1109 1110 span.onclick = function() { 1111 modal.style.display = "none"; 1112 $("html").css("overflow", "auto"); 1113 } 1114 1115 window.onclick = function(event) { 1116 if (event.target == modal) { 1117 modal.style.display = "none"; 1118 $("html").css("overflow", "auto"); 1119 } 1120 } 1121 </script>