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