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_80166b3885844cd19ea23cf3adf9e36b.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 1008
   at CompiledRazorTemplates.Dynamic.RazorEngine_80166b3885844cd19ea23cf3adf9e36b.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 951
   at RazorEngine.Templating.TemplateWriter.ToString()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at CompiledRazorTemplates.Dynamic.RazorEngine_80166b3885844cd19ea23cf3adf9e36b.<>c__DisplayClass2_0.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_80166b3885844cd19ea23cf3adf9e36b.<>c__DisplayClass1_0.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_80166b3885844cd19ea23cf3adf9e36b.Execute() in D:\Dynamicweb.net\Solutions\FactorAdman\egholm2019.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\eCom\Productlist\ConfiguratorRender.cshtml:line 946
   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 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 257 Block modalContent = new Block 258 { 259 Id = "ModalContent", 260 SortId = 30, 261 Template = RenderModalContent() 262 }; 263 264 productList.Add("BottomSnippets", gridViewScripts); 265 productList.Add("BottomSnippets", modalContent); 266 } 267 268 @helper GridView() 269 { 270 bool onlyPreview = Pageview.AreaSettings.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Pageview.User == null; 271 bool pointShopOnly = Pageview.AreaSettings.GetItem("Ecommerce").GetBoolean("PointShopOnly"); 272 bool showPrice = !Pageview.AreaSettings.GetItem("ProductList").GetBoolean("HidePrice"); 273 string cartIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon") != null ? Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue : "fas fa-shopping-cart"; 274 string columnsCount = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetList("Columns") != null ? Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetList("Columns").SelectedValue : "4"; 275 bool showCartButton = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("ShowAddToCartButton"); 276 bool showViewButton = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("ShowViewButton"); 277 bool showFavoriteButton = !Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("HideFavoriteButton"); 278 bool showAddToDownloadButton = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("ShowAddToDownloadButton"); 279 bool showStock = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("ShowStockAndShipping"); 280 bool showNumber = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("ShowProductNumber"); 281 bool showStaticVariants = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("ShowStaticVariants"); 282 string cartButtonText = Translate("Add to cart"); 283 string viewMoreText = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetString("ViewMoreText")) ? Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetString("ViewMoreText") : "View"; 284 bool useGoogleTagManager = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("Settings").GetString("GoogleTagManagerID")); 285 bool showVATPrice = Pageview.AreaSettings.GetItem("ProductList").GetBoolean("ShowBothPricesWithWithoutVAT"); 286 bool isPricesWithVATEnabled = Converter.ToBoolean(Pageview.Area.EcomPricesWithVat); 287 string imageZoomOnHover = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("HoverImageZoom") ? "image-hover--zoom" : ""; 288 bool secondaryImage = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetString("HoverAlternatineImage") != null ? Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("HoverAlternatineImage") : false; 289 string footerClasses = showStaticVariants ? "u-min-h120px" : ""; 290 291 <script id="ProductGridItemContainer" type="text/x-template"> 292 {{#.}} 293 <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"> 294 {{#Product}} 295 {{>ProductGridItem}} 296 {{/Product}} 297 </div> 298 {{/.}} 299 </script> 300 301 <script id="ProductGridItem" type="text/x-template"> 302 {{#.}} 303 @if (useGoogleTagManager) 304 { 305 <text>{{{googleEnchantImpression 'Product catalogue' currency googleImpression}}}</text> 306 } 307 <input type="hidden" name="ProductLoopCounter{{id}}" value="{{id}}" /> 308 <input type="hidden" name="ProductID{{id}}" value="{{productId}}" /> 309 310 <div class="grid__cell product-list__grid-item__image dw-mod {{noImage}}"> 311 <img class="grid__cell-img b-lazy @*configurator-image*@" src="/Files/Images/placeholder.gif" 312 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}}" 313 @if (secondaryImage) { <text> 314 {{#if secondaryImage}} 315 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}}" 316 {{/if}} 317 </text> } 318 alt="{{name}}" /> 319 {{#StickersContainers}} 320 {{>StickersContainer}} 321 {{/StickersContainers}} 322 @if (showFavoriteButton) 323 { 324 <div class="favorites favorites--for-grid-view u-pull--right {{hasVariants}} dw-mod" {{hasVariants}}> 325 {{#Favorite}} 326 {{>FavoriteTemplate}} 327 {{/Favorite}} 328 </div> 329 } 330 </div> 331 332 <div class="grid__cell product-list__grid-item__price-info {{shortGridInfo}} dw-mod flex-configurator-product"> 333 <h2 class="u-condensed-text builder__content__card__header" title="{{name}}">{{name}}</h2> 334 <div class="builder__content__card__description">{{{description}}}</div> 335 336 {{#if TechnicalDocumentLink}} 337 <div class="configurator-technicalDocument-link"> 338 {{#if StandardEquipment}} 339 <a style="padding-top:15px;" 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> 340 {{/if}} 341 <a style="font-weight: 400;" href="/Files/Files/{{TechnicalDocumentLink}}" target="_blank">@Translate("View Technical Data (pdf)")</a> 342 </div> 343 {{/if}} 344 345 @if (showPrice && !onlyPreview) 346 { 347 if (pointShopOnly) 348 { 349 <text> 350 {{#if havePointPrice}} 351 <div class="price price--product-list dw-mod">{{points}} @Translate("points")</div> 352 {{else}} 353 @Translate("Not available") 354 {{/if}} 355 </text> 356 } 357 else 358 { 359 <div class="price price--product-list dw-mod">{{price}}</div> 360 <div class="before-price {{onSale}} dw-mod">{{discount}}</div> 361 if (showVATPrice) 362 { 363 <div class="vat-price vat-price--product-list u-margin-top dw-mod"> 364 @if (isPricesWithVATEnabled) 365 { 366 <span>@Translate("excl. VAT")</span><span> ({{priceWithoutVAT}})</span> 367 } 368 else 369 { 370 <span>@Translate("incl. VAT")</span><span> ({{priceWithVAT}})</span> 371 } 372 </div> 373 } 374 } 375 } 376 <input type="hidden" value="{{unitId}}" name="Unit{{id}}" id="Unit_{{id}}" /> 377 <input type="hidden" value="{{variantid}}" name="VariantID{{id}}" id="Variant_{{id}}" /> 378 </div> 379 380 <div class="product-list__grid-item__footer @footerClasses dw-mod"> 381 <div class="u-ta-center u-inline-block u-full-width"> 382 <div class="buttons-collection {{hideBuyOptions}}"> 383 <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;" 384 onclick="checkProductQuantity(event) {{disabledBuyButton}}"> 385 @cartButtonText 386 </button> 387 <input type="hidden" class="u-w80px u-pull--right use-btn-primary-height" id="Quantity_{{id}}" name="Quantity{{id}}" value="1" min="1"> 388 <input type="hidden" value="{{unitId}}" name="Unit{{id}}" id="Unit_{{id}}" /> 389 </div> 390 </div> 391 392 @if (!onlyPreview && showStock) 393 { 394 <div class="u-margin-top"> 395 <div><span class="stock-icon {{stockState}} u-no-margin dw-mod" title="{{stockText}}"></span> {{stockText}}</div> 396 <div> 397 {{#if deliveryText}} 398 {{deliveryText}} 399 {{else}} 400 - 401 {{/if}} 402 </div> 403 </div> 404 } 405 406 @if (showStaticVariants) 407 { 408 <text> 409 {{#Variants}} 410 {{>StaticVariantsTemplate}} 411 {{/Variants}} 412 413 {{#ifCond variantGroupsCount '>' 1}} 414 <div class="static-variant"> 415 @Translate("More options available") 416 </div> 417 {{/ifCond}} 418 419 {{#ifCond variantGroupsCount '==' 0}} 420 <div class="static-variant"></div> 421 {{/ifCond}} 422 </text> 423 } 424 425 @if (showAddToDownloadButton && Pageview.User != null) 426 { 427 <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}}"> 428 <i class="fas fa-plus js-button-icon"></i> 429 <span class="js-button-text">@Translate(viewMoreText)</span> 430 </button> 431 } 432 </div> 433 {{/.}} 434 </script> 435 } 436 437 438 @* Render modal content and script to close modal *@ 439 @helper RenderModalContent() 440 { 441 <div class="equipment-modal" id="equipment-modal"> 442 <div class="equipment-modal-header"> 443 <span id="equipment-modal-close" class="equipment-modal-close">&times;</span> 444 <div class="equipment-modal-header-item-name"> 445 @Translate("standard-equipment", "Standardudstyr") 446 </div> 447 <div class="equipment-modal-content"> 448 449 </div> 450 </div> 451 </div> 452 453 <script> 454 window.onload = function () { 455 var modal = document.getElementById("equipment-modal"); 456 var span = document.getElementsByClassName("equipment-modal-close")[0]; 457 458 span.addEventListener("click", function () { 459 modal.style.display = "none"; 460 document.documentElement.style.overflow = "auto"; 461 }); 462 463 window.addEventListener("click", function (event) { 464 if (event.target === modal) { 465 modal.style.display = "none"; 466 document.documentElement.style.overflow = "auto"; 467 } 468 }); 469 } 470 </script> 471 } 472 473 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 474 @using Dynamicweb.Core 475 @using System 476 @using System.Web 477 @using System.Collections.Generic 478 @using Dynamicweb.Rapido.Blocks 479 480 @{ 481 BlocksPage productListPromotionsBlocksPage = BlocksPage.GetBlockPage("ProductList"); 482 483 Block productListPromotions = new Block 484 { 485 Id = "Promotions", 486 SortId = 10, 487 Template = RenderProductListPromotions() 488 }; 489 productListPromotionsBlocksPage.Add("PageContainer", productListPromotions); 490 } 491 492 @helper RenderProductListPromotions() 493 { 494 @*This is part of a script template *@ 495 496 string listId = HttpContext.Current.Request.QueryString.Get("ListID"); 497 bool isFavoriteList = !string.IsNullOrEmpty(listId); 498 499 if (!isFavoriteList) 500 { 501 switch (Pageview.AreaSettings.GetItem("ProductList").GetList("PromotionBlockDesign").SelectedValue) 502 { 503 case "OnlyText": 504 <article class="grid__col-12 u-margin-bottom"> 505 <h1>{{groupName}}</h1> 506 {{{groupDescription}}} 507 </article> 508 break; 509 case "TextAndImage": 510 <article class="grid__col-12 u-margin-bottom"> 511 <div class="grid grid--bleed"> 512 <div class="grid__col-md-6"> 513 <h1>{{groupName}}</h1> 514 {{{groupDescription}}} 515 </div> 516 {{#ifCond groupPromotionImage "!==" ""}} 517 <div class="grid__col-md-6"> 518 <img src="/Admin/Public/GetImage.ashx?width=600&crop=5&Compression=75&DoNotUpscale=true&image={{groupPromotionImage}}" alt="{{groupName}}" class="background-image__cover" /> 519 </div> 520 {{/ifCond}} 521 </div> 522 </article> 523 break; 524 case "Banner": 525 <text> 526 {{#ifCond groupPromotionImage "!==" ""}} 527 <article class="grid__col-12 u-margin-bottom"> 528 <div class="u-color-light grid center-container center-container--with-background-image u-padding" style="background-image:url('{{groupPromotionImage}}'); background-size: cover;"> 529 <div class="grid__col-12 u-middle"> 530 <div class="grid__cell"> 531 {{{groupDescription}}} 532 </div> 533 </div> 534 </div> 535 </article> 536 {{/ifCond}} 537 </text> 538 break; 539 } 540 } 541 } 542 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 543 @using Dynamicweb.Core 544 @using System 545 @using System.Web 546 @using System.Collections.Generic 547 @using Dynamicweb.Rapido.Blocks 548 549 @{ 550 BlocksPage productListMenuBlocksPage = BlocksPage.GetBlockPage("ProductList"); 551 552 if (Pageview.Page.PropertyItem["LeftMenu"] != null && Converter.ToString(Pageview.Page.PropertyItem["LeftMenu"]) == "True" && Pageview.Page.NavigationSettings != null && Pageview.Page.NavigationSettings.UseEcomGroups) { 553 Block productListMenuBlock = new Block 554 { 555 Id = "Menu", 556 SortId = 20, 557 Template = RenderProductListMenu() 558 }; 559 560 productListMenuBlocksPage.Add("Navigation", productListMenuBlock); 561 } 562 } 563 564 @helper RenderProductListMenu() 565 { 566 var navigationMarkup = RenderNavigation(new 567 { 568 id = "leftnav", 569 cssclass = "dwnavigation", 570 startLevel = 1, 571 endlevel = 5, 572 template = "LeftNavigation.xslt", 573 mode = "ecom" 574 }); 575 576 <h2 class="u-margin-bottom">@Translate("Product categories")</h2> 577 578 <div class="u-padding-bottom--lg"> 579 @navigationMarkup 580 </div> 581 } 582 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 583 @using Dynamicweb.Core 584 @using System 585 @using System.Web 586 @using System.Collections.Generic 587 @using Dynamicweb.Rapido.Blocks 588 589 @{ 590 BlocksPage productListBottomSnippetsPage = BlocksPage.GetBlockPage("ProductList"); 591 592 Block productListStickers = new Block 593 { 594 Id = "Stickers", 595 SortId = 10, 596 Template = RenderStickersTemplates() 597 }; 598 productListBottomSnippetsPage.Add("BottomSnippets", productListStickers); 599 600 Block productListUnits = new Block 601 { 602 Id = "Units", 603 SortId = 20, 604 Template = RenderUnitTemplates() 605 }; 606 productListBottomSnippetsPage.Add("BottomSnippets", productListUnits); 607 608 Block productListVariants = new Block 609 { 610 Id = "Variants", 611 SortId = 30, 612 Template = RenderVariantTemplates() 613 }; 614 productListBottomSnippetsPage.Add("BottomSnippets", productListVariants); 615 616 Block productListFavorites = new Block 617 { 618 Id = "Favorites", 619 SortId = 40, 620 Template = RenderFavoritesTemplates() 621 }; 622 productListBottomSnippetsPage.Add("BottomSnippets", productListFavorites); 623 624 Block productListPreRender = new Block 625 { 626 Id = "PreRenders", 627 SortId = 50, 628 Template = RenderPreRenderTemplates() 629 }; 630 productListBottomSnippetsPage.Add("BottomSnippets", productListPreRender); 631 632 Block productListInitializers = new Block 633 { 634 Id = "Initializers", 635 SortId = 60, 636 Template = RenderInitializers() 637 }; 638 productListBottomSnippetsPage.Add("BottomSnippets", productListInitializers); 639 } 640 641 @helper RenderStickersTemplates() { 642 <script id="StickersContainer" type="text/x-template"> 643 <div class="stickers-container stickers-container--{{position}} dw-mod"> 644 {{#Stickers}} 645 {{>Sticker}} 646 {{/Stickers}} 647 </div> 648 </script> 649 650 <script id="Sticker" type="text/x-template"> 651 <div class="stickers-container__tag {{className}} dw-mod">{{text}}</div> 652 </script> 653 654 <script id="MiniSticker" type="text/x-template"> 655 <div class="stickers-container__tag stickers-container__tag--micro {{className}} dw-mod">{{text}}</div> 656 </script> 657 } 658 659 @helper RenderUnitTemplates() { 660 <script id="UnitOption" type="text/x-template"> 661 <div class="dropdown__item dw-mod" onclick="HandlebarsBolt.UpdateContent('Product{{id}}', '{{link}}&feed=true&UnitID={{value}}&rid={{id}}')">{{name}}</div> 662 </script> 663 } 664 665 @helper RenderVariantTemplates() { 666 <script id="VariantsTemplate" type="text/x-template"> 667 {{#.}} 668 <div> 669 <div class="u-bold">{{name}}</div> 670 <div> 671 {{#VariantOptions}} 672 {{>VariantOption}} 673 {{/VariantOptions}} 674 </div> 675 </div> 676 {{/.}} 677 </script> 678 679 <script id="VariantOption" type="text/x-template"> 680 {{#if color}} 681 <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> 682 {{else}} 683 {{#if image}} 684 <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}}" /> 685 {{else}} 686 <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> 687 {{/if}} 688 {{/if}} 689 </script> 690 691 <script id="StaticVariantsTemplate" type="text/x-template"> 692 {{#.}} 693 {{#if isFirstGroup}} 694 <div> 695 {{#VariantOptions}} 696 {{>StaticVariantOption}} 697 {{/VariantOptions}} 698 </div> 699 {{/if}} 700 {{/.}} 701 </script> 702 703 <script id="StaticVariantOption" type="text/x-template"> 704 {{#if color}} 705 <div class="static-variant static-variant--color dw-mod" style="background-color: {{color}}" title="{{name}}"></div> 706 {{else}} 707 <div class="static-variant dw-mod">{{name}} </div> 708 {{/if}} 709 </script> 710 711 <script id="VariantOptionImage" type="text/x-template"> 712 <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}} /> 713 </script> 714 } 715 716 @helper RenderFavoritesTemplates() { 717 <script id="FavoriteTemplate" type="text/x-template"> 718 <div class="favorites-list u-ta-left"> 719 <label for="FavoriteTrigger_{{id}}" class="u-no-margin js-favorite-btn"><i class="{{favoriteIcon}} fa-1_5x"></i></label> 720 <input type="checkbox" id="FavoriteTrigger_{{id}}" class="dropdown-trigger" /> 721 <div class="dropdown dropdown--absolute-position"> 722 <div class="dropdown__content dropdown__content--show-left dropdown__content--padding u-w220px dw-mod"> 723 <ul class="list list--clean dw-mod"> 724 {{#FavoriteLists}} 725 {{>FavoriteListItem}} 726 {{/FavoriteLists}} 727 </ul> 728 </div> 729 <label class="dropdown-trigger-off" for="FavoriteTrigger_{{id}}"></label> 730 </div> 731 </div> 732 </script> 733 734 <script id="FavoriteListItem" type="text/x-template"> 735 <li> 736 <a href="{{link}}" class="list__link u-no-underline dw-mod" onclick="Scroll.SavePosition(event); {{facebookPixelAction}}"><i class="{{favoriteIcon}}"></i> {{name}}</a> 737 </li> 738 </script> 739 } 740 741 @helper RenderPreRenderTemplates() { 742 string facetsViewMode = !String.IsNullOrEmpty(Pageview.AreaSettings.GetItem("ProductList").GetString("FacetsViewMode")) ? Pageview.AreaSettings.GetItem("ProductList").GetString("FacetsViewMode").ToLower() : "left"; 743 744 <script id="ProductPreRenderContainer" type="text/x-template"> 745 @if (facetsViewMode == "left" && Pageview.Device.ToString() != "Mobile") 746 { 747 <div class="grid__col-3"> 748 <div class="pre-render-element pre-render-element--xs"></div> 749 <div class="pre-render-element pre-render-element--md"></div> 750 <div class="pre-render-element pre-render-element--md"></div> 751 <div class="pre-render-element pre-render-element--md"></div> 752 </div> 753 } 754 <div class="grid__col-auto"> 755 <div class="pre-render-element pre-render-element--xs"></div> 756 <div class="pre-render-element pre-render-element--lg"></div> 757 <div class="pre-render-element pre-render-element--lg"></div> 758 <div class="pre-render-element pre-render-element--lg"></div> 759 <div class="pre-render-element pre-render-element--lg"></div> 760 </div> 761 </script> 762 } 763 764 @helper RenderInitializers() { 765 <script> 766 document.addEventListener("DOMContentLoaded", function (event) { 767 document.getElementById("productList").addEventListener('contentLoaded', function (e) { 768 if (getTarget(e).id === "productList") { 769 Search.Init(); 770 Facets.Init("selectedFacets", "productList"); 771 } 772 }, false); 773 }); 774 </script> 775 } 776 777 @if (File.Exists(HttpContext.Current.Server.MapPath("/Files/Templates/Designs/Rapido/eCom/ProductList/Blocks/Custom__Blocks.cshtml"))) 778 { 779 <text>@inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 780 @using System 781 @using System.Web.UI 782 @using Dynamicweb.Ecommerce.Products; 783 784 @{ 785 BlocksPage customBlocksPage = BlocksPage.GetBlockPage("ProductList"); 786 BlocksPage masterBlocksPage = BlocksPage.GetBlockPage("Master"); 787 788 Block freeReturns = new Block 789 { 790 Id = "freeReturns", 791 SortId = 99, 792 Template = RenderFreeReturns() 793 }; 794 customBlocksPage.Add("PageContainer", freeReturns); 795 } 796 797 @helper RenderFreeReturns() 798 { 799 int optionsPageId = GetPageIdByNavigationTag("OptionsPage"); 800 int attachmentsPageId = GetPageIdByNavigationTag("AttachmentsPage"); 801 int documentsPageId = GetPageIdByNavigationTag("DocumentsPage"); 802 int cartPageId = GetPageIdByNavigationTag("CartPage"); 803 804 int currentPage = Convert.ToInt32(GetGlobalValue("Global:Page.ID")); 805 string nextPage = currentPage.ToString(); 806 807 string modelId = Dynamicweb.Context.Current.Request.QueryString["Model"]; 808 809 bool existingProduct = (Dynamicweb.Context.Current.Request.QueryString["Existing"] != null) ? Convert.ToBoolean(Dynamicweb.Context.Current.Request.QueryString["Existing"].ToString().ToLower()) : false; 810 811 string nextPageText = Translate("Continue"); 812 813 if (currentPage == attachmentsPageId) 814 { 815 if (!existingProduct) 816 { 817 if (Pageview.User == null) 818 { 819 nextPage = cartPageId.ToString() + "&Model=" + modelId + "&Existing=" + existingProduct; 820 nextPageText = Translate("Generate proposal - enduser"); 821 } 822 else 823 { 824 nextPage = documentsPageId.ToString() + "&Model=" + modelId + "&Existing=" + existingProduct; 825 nextPageText = Translate("Select documents"); 826 } 827 } 828 else 829 { 830 if (Pageview.User == null) 831 { 832 nextPage = cartPageId.ToString() + "&Model=" + modelId + "&Existing=" + existingProduct; 833 nextPageText = Translate("Generate proposal - enduser"); 834 } 835 else 836 { 837 nextPage = documentsPageId.ToString() + "&Model=" + modelId + "&Existing=" + existingProduct; 838 nextPageText = Translate("Select documents"); 839 } 840 } 841 } 842 843 if (currentPage == optionsPageId) 844 { 845 if (Pageview.User != null) 846 { 847 if (!existingProduct) 848 { 849 nextPage = attachmentsPageId.ToString() + "&Model=" + modelId + "&Existing=" + existingProduct; 850 nextPageText = Translate("Select tools"); 851 } 852 else 853 { 854 nextPage = documentsPageId.ToString() + "&Model=" + modelId + "&Existing=" + existingProduct; 855 nextPageText = Translate("Select documents"); 856 } 857 } 858 else 859 { 860 if (existingProduct != false) 861 { 862 nextPage = cartPageId.ToString() + "&Model=" + modelId + "&Existing=" + existingProduct; 863 nextPageText = Translate("Generate proposal - enduser"); 864 } 865 else 866 { 867 nextPage = attachmentsPageId.ToString() + "&Model=" + modelId + "&Existing=False"; 868 nextPageText = Translate("Select tools"); 869 } 870 } 871 } 872 if (currentPage == documentsPageId) 873 { 874 nextPage = cartPageId.ToString() + "&Model=" + modelId + "&Existing=" + existingProduct; 875 if (Pageview.User == null) 876 { 877 nextPageText = Translate("Generate proposal - enduser"); 878 } 879 else 880 { 881 nextPageText = Translate("Generate proposal - dealer"); 882 } 883 } 884 885 <div class="grid__col-lg-4"> 886 <div class="builder__cart"> 887 @{ 888 Product product = new ProductService().GetProductByNumber(modelId, true); 889 890 if (product != null) 891 { 892 <div class="grid__col-12"> 893 <h2 class="builder__header--fontsize-28 u-mb-0px">@product.Name</h2> 894 </div> 895 } 896 897 <div>&nbsp;</div> 898 <div id="egholmCart"></div> 899 <input value="@Translate("Cart_Remove", "Remove")" id="egholmCartRemoveTranslations" type="hidden"/> 900 @*KR 09222020*@ 901 <input value="@Translate("Total", "Total")" id="egholmCartTotalTranslations" type="hidden"/> 902 <input value="@Translate("Price without VAT", "Price without VAT")" id="egholmCartPriceWithoutVATTranslations" type="hidden"/> 903 @*\KR 09222020*@ 904 } 905 <div class="grid__col-12"></div> 906 <div class="grid__col-12"> 907 <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> 908 </div> 909 </div> 910 <div class="grid__col-12"> 911 @if ((currentPage == attachmentsPageId || currentPage == documentsPageId) && !existingProduct) 912 { 913 <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> 914 } 915 @if (currentPage == documentsPageId && !existingProduct) 916 { 917 <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> 918 } 919 <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> 920 921 <!-- 922 <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> 923 --> 924 925 </div> 926 </div> 927 }</text> 928 } 929 930 @if (productListNavigation.BlocksList.Count < 1) 931 { 932 productListNavigation.Design.RenderType = RenderType.Hide; 933 } 934 <input type="hidden" id="CartOrderlinesFeed" name="CartOrderlinesFeed" value="@GetPageIdByNavigationTag("CartOrderlinesFeed")"/> 935 <input type="hidden" id="CartOrderlinesFeedDOM" name="CartOrderlinesFeedDOM" value="@GetPageIdByNavigationTag("CartOrderlinesFeedDOM")"/> 936 <input type="hidden" id="OptionsPage" name="OptionsPage" value="@GetPageIdByNavigationTag("OptionsPage")"/> 937 <input type="hidden" id="AttachmentsPage" name="AttachmentsPage" value="@GetPageIdByNavigationTag("AttachmentsPage")" /> 938 <input type="hidden" id="PageID" name="PageID" value="@Pageview.Page.ID" /> 939 <input type="hidden" id="DomainUrl" name="DomainUrl" value="@HttpContext.Current.Request.Url.ToString().Substring(0, HttpContext.Current.Request.Url.ToString().IndexOf("/Default.aspx"))"/> 940 <input type="hidden" id="ConfiguratorPath" name="ConfiguratorPath" value="@Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(GetPageIdByNavigationTag("ConfiguratorPage"))"/> 941 <input type="hidden" id="alertTranslation" name="alertTranslation" value="@Translate("already_in_cart", "Already in the cart")"/> 942 <input type="hidden" id="emptyCartTranslation" name="emptyCartTranslation" value="@Translate("empty_configurator", "Your configurator is empty")"/> 943 <form name="multiForm" id="multiForm" method="post"> 944 <input type="hidden" name="CartCmd" id="attachmentCartCmd" value="addMulti"/> 945 @* The @RenderBlockList base helper is included in Components/GridBuilder.cshtml *@ 946 @RenderBlockList(productListPage.BlocksRoot.BlocksList) 947 </form> 948 949 @helper RenderPageContainer() 950 { 951 @RenderPageTop() 952 953 List<Block> subBlocks = this.productListPage.GetBlockListById("PageContainer").OrderBy(item => item.SortId).ToList(); 954 955 string pageUrl = GetGlobalValue("Global:Pageview.Url.Raw"); 956 string listId = HttpContext.Current.Request.QueryString.Get("ListID"); 957 bool isFavoriteList = !string.IsNullOrEmpty(listId); 958 string feedFullUrl = pageUrl + "&feed=true"; 959 feedFullUrl += !isFavoriteList ? "&DoNotShowVariantsAsSingleProducts=True" : ""; 960 string smallDeviceCss = Pageview.Device.ToString() == "Mobile" ? "" : ""; 961 962 <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> 963 964 <script id="ProductContainer" type="text/x-template"> 965 {{#each .}} 966 @RenderBlockList(subBlocks) 967 {{else}} 968 <div class="grid__col-12"> 969 <h2 class="u-ta-center">@Translate("Your search gave 0 results")</h2> 970 </div> 971 {{/each}} 972 </script> 973 } 974 975 @helper RenderPageTop() 976 { 977 string modelId = Dynamicweb.Context.Current.Request.QueryString["Model"]; 978 Product product = new ProductService().GetProductByNumber(modelId, true); 979 980 int attachmentsPageId = GetPageIdByNavigationTag("AttachmentsPage"); 981 int accessoriesPageId = GetPageIdByNavigationTag("OptionsPage"); 982 int documentsPageId = GetPageIdByNavigationTag("DocumentsPage"); 983 int currentPage = Convert.ToInt32(GetGlobalValue("Global:Page.ID")); 984 985 string heading = string.Empty; 986 string paragraph = string.Empty; 987 string clientString = string.Empty; 988 string paragraphText = string.Empty; 989 990 if (currentPage == attachmentsPageId) 991 { 992 paragraph = Translate("Now select your attachments for"); 993 } 994 if (currentPage == accessoriesPageId) 995 { 996 paragraph = Translate("Now select your accessories for"); 997 } 998 if (currentPage == documentsPageId) 999 { 1000 paragraph = Translate("Now select your documents for"); 1001 paragraphText = Translate("Document textarea"); 1002 } 1003 if (Pageview.User != null) 1004 { 1005 clientString = Translate(" for client"); 1006 } 1007 1008 <h2>@Translate("Building") @product.Name @clientString</h2> 1009 <h4>@paragraph @product.Name</h4> 1010 if (!String.IsNullOrEmpty(paragraphText)) 1011 { 1012 <p>@paragraphText</p> 1013 } 1014 } 1015 1016 @helper RenderProductList() 1017 { 1018 @*This is part of a script template *@ 1019 1020 List<Block> subBlocks = productListPage.GetBlockListById("ProductList").OrderBy(item => item.SortId).ToList(); 1021 1022 string pageId = GetGlobalValue("Global:Page.ID"); 1023 string pageUrl = GetGlobalValue("Global:Pageview.Url.Raw"); 1024 string listId = HttpContext.Current.Request.QueryString.Get("ListID"); 1025 bool isFavoriteList = !string.IsNullOrEmpty(listId); 1026 string feedFullUrl = pageUrl + "&feed=true"; 1027 feedFullUrl += !isFavoriteList ? "&DoNotShowVariantsAsSingleProducts=True" : ""; 1028 string smallDeviceCss = Pageview.Device.ToString() == "Mobile" ? "u-no-padding" : ""; 1029 1030 <div class="grid__col-lg-8 @smallDeviceCss u-no-padding"> 1031 @if (isFavoriteList) 1032 { 1033 string searchPlaceholder = Translate("Search favorite products", "Search favorite products"); 1034 string searchValue = HttpContext.Current.Request.QueryString.Get("Search") ?? ""; 1035 1036 <div class="grid__cell"> 1037 <div class="u-pull--left"> 1038 <h2 class="u-no-margin"><i class="{{headerIcon}}"></i>{{header}}</h2> 1039 </div> 1040 <div class="grid__col--bleed grid__col-6 u-pull--right"> 1041 <div class="u-margin-bottom"> 1042 <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"> 1043 <input type="text" class="typeahead-search-field u-no-margin u-full-width js-typeahead-search-field" placeholder="@searchPlaceholder" value="@searchValue"> 1044 <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> 1045 <button type="button" class="btn btn--condensed btn--primary u-no-margin dw-mod js-typeahead-enter-btn"> 1046 <i class="fas fa-search"></i> 1047 </button> 1048 </div> 1049 </div> 1050 </div> 1051 </div> 1052 } 1053 1054 <div class="grid__cell"> 1055 @RenderBlockList(subBlocks) 1056 </div> 1057 </div> 1058 } 1059 <div class="options-modal" id="options-modal" data-currentlocation="configurator"> 1060 <div class="options-modal-header"> 1061 <span id="options-modal-close" class="options-modal-close">&times;</span> 1062 <div class="options-modal-header-item-name"> 1063 Rotary/mulch mover 1200 1064 </div> 1065 <div class="options-modal-content"> 1066 <p class="text">@Translate("has_options_text", "This item has options - please specify your preferred configuration below.")</p> 1067 <div class="options-container"> 1068 <div class="grid"> 1069 <div class="grid__col-lg-6 grid__col-md-8 u-padding-0"> 1070 <div class="js-options-container"> 1071 1072 </div> 1073 <button class="btn btn--secondary options-modal-btn js-add-options" disabled onclick="configuratorAddPartsToCart(event)">@Translate("add_to_selection", "ADD TO SELECTION")</button> 1074 <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> 1075 </div> 1076 <div class="grid__col-lg-6 grid__col-md-4 u-padding-0"> 1077 <img class="js-options-modal-content-img" src=""/> 1078 </div> 1079 </div> 1080 </div> 1081 </div> 1082 </div> 1083 </div> 1084 1085 <script> 1086 var modal = document.getElementById("options-modal"); 1087 1088 var btn = document.getElementById("myBtn"); 1089 1090 var span = document.getElementsByClassName("options-modal-close")[0]; 1091 1092 span.onclick = function() { 1093 modal.style.display = "none"; 1094 $("html").css("overflow", "auto"); 1095 } 1096 1097 window.onclick = function(event) { 1098 if (event.target == modal) { 1099 modal.style.display = "none"; 1100 $("html").css("overflow", "auto"); 1101 } 1102 } 1103 </script>