Toilet Glass Door Lock "Clark", SS304-SSS Cover, Alu Body,
Código 14.60.655-0
Error executing template "Designs/Swift/Paragraph/Swift_ProductListFacets.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_0b3a927714104c78af2e38c972f5faca.ExecuteAsync() at RazorEngine.Templating.TemplateBase.Run(ExecuteContext context, TextWriter reader) at RazorEngine.Templating.RazorEngineCore.RunTemplate(ICompiledTemplate template, TextWriter writer, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.DynamicWrapperService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass23_0.<Run>b__0(TextWriter writer) at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter) at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, Type modelType, Object model, DynamicViewBag viewBag) at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template) at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template) at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> @using Dynamicweb.Ecommerce.ProductCatalog @using Dynamicweb.Frontend.Navigation @using Dynamicweb.Environment @using Dynamicweb.Core.Encoders @using System.Text.RegularExpressions @using System.Web @using Dynamicweb.Core @using System.Linq @{ ProductListViewModel productList = new ProductListViewModel(); if (Dynamicweb.Context.Current.Items.Contains("ProductList")) { productList = (ProductListViewModel)Dynamicweb.Context.Current.Items["ProductList"]; } string url = Pageview.SearchFriendlyUrl; url = url.LastIndexOf("?") != -1 ? url.Substring(0, url.LastIndexOf("?")) : url; string groupId = string.Empty; //Fix for non-friendly urls if (Dynamicweb.Context.Current.Request.QueryString.Get("GroupID") != null) { groupId = Dynamicweb.Context.Current.Request.QueryString.Get("GroupID"); url += "?GroupID=" + groupId; } if (!url.Contains("LayoutTemplate")) { url += url.Contains("?") ? "&LayoutTemplate=Designs/Swift/Swift_PageClean.cshtml" : "?LayoutTemplate=Designs/Swift/Swift_PageClean.cshtml"; } bool facetsFound = false; int selectedFacetsCount = 0; if (productList.FacetGroups != null) { foreach (FacetGroupViewModel facetGroup in productList.FacetGroups) { foreach (FacetViewModel facet in facetGroup.Facets) { if (facet.Options.Count() > 0) { facetsFound = true; foreach (FacetOptionViewModel option in facet.Options) { if (option.Selected) { selectedFacetsCount++; } } } } } } bool enableSorting = Model.Item.GetBoolean("SortByNameAZ"); enableSorting = Model.Item.GetBoolean("SortByNameZA") || enableSorting == true ? true : false; enableSorting = Model.Item.GetBoolean("SortByNewest") || enableSorting == true ? true : false; enableSorting = Model.Item.GetBoolean("SortByLowestPrice") || enableSorting == true ? true : false; enableSorting = Model.Item.GetBoolean("SortByHighestPrice") || enableSorting == true ? true : false; string contentPadding = Model.Item.GetRawValueString("ContentPadding", string.Empty); contentPadding = contentPadding == "none" ? " px-0 py-2" : contentPadding; contentPadding = contentPadding == "small" ? " p-3" : contentPadding; string layout = Model.Item.GetRawValueString("Layout", "vertical"); var formFieldsParms = new Dictionary<string, object>(); formFieldsParms.Add("DeviceType", "desktop"); } @if (productList.TotalProductsCount > 0 && (facetsFound || Model.Item.GetBoolean("EnableGroupNavigation") || enableSorting)) { string theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? " theme " + Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : string.Empty; string modalTheme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("ModalTheme")) ? " theme " + Model.Item.GetRawValueString("ModalTheme").Replace(" ", "").Trim().ToLower() : string.Empty; string iconPath = "/Files/Templates/Designs/Swift/Assets/icons/"; string selectedFacetsLabel = selectedFacetsCount > 0 ? "(" + selectedFacetsCount + ")" : string.Empty; string formContainerCss = layout == "horizontal" ? $"d-lg-flex gap-3 flex-row flex-wrap {theme}" : $"d-lg-block h-100 {theme}"; //Desktop if (layout == "horizontal") { contentPadding = contentPadding == "small" ? " p-3" : contentPadding; @:<div class="@theme @contentPadding h-100"> } <form method="post" action="@url" data-response-target-element="content" id="FacetsForm_Desktop_@Model.ID" class="d-none @formContainerCss item_@Model.Item.SystemName.ToLower()"> @RenderPartial("Paragraph/ProductListFacets/FormFields.cshtml", Model, formFieldsParms) @if (layout == "horizontal" && selectedFacetsCount > 0) { <button type="button" class="btn btn-sm me-sm-1 me-lg-2" onclick="swift.ProductList.ResetFacets(event)"><span class="icon-2">@ReadFile(iconPath + "rotate-ccw.svg")</span> @Translate("Clear filters")</button> } </form> if (layout == "vertical") { <script> function lastOpened (e){ if (e.classList.contains('collapsed')){ setCookie("LastOpenedFacet", 0, 0); } else { setCookie("LastOpenedFacet", e.innerText, 10); } } function setCookie(name, value, maxAgeSeconds) { var maxAgeSegment = "; max-age=" + maxAgeSeconds; document.cookie = encodeURI(name) + "=" + encodeURI(value) + maxAgeSegment; } window.onscroll = function() {fixedFacets(facetsTopPosOriginal)}; let facetsTopPosOriginal = document.getElementById("FacetsForm_Desktop_@Model.ID").getBoundingClientRect().top; function fixedFacets(facetsTopPosOriginal){ let scrollPosition = window.pageYOffset; let headerBottomPos = document.getElementsByClassName("page-header")[0].getBoundingClientRect().bottom; let footerTopPos = document.getElementsByClassName("page-footer")[0].getBoundingClientRect().top; let facetsTop = document.getElementById("FacetsForm_Desktop_@Model.ID"); let facetsTopPos = facetsTop.getBoundingClientRect().top; let facetsBottomPos = facetsTop.getBoundingClientRect().bottom; let facetsTopParent = facetsTop.parentElement; let horizontalFacets; let horizontalFacetsParent; if (document.getElementsByClassName("sticky-facets-horizontal").length > 0 ){ horizontalFacets = document.getElementsByClassName("sticky-facets-horizontal")[0]; horizontalFacetsParent = document.getElementsByClassName("sticky-facets-horizontal")[0].parentElement; } else { horizontalFacets = document.getElementsByClassName("sticky-facets-horizontal-mobile")[0].parentElement; horizontalFacetsParent = horizontalFacets.parentElement; horizontalFacets.classList.add("sticky-mobile"); } if (facetsTopPosOriginal < scrollPosition + headerBottomPos ) { facetsTop.classList.add("sticky"); facetsTop.style.cssText = '--bs-columns:12; --sticky-top:' + headerBottomPos + 'px; width:' + facetsTopParent.offsetWidth + 'px'; horizontalFacets.classList.add("sticky"); //horizontalFacets.style.cssText = '--sticky-top:' + headerBottomPos + 'px; width:' + horizontalFacetsParent.offsetWidth + 'px'; horizontalFacetsParent.style.setProperty('--sticky-top', headerBottomPos + 'px'); horizontalFacets.style.cssText = 'width:' + horizontalFacetsParent.offsetWidth + 'px'; } else { facetsTop.classList.remove("sticky"); horizontalFacets.classList.remove("sticky"); } } </script> } if (layout == "horizontal") { @:</div> } bool showFiltersForThisGroup = false; groupId = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString.Get("GroupID")) ? Dynamicweb.Context.Current.Request.QueryString.Get("GroupID") : ""; if (!string.IsNullOrEmpty(groupId)){ var group = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(groupId); foreach (var customfield in group.ProductGroupFieldValues) { if (customfield.ProductGroupField.SystemName == "ShowProductFilters"){ if (customfield.Value.ToString() == "True"){ showFiltersForThisGroup = true; } } } } if (showFiltersForThisGroup){ //Mobile <div class="d-block mt-lg-0 @(contentPadding)@(theme) sticky-facets-horizontal-mobile FacetsForm_Mobile_@Model.Item.SystemName.ToLower()_@Model.ID"> <button type="button" class="btn btn-primary w-100 d-lg-none" data-bs-toggle="modal" data-bs-target="#FacetsModal"> <span class="d-flex align-items-center"> <span class="flex-grow-1 text-start"> @Translate("Filter") @selectedFacetsLabel </span> <span class="icon-2"> @ReadFile(iconPath + "sliders.svg") </span> </span> </button> <form method="post" action="@url" data-response-target-element="content" class="modal" id="FacetsModal" tabindex="-1" aria-hidden="false"> <div class="modal-dialog modal-fullscreen"> <div class="modal-content"> <div class="modal-header@(modalTheme)"> <h5 class="modal-title">@Translate("Filters and sorting")</h5> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" onclick="document.querySelector('body').style = ''"></button> </div> <div class="modal-body@(modalTheme)"> @{ formFieldsParms["DeviceType"] = "mobile"; } @RenderPartial("Paragraph/ProductListFacets/FormFields.cshtml", Model, formFieldsParms) </div> <div class="modal-footer d-flex@(modalTheme)"> @if (selectedFacetsCount != 0) { <button type="button" class="btn btn-secondary flex-fill" onclick="swift.ProductList.ResetFacets(event)">@Translate("Clear") (@selectedFacetsCount)</button> } <button type="button" class="btn btn-primary flex-fill" onclick="location.reload();">@Translate("Update")</button> </div> </div> </div> </form> </div> } } else { if (Pageview.IsVisualEditorMode) { <div class="alert alert-dark m-0" role="alert"> <span>@Translate("Facets: The facets selectors will be shown here, if any")</span> </div> } else if (productList.TotalProductsCount > 0) { @*<div class="alert alert-dark m-0" id="NoFiltersAlert_@Model.ID"> @Translate("No filters are available") </div>*@ } }
Error executing template "Designs/Swift/Paragraph/Swift_ProductListFacets.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_0b3a927714104c78af2e38c972f5faca.ExecuteAsync() at RazorEngine.Templating.TemplateBase.Run(ExecuteContext context, TextWriter reader) at RazorEngine.Templating.RazorEngineCore.RunTemplate(ICompiledTemplate template, TextWriter writer, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.DynamicWrapperService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass23_0.<Run>b__0(TextWriter writer) at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter) at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, Type modelType, Object model, DynamicViewBag viewBag) at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template) at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template) at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> @using Dynamicweb.Ecommerce.ProductCatalog @using Dynamicweb.Frontend.Navigation @using Dynamicweb.Environment @using Dynamicweb.Core.Encoders @using System.Text.RegularExpressions @using System.Web @using Dynamicweb.Core @using System.Linq @{ ProductListViewModel productList = new ProductListViewModel(); if (Dynamicweb.Context.Current.Items.Contains("ProductList")) { productList = (ProductListViewModel)Dynamicweb.Context.Current.Items["ProductList"]; } string url = Pageview.SearchFriendlyUrl; url = url.LastIndexOf("?") != -1 ? url.Substring(0, url.LastIndexOf("?")) : url; string groupId = string.Empty; //Fix for non-friendly urls if (Dynamicweb.Context.Current.Request.QueryString.Get("GroupID") != null) { groupId = Dynamicweb.Context.Current.Request.QueryString.Get("GroupID"); url += "?GroupID=" + groupId; } if (!url.Contains("LayoutTemplate")) { url += url.Contains("?") ? "&LayoutTemplate=Designs/Swift/Swift_PageClean.cshtml" : "?LayoutTemplate=Designs/Swift/Swift_PageClean.cshtml"; } bool facetsFound = false; int selectedFacetsCount = 0; if (productList.FacetGroups != null) { foreach (FacetGroupViewModel facetGroup in productList.FacetGroups) { foreach (FacetViewModel facet in facetGroup.Facets) { if (facet.Options.Count() > 0) { facetsFound = true; foreach (FacetOptionViewModel option in facet.Options) { if (option.Selected) { selectedFacetsCount++; } } } } } } bool enableSorting = Model.Item.GetBoolean("SortByNameAZ"); enableSorting = Model.Item.GetBoolean("SortByNameZA") || enableSorting == true ? true : false; enableSorting = Model.Item.GetBoolean("SortByNewest") || enableSorting == true ? true : false; enableSorting = Model.Item.GetBoolean("SortByLowestPrice") || enableSorting == true ? true : false; enableSorting = Model.Item.GetBoolean("SortByHighestPrice") || enableSorting == true ? true : false; string contentPadding = Model.Item.GetRawValueString("ContentPadding", string.Empty); contentPadding = contentPadding == "none" ? " px-0 py-2" : contentPadding; contentPadding = contentPadding == "small" ? " p-3" : contentPadding; string layout = Model.Item.GetRawValueString("Layout", "vertical"); var formFieldsParms = new Dictionary<string, object>(); formFieldsParms.Add("DeviceType", "desktop"); } @if (productList.TotalProductsCount > 0 && (facetsFound || Model.Item.GetBoolean("EnableGroupNavigation") || enableSorting)) { string theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? " theme " + Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : string.Empty; string modalTheme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("ModalTheme")) ? " theme " + Model.Item.GetRawValueString("ModalTheme").Replace(" ", "").Trim().ToLower() : string.Empty; string iconPath = "/Files/Templates/Designs/Swift/Assets/icons/"; string selectedFacetsLabel = selectedFacetsCount > 0 ? "(" + selectedFacetsCount + ")" : string.Empty; string formContainerCss = layout == "horizontal" ? $"d-lg-flex gap-3 flex-row flex-wrap {theme}" : $"d-lg-block h-100 {theme}"; //Desktop if (layout == "horizontal") { contentPadding = contentPadding == "small" ? " p-3" : contentPadding; @:<div class="@theme @contentPadding h-100"> } <form method="post" action="@url" data-response-target-element="content" id="FacetsForm_Desktop_@Model.ID" class="d-none @formContainerCss item_@Model.Item.SystemName.ToLower()"> @RenderPartial("Paragraph/ProductListFacets/FormFields.cshtml", Model, formFieldsParms) @if (layout == "horizontal" && selectedFacetsCount > 0) { <button type="button" class="btn btn-sm me-sm-1 me-lg-2" onclick="swift.ProductList.ResetFacets(event)"><span class="icon-2">@ReadFile(iconPath + "rotate-ccw.svg")</span> @Translate("Clear filters")</button> } </form> if (layout == "vertical") { <script> function lastOpened (e){ if (e.classList.contains('collapsed')){ setCookie("LastOpenedFacet", 0, 0); } else { setCookie("LastOpenedFacet", e.innerText, 10); } } function setCookie(name, value, maxAgeSeconds) { var maxAgeSegment = "; max-age=" + maxAgeSeconds; document.cookie = encodeURI(name) + "=" + encodeURI(value) + maxAgeSegment; } window.onscroll = function() {fixedFacets(facetsTopPosOriginal)}; let facetsTopPosOriginal = document.getElementById("FacetsForm_Desktop_@Model.ID").getBoundingClientRect().top; function fixedFacets(facetsTopPosOriginal){ let scrollPosition = window.pageYOffset; let headerBottomPos = document.getElementsByClassName("page-header")[0].getBoundingClientRect().bottom; let footerTopPos = document.getElementsByClassName("page-footer")[0].getBoundingClientRect().top; let facetsTop = document.getElementById("FacetsForm_Desktop_@Model.ID"); let facetsTopPos = facetsTop.getBoundingClientRect().top; let facetsBottomPos = facetsTop.getBoundingClientRect().bottom; let facetsTopParent = facetsTop.parentElement; let horizontalFacets; let horizontalFacetsParent; if (document.getElementsByClassName("sticky-facets-horizontal").length > 0 ){ horizontalFacets = document.getElementsByClassName("sticky-facets-horizontal")[0]; horizontalFacetsParent = document.getElementsByClassName("sticky-facets-horizontal")[0].parentElement; } else { horizontalFacets = document.getElementsByClassName("sticky-facets-horizontal-mobile")[0].parentElement; horizontalFacetsParent = horizontalFacets.parentElement; horizontalFacets.classList.add("sticky-mobile"); } if (facetsTopPosOriginal < scrollPosition + headerBottomPos ) { facetsTop.classList.add("sticky"); facetsTop.style.cssText = '--bs-columns:12; --sticky-top:' + headerBottomPos + 'px; width:' + facetsTopParent.offsetWidth + 'px'; horizontalFacets.classList.add("sticky"); //horizontalFacets.style.cssText = '--sticky-top:' + headerBottomPos + 'px; width:' + horizontalFacetsParent.offsetWidth + 'px'; horizontalFacetsParent.style.setProperty('--sticky-top', headerBottomPos + 'px'); horizontalFacets.style.cssText = 'width:' + horizontalFacetsParent.offsetWidth + 'px'; } else { facetsTop.classList.remove("sticky"); horizontalFacets.classList.remove("sticky"); } } </script> } if (layout == "horizontal") { @:</div> } bool showFiltersForThisGroup = false; groupId = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString.Get("GroupID")) ? Dynamicweb.Context.Current.Request.QueryString.Get("GroupID") : ""; if (!string.IsNullOrEmpty(groupId)){ var group = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(groupId); foreach (var customfield in group.ProductGroupFieldValues) { if (customfield.ProductGroupField.SystemName == "ShowProductFilters"){ if (customfield.Value.ToString() == "True"){ showFiltersForThisGroup = true; } } } } if (showFiltersForThisGroup){ //Mobile <div class="d-block mt-lg-0 @(contentPadding)@(theme) sticky-facets-horizontal-mobile FacetsForm_Mobile_@Model.Item.SystemName.ToLower()_@Model.ID"> <button type="button" class="btn btn-primary w-100 d-lg-none" data-bs-toggle="modal" data-bs-target="#FacetsModal"> <span class="d-flex align-items-center"> <span class="flex-grow-1 text-start"> @Translate("Filter") @selectedFacetsLabel </span> <span class="icon-2"> @ReadFile(iconPath + "sliders.svg") </span> </span> </button> <form method="post" action="@url" data-response-target-element="content" class="modal" id="FacetsModal" tabindex="-1" aria-hidden="false"> <div class="modal-dialog modal-fullscreen"> <div class="modal-content"> <div class="modal-header@(modalTheme)"> <h5 class="modal-title">@Translate("Filters and sorting")</h5> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" onclick="document.querySelector('body').style = ''"></button> </div> <div class="modal-body@(modalTheme)"> @{ formFieldsParms["DeviceType"] = "mobile"; } @RenderPartial("Paragraph/ProductListFacets/FormFields.cshtml", Model, formFieldsParms) </div> <div class="modal-footer d-flex@(modalTheme)"> @if (selectedFacetsCount != 0) { <button type="button" class="btn btn-secondary flex-fill" onclick="swift.ProductList.ResetFacets(event)">@Translate("Clear") (@selectedFacetsCount)</button> } <button type="button" class="btn btn-primary flex-fill" onclick="location.reload();">@Translate("Update")</button> </div> </div> </div> </form> </div> } } else { if (Pageview.IsVisualEditorMode) { <div class="alert alert-dark m-0" role="alert"> <span>@Translate("Facets: The facets selectors will be shown here, if any")</span> </div> } else if (productList.TotalProductsCount > 0) { @*<div class="alert alert-dark m-0" id="NoFiltersAlert_@Model.ID"> @Translate("No filters are available") </div>*@ } }