Brilleetuier & opbevaring | Stadsing A/S

Logo
Exception in template (Designs\StandardWebshop\eCom/Productlist/ProductList.cshtml): System.NullReferenceException: Object reference not set to an instance of an object.
   at Dynamicweb.eCommerce.Products.Group.get_AllGroupsByLanguageID(String languageID) in E:\Program Files (x86)\Jenkins\jobs\Release DW881\workspace\Dynamicweb\eCommerce\Products\Group.vb:line 2315
   at Dynamicweb.eCommerce.Products.Group.get_Subgroups() in E:\Program Files (x86)\Jenkins\jobs\Release DW881\workspace\Dynamicweb\eCommerce\Products\Group.vb:line 1045
   at Dynamicweb.Frontend.NavigationProviders.GroupNavigationProvider._Closure$__338._Lambda$__1350(GroupCollection items, Int32 thisLevel) in E:\Program Files (x86)\Jenkins\jobs\Release DW881\workspace\Dynamicweb\Frontend\NavigationProviders\GroupNavigationProvider.vb:line 634
   at Dynamicweb.Frontend.NavigationProviders.GroupNavigationProvider._Closure$__338._Lambda$__1350(GroupCollection items, Int32 thisLevel) in E:\Program Files (x86)\Jenkins\jobs\Release DW881\workspace\Dynamicweb\Frontend\NavigationProviders\GroupNavigationProvider.vb:line 634
   at Dynamicweb.Frontend.NavigationProviders.GroupNavigationProvider._Closure$__338._Lambda$__1350(GroupCollection items, Int32 thisLevel) in E:\Program Files (x86)\Jenkins\jobs\Release DW881\workspace\Dynamicweb\Frontend\NavigationProviders\GroupNavigationProvider.vb:line 634
   at Dynamicweb.Frontend.NavigationProviders.GroupNavigationProvider._Closure$__338._Lambda$__1350(GroupCollection items, Int32 thisLevel) in E:\Program Files (x86)\Jenkins\jobs\Release DW881\workspace\Dynamicweb\Frontend\NavigationProviders\GroupNavigationProvider.vb:line 634
   at Dynamicweb.Frontend.NavigationProviders.GroupNavigationProvider.BuildGroupsProductCounts(GroupCollection topGroups, Int32 level, Int32 maxLevel) in E:\Program Files (x86)\Jenkins\jobs\Release DW881\workspace\Dynamicweb\Frontend\NavigationProviders\GroupNavigationProvider.vb:line 637
   at Dynamicweb.Frontend.NavigationProviders.GroupNavigationProvider.MakeGroupTree(Page page, NavigationItem parentNode, Boolean applyStartAndEndLevelToNavigation) in E:\Program Files (x86)\Jenkins\jobs\Release DW881\workspace\Dynamicweb\Frontend\NavigationProviders\GroupNavigationProvider.vb:line 287
   at Dynamicweb.Frontend.NavigationProviders.GroupNavigationProvider.Process(NavigationItem node, Boolean applyStartAndEndLevelToNavigation) in E:\Program Files (x86)\Jenkins\jobs\Release DW881\workspace\Dynamicweb\Frontend\NavigationProviders\GroupNavigationProvider.vb:line 267
   at Dynamicweb.Frontend.NavigationProviders.GroupNavigationProvider.ProcessTree(RootNavigationItem rootNode, NavigationType navigationType) in E:\Program Files (x86)\Jenkins\jobs\Release DW881\workspace\Dynamicweb\Frontend\NavigationProviders\GroupNavigationProvider.vb:line 218
   at Dynamicweb.Frontend.XmlNavigation.XML(Int32 ParentID, Int32 StartLevel, Int32 StopLevel, Expand expand, Int32 areaID) in E:\Program Files (x86)\Jenkins\jobs\Release DW881\workspace\Dynamicweb\Frontend\XmlNavigation.vb:line 548
   at Dynamicweb.Frontend.XmlNavigation.GetNavigationHtml(Int32 ParentID, Int32 StartLevel, Int32 StopLevel, Expand ExpandMode, String NavigationName, String XsltPath, Int32 AreaID, Boolean SitemapMode, NameValueCollection settings, NameValueCollection attributes, IncludeMode mode) in E:\Program Files (x86)\Jenkins\jobs\Release DW881\workspace\Dynamicweb\Frontend\XmlNavigation.vb:line 1096
   at Dynamicweb.Frontend.XmlNavigation.GetNavigationHtml(NameValueCollection settings, NameValueCollection attributes) in E:\Program Files (x86)\Jenkins\jobs\Release DW881\workspace\Dynamicweb\Frontend\XmlNavigation.vb:line 1214
   at CompiledRazorTemplates.Dynamic.baddefadadbba.Execute()
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context)
   at RazorEngine.Razor.Parse[T](String razorTemplate, T model, String cacheName)
   at Dynamicweb.Rendering.Template.Output() in E:\Program Files (x86)\Jenkins\jobs\Release DW881\workspace\Dynamicweb\Rendering\Template.vb:line 777
@using System.Web @using NORRIQ.Universal.Extensions @using NORRIQ.Common8.Context @using System.Web.Mvc.Html @using Dynamicweb.NewsLetterV3 @using Newtonsoft.Json @using NORRIQ.Common8.Ecom @using NORRIQ.Common8.Factory @using StandardWebshop.CustomCode.Razor @using NORRIQ.Common8.Razor; @using Dynamicweb.eCommerce.Common; @using NLWI.Platforms.Dynamicweb8.Specs; @using NORRIQ.FavoriteList.Models @using NORRIQ.FavoriteList.Services @using StandardWebshop.CustomCode.SupplementalUnit @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @{ var Columns = "col-xs-6 col-sm-4 col-md-4"; var mode = ObjectFactory.GetInstance<TemporarilySettings>().GetAndUpdate("listmode") ?? "" + ObjectFactory.GetInstance<AreaItemSettings>().GetCurrentAreaValue<string>("ProductlistMode") + ""; var SortBy = GetString("Ecom:ProductList.SortBy"); var SortOrder = GetString("Ecom:ProductList.SortOrder"); var ProductCurrency = Context.Currency.Symbol; var XPIData = ObjectFactory.GetInstance<NORRIQ.Common8.Context.AreaItemSettings>().GetCurrentAreaValue<string>("XPIData"); var query = HttpContext.Current.Request["EcomQuery"]; var AddNoIndex = !string.IsNullOrEmpty(HttpContext.Current.Request["PageNum"]); var isFavoriteList = (System.Web.HttpContext.Current.Request["favoriteMode"] ?? string.Empty).Equals("true", StringComparison.InvariantCultureIgnoreCase); } @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @helper RenderProductListTableFavorite(Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>>.LoopItem product) { var availableFavoriteLists = (List<NORRIQ.FavoriteList.Models.FavoriteItemList>)product.GetValue("NIQ:FavoriteListsAvailable"); var favoriteListsWithProduct = (List<NORRIQ.FavoriteList.Models.FavoriteItemList>)product.GetValue("NIQ:FavoritListsWithProduct"); var isFavorite = favoriteListsWithProduct.Any(); var listId = availableFavoriteLists.Any() ? availableFavoriteLists.First().Id : 0; <a href="javascript:void(0)" class="productlist-list-favorite js-favorite-toggle" data-favorite-list-id="@listId" data-is-favorite="@(isFavorite ? "true" : "false")" data-product-id="@(product.GetString("Ecom:Product.ID"))" data-product-language-id="@(product.GetString("Ecom:Product.LanguageID"))" data-product-variant-id="@(product.GetString("Ecom:Product.VariantID"))"> @if (isFavorite) { <i class="icon-favorite-added" aria-hidden="true"></i> <span class="productlist-list-label sr-only">@Translate("Remove favorite", "Remove favorite")</span> } else { <i class="icon-favorite" aria-hidden="true"></i> <span class="productlist-list-label sr-only">@Translate("Make favorite", "Make favorite")</span> } </a> } @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @helper RenderStockInformations(Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>>.LoopItem product, bool disableStock = false) { var stock = product.GetDouble("Ecom:Product.Stock"); var isStykliste = product.GetBoolean("Ecom:Product:Field.Stykliste.Value"); @*<p>disable stock: @disableStock</p>*@ if (disableStock) { <i class="icon-stock icon-red" title="@Translate("label_out__of_stock", "Udgået")"></i> <span class="stock-label-text">@Translate("label_out__of_stock", "udgået")</span> } else if (stock < 1 && !isStykliste) { <i class="icon-stock icon-yellow" title="@Translate("label_in_stock_in_x_days", "Forventes på lager indenfor 4 dage.")"></i> <span class="stock-label-text">@Translate("label_in_stock_in_x_days_short", "Ikke på lager")</span> } else { <i class="icon-stock icon-green" title="@stock"></i> <span class="stock-label-text">@Translate("label_in_stock", "In stock")</span> } } @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @helper RenderProductLabels(bool isTilbud ,bool isVolumePriceDiscount, bool discountedCompletely, bool discountedTemporary) { bool isSubstituteProduct = discountedCompletely || discountedTemporary; <div class="label-wrap"> @if (!isSubstituteProduct) { <span class="pricing js-hide-before"> <span class="labl spar"> @Translate("Spar") <span class="async-price-discount"></span> </span> @*<br> //AG but why?*@ </span> if (isVolumePriceDiscount) { <span class="labl tilbud">@Translate("Label_VolumenPrisTilbud", "Volumen rabat")</span> } else if (isTilbud) { <span class="labl tilbud">@Translate("Tilbud")</span> } } else { if (discountedCompletely) { <span class="labl discontinued">@Translate("erstatningsvare_udgaaet", "Udgået vare")</span> } else if (discountedTemporary) { <span class="labl temporarily">@Translate("erstatningsvare_temporarily", "Midlertidigt udgået")</span> } } </div> } @if (AddNoIndex) { @SnippetStart("AddNoIndex") <meta name="robots" content="noindex" /> @SnippetEnd("AddNoIndex") } <aside class="col-xs-12 col-sm-12 col-md-3" data-content="sidebar" id="desktopSidebar"> @using System.Web @using NORRIQ.Universal.Extensions @using NORRIQ.Common8.Context @using System.Web.Mvc.Html @using Dynamicweb.NewsLetterV3 @using Newtonsoft.Json @using NORRIQ.Common8.Ecom @using NORRIQ.Common8.Factory @using NORRIQ.FavoriteList.Models @using NORRIQ.FavoriteList.Services @using StandardWebshop.CustomCode.Razor @using NORRIQ.Common8.Razor; @using Dynamicweb.eCommerce.Common; @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> <div class="panel-group" id="filterTabs" role="tablist" aria-multiselectable="true"> <ul class="filter-tabs"> @if (HttpContext.Current.Request["groupid"] != null || GetGlobalValue("Global:Page.NavigationTag").Contains("ecom")) { <li class="filter-tabs-item" role="tab" id="headingSubmenu"> <a class="collapsed" role="button" data-toggle="collapse" data-parent="#filterTabs" data-target="#collapseSubmenu" aria-expanded="false" aria-controls="collapseSubmenu"> <i class="icon-hamburger" aria-hidden="true"></i> @Translate("Categories", "Categories") </a> </li> } @if (GetLoop("FacetGroups").Any()) { <li class="filter-tabs-item" role="tab" id="headingFilter"> <a class="collapsed" role="button" data-toggle="collapse" data-parent="#filterTabs" data-target="#collapseFilter" aria-expanded="false" aria-controls="collapseFilter"> <i class="icon-filter" aria-hidden="true"></i> @Translate("Filter", "Filter") </a> </li> } </ul> <div class="clearfix"></div> @if (HttpContext.Current.Request["groupid"] != null || GetGlobalValue("Global:Page.NavigationTag").Contains("ecom")) { <div class="panel"> <div id="collapseSubmenu" class="filter-collapse collapse" role="tabpanel" aria-labelledby="headingSubmenu"> @if (HttpContext.Current.Request["groupid"] != null) { @RenderNavigation(new { Template = "submenu-ecom-inpath.xslt", Expandmode = "all", StartLevel = 1, EndLevel = 2 }) } else { @RenderNavigation(new { Template = "submenu-ecom.xslt", Expandmode = "all", StartLevel = 1, EndLevel = 3 }) } </div> </div> } @if (GetLoop("FacetGroups").Any()) { <div class="panel"> <div id="collapseFilter" class="filter-collapse collapse" role="tabpanel" aria-labelledby="headingFilter"> @*<form id="filter-form" method="get" action="/Default.aspx"> <input type='hidden' name='ID' value='@Pageview.Page.ID' /> @if (HttpContext.Current.Request["ecomquery"] != null) { <input type="hidden" name="ecomquery" value="@HttpContext.Current.Request["ecomquery"]" /> } @foreach (LoopItem groups in GetLoop("FacetGroups")) { if (groups.GetLoop("Facets").Any()) { foreach (LoopItem facets in groups.GetLoop("Facets")) { if (facets.GetLoop("FacetOptions").Any()) { <div class="filter-group" id="@facets.GetString("Facet.QueryParameter")" name="@facets.GetString("Facet.QueryParameter")" data-filter-type="option"> <div class="filter-group-header"> <i class="icon-spinner icon-pulse" aria-hidden="true" style="display: none;"></i> @facets.GetString("Facet.Name") </div> <ul class="filter-group-list"> @foreach (LoopItem option in facets.GetLoop("FacetOptions")) { <li class="filter-group-item"> <div class="checkbox"> <label> <input type="checkbox" id="@facets.GetString("Facet.QueryParameter")@option.GetString("FacetOptions.LoopCounter")" name="@facets.GetString("Facet.QueryParameter")" value="@option.GetString("FacetOption.Value")" @(option.GetBoolean("FacetOption.Selected") ? " checked=\"checked\" " : "") /> @option.GetString("FacetOption.Label") (@option.GetString("FacetOption.Count")) </label> </div> </li> } </ul> </div> } } } } </form> <script append="true"> require(['jquery', 'shared/norriq.searchfilter/norriq.searchfilter'], function ($, Filter) { var filter = new Filter(); filter.init({ $filterForm: $('#filter-form'), $filterGroups: $('.filter-group, .js-select-filter'), $filterSlider: $('.filter-slider'), $selectedFilters: $('.filter-active-option') }); }); </script>*@ </div> </div> } </div> </aside> <section class="col-xs-12 col-sm-12 col-md-9 js-product-list"> @using NORRIQ.Common8.Razor @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @{ var PageID = (String.IsNullOrEmpty(GetString("Ecom:ProductList:Page.ID")) ? "" : "/Default.aspx?ID=" + GetString("Ecom:ProductList:Page.ID")); var GroupID = (String.IsNullOrEmpty(GetString("Ecom:ProductList:Page.GroupID")) ? "" : "&amp;GroupID=" + GetString("Ecom:ProductList:Page.GroupID")); var pdfgroupid = System.Web.HttpContext.Current.Request.QueryString["groupid"]; var pdfgroupname = GetString("Ecom:Group.Name"); var pdfLink = ""; var pageURL = System.Web.HttpContext.Current.Request.Url.PathAndQuery.ToString().Split('&').Last(); var navigationTag = GetGlobalValue("Global:Page.NavigationTag"); } @if (!String.IsNullOrEmpty(pdfgroupid)) { pdfLink = Navigation.GetUrlByNavigationTag("productlistsheet") + "?GroupID=" + pdfgroupid + "&amp;PDF=true&amp;Filename=" + pdfgroupid + ".pdf"; } else if (String.IsNullOrEmpty(pdfgroupid) && pageURL.Contains("favoriteMode")) { pdfLink = Navigation.GetUrlByNavigationTag("customerprintlist") + "?" + pageURL + "&amp;PDF=true&amp;Filename=" + Translate("Favoritliste", "Favoritliste") + ".pdf"; } else if (String.IsNullOrEmpty(pdfgroupid) && pageURL.Contains("reorder")) { pdfLink = Navigation.GetUrlByNavigationTag("customerprintlist") + "?" + pageURL + "&amp;PDF=true&amp;Filename=" + Translate("Genbestillingsliste", "Genbestillingsliste") + ".pdf"; } <header class="productlist-header clearfix"> <div class="row"> <div class="@(isFavoriteList ? "col-sm-8" : "col-sm-10")"> <h1 class="title-styled"> @if (!String.IsNullOrEmpty(GetString("Ecom:Group.Name"))) { @GetString("Ecom:Group.Name") } else { @GetGlobalValue("Global:Page.Name") } @if (!String.IsNullOrEmpty(GetString("Ecom:ProductList:Search.Query"))) { <small> (@GetString("Ecom:ProductList:Search.Query")) </small> } </h1> </div> <div class="@(isFavoriteList ? "col-sm-4" : "col-sm-2") text-right print-links"> @if (!String.IsNullOrEmpty(pdfgroupid) || !String.IsNullOrEmpty(pageURL)) { if (isFavoriteList) { <div class="reinvoice-wrap"> @using NORRIQ.Common8.Factory @using StandardWebshop.CustomCode.Basket.Services @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @{ bool reinvoiceExceptions = false; bool reInvoiceStatus = false; try { reInvoiceStatus = ObjectFactory.GetInstance<BasketService>().GetReInvoiceStatus(); } catch (Exception e) { // ignored reinvoiceExceptions = true; } } @if (reinvoiceExceptions) { //inform the customer - try to load page again ? <div class="alert alert-warning-light text-center" role="alert"> <span class="error"> @Translate("reinvoice_error-info", "Status på viderefakturering kan ikke vises.")<br /> <small>@Translate("reinvoice_error-hint", "Prøv evt. at genindlæse siden.")</small> </span> </div> } else { <div id="re-invoice-container"> <div class="form-group"> <div class="checkbox"> <span style="display: none" class="js-re-invoice-loading icon-async icon-pulse"></span> <label for="re-invoice-enabled"> <input id="re-invoice-enabled" type="checkbox" @(reInvoiceStatus ? "checked" : "") /> @Translate("Enable_reinvoicing", "Viderefakturering") <i class="pe-is-i-info-circle-f pe-lg text-primary" aria-hidden="true" title="@Translate("reinvoicing_explained", "Her har du mulighed for at vælge, at din ordre skal viderefaktureres.")"></i> </label> </div> <div style="display: none;" class="js-re-invoice-error"> <div class="alert alert-warning-light text-center" role="alert"> <span class="error"> @Translate("reinvoice_error-info", "Status på viderefakturering kan ikke vises.")<br /> <small>@Translate("reinvoice_error-hint", "Prøv evt. at genindlæse siden.")</small> </span> </div> </div> </div> </div> } </div> <a rel="nofollow" class="hidden-print pull-right" href="@pdfLink"> @Translate("DownloadFavlist", "Download favoritliste") <img src="/Files/Templates/Designs/StandardWebshop/css/file-pdf-solid.svg" style="width:23px;padding-left:3px;" /> </a> } else { <a rel="nofollow" class="hidden-print pull-right hidden-xs" href="javascript:window.print();"> <i class="fas fa-file-pdf"></i> @Translate("Print", "Print") </a> } } </div> </div> @if (!String.IsNullOrWhiteSpace(GetString("Ecom:Group.LargeImage"))) { <div class="productlist-header-image hidden-xs"> <img src="/Admin/Public/GetImage.ashx?Width=1140&amp;Height=480&amp;Compression=80&amp;[email protected](GetString("Ecom:Group.LargeImage"))" /> </div> } @if (!String.IsNullOrEmpty(GetString("Ecom:Group.Description"))) { <div class="productlist-description hidden-xs"> @GetString("Ecom:Group.Description") </div> } @* If active shows featured products before produclist @RenderSnippet("FeaturedProduct") *@ @if (GetLoop("Products").Any()) { <text>@foreach (LoopItem groups in GetLoop("FacetGroups")) { if (groups.GetLoop("Facets").Any()) { if (groups.GetLoop("Facets").Where(fo => fo.GetLoop("FacetOptions").Where(op => op.GetBoolean("FacetOption.Selected")).Any()).Any()) { <div class="facets-selected"> <div class="facets-col-center"> <span>@Translate("selected_filters", "Valgte filtre:") </span> @foreach (LoopItem selected in groups.GetLoop("Facets")) { foreach (LoopItem active in selected.GetLoop("FacetOptions")) { if (active.GetBoolean("FacetOption.Selected")) { <a href="javascript:void(0)" class="filter-active-option" data-filter-name="@selected.GetString("Facet.Name")" data-filter-type="option" data-filter-option="@selected.GetString("Facet.QueryParameter")@active.GetString("FacetOptions.LoopCounter")"> <span class="option-label">@selected.GetString("Facet.Name"):</span> @if (active.GetString("FacetOption.Label").EndsWith(".jpg")) { var maerkeUrl = "/Files/Images/Symbol/" + active.GetString("FacetOption.Label"); var maerkeAlt = active.GetString("FacetOption.Label"); maerkeAlt = maerkeAlt.Substring(0, maerkeAlt.LastIndexOf(".jpg")); @*<img src="@maerkeUrl" alt="@maerkeAlt" class="img-responsive" />*@ <span>@maerkeAlt</span> } else { <span class="option-title">@active.GetString("FacetOption.Label")</span> } <i class="pe-is-i-close-circle-f pe-va" aria-hidden="true"></i>@*was icon-close*@ </a> } } } @if (groups.GetLoop("Facets").Where(fo => fo.GetLoop("FacetOptions").Where(op => op.GetBoolean("FacetOption.Selected")).Any()).Any()) { <a class="filter-active-option filter-reset" role="button" href="javascript:void(0)" data-filter-type="reset"> <span>@Translate("Clear filter", "Nulstil filtre")</span> <i class="pe-is-bt-backspace-f pe-va pe-lg" aria-hidden="true"></i>@*was icon-close*@ </a> } </div> </div> } } }</text> <text>@using System.Web @using NORRIQ.Universal.Extensions @using NORRIQ.Common8.Context @using System.Web.Mvc.Html @using Dynamicweb.NewsLetterV3 @using Newtonsoft.Json @using NORRIQ.Common8.Ecom @using NORRIQ.Common8.Factory @using NORRIQ.FavoriteList.Models @using NORRIQ.FavoriteList.Services @using StandardWebshop.CustomCode.Razor @using NORRIQ.Common8.Razor; @using Dynamicweb.eCommerce.Common; @using StandardWebshop.CustomCode.ColorLookup @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @if (GetLoop("FacetGroups").Any()) { var colorLookupService = ObjectFactory.GetInstance<ColorLookupService>(); <div id="filter-container" class="productlist-filter"> <form id="filter-form" method="get" action="/Default.aspx"> <input type='hidden' name='ID' value='@Pageview.Page.ID' /> @if (!String.IsNullOrEmpty(GetString("Ecom:ProductList:Page.GroupID"))) { <input type='hidden' name='GroupID' value='@GetString("Ecom:ProductList:Page.GroupID")' /> } @if (HttpContext.Current.Request["ecomquery"] != null) { <input type="hidden" name="ecomquery" value="@HttpContext.Current.Request["ecomquery"]" /> } @foreach (LoopItem groups in GetLoop("FacetGroups")) { if (groups.GetLoop("Facets").Any()) { <ul class="nav nav-pills nav-filter"> @foreach (LoopItem facets in groups.GetLoop("Facets")) { if (facets.GetLoop("FacetOptions").Any()) { var anySelected = facets.GetLoop("FacetOptions").Any(options => options.GetBoolean("FacetOption.Selected")); //DON't make this general - use brackets only if needed for each node instead. //var useBrackets = facets.GetLoop("FacetOptions").Where(o => o.GetString("FacetOption.Value").IndexOf(',') > -1).Any(); <li class="dropdown @(anySelected ? "active" : string.Empty)" id="@facets.GetString("Facet.QueryParameter")" role="presentation"> <a role="button" href="javascript:void()" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="icon-spinner icon-pulse" aria-hidden="true" style="display: none;"></i> @facets.GetString("Facet.Name") <i class="icon-angle-down" aria-hidden="true"></i> </a> <div class="dropdown-menu dropdown-keep-open" aria-labelledby="@facets.GetString("Facet.QueryParameter")"> <div class="dropdown-inner"> @foreach (LoopItem option in facets.GetLoop("FacetOptions")) { string facetLabel = option.GetString("FacetOption.Label"); bool useBrackets = (option.GetString("FacetOption.Value").IndexOf(',') > -1); if (facets.GetString("Facet.QueryParameter") == "Farve") { string colorKey = colorLookupService.GetColorKey(option.GetString("FacetOption.Value")); <div class="checkbox-color"> <input type="checkbox" id="@facets.GetString("Facet.QueryParameter")@option.GetString("FacetOptions.LoopCounter")" name="@facets.GetString("Facet.QueryParameter")" value="@(useBrackets ? "[" + option.GetString("FacetOption.Value") + "]" : option.GetString("FacetOption.Value"))" @(option.GetBoolean("FacetOption.Selected") ? " checked=\"checked\" " : "") /> <label for="@facets.GetString("Facet.QueryParameter")@option.GetString("FacetOptions.LoopCounter")"> <span class="checkbox-color-parameter [email protected](useBrackets ? "[" + colorKey + "]" : colorKey)"></span> <span class="checkbox-color-name">@option.GetString("FacetOption.Label")</span> <span class="cnt">(@option.GetString("FacetOption.Count"))</span> </label> </div> } else { <div class="checkbox"> <label for="@facets.GetString("Facet.QueryParameter")@option.GetString("FacetOptions.LoopCounter")"> <input type="checkbox" id="@facets.GetString("Facet.QueryParameter")@option.GetString("FacetOptions.LoopCounter")" name="@facets.GetString("Facet.QueryParameter")" value="@(useBrackets ? "[" + option.GetString("FacetOption.Value") + "]" : option.GetString("FacetOption.Value"))" @(option.GetBoolean("FacetOption.Selected") ? " checked=\"checked\" " : "") /> @{ bool isImage = SpecificationHelper.IsImageFile(facetLabel); string facetLabelImageTxt = facetLabel.Split('.').FirstOrDefault(); //TODO: mso BAD implementation - should be removed later Guid tmpGuid; bool isGUID = !string.IsNullOrEmpty("facetLabelImageTxt") && Guid.TryParse(facetLabelImageTxt, out tmpGuid); } @if (isImage && isGUID) { //TODO: mso - after PIM data is structured <img src="/Admin/Public/GetImage.ashx?Width=60&amp;Height=60&amp;Compression=80&amp;Crop=5&amp;Image=/Files/Images/XPI/@facetLabel" alt="@facetLabel" class="img-responsive" /> } else if (!isGUID && isImage) { //TODO: mso BAD implementation. //This should be cleaned up in the future var maerkeUrl = "/Files/Images/Symbol/" + option.GetString("FacetOption.Label"); string maerkeAlt = facetLabel.Substring(0, facetLabel.LastIndexOf(".jpg")); <text> <img src="/Admin/Public/GetImage.ashx?Width=125&amp;Height=125&amp;Compression=80&amp;[email protected]" alt="@maerkeAlt" class="img-responsive miniThumb" /> @Translate("specs_" + maerkeAlt, maerkeAlt) <span class="cnt">(@option.GetString("FacetOption.Count"))</span> </text> } else { <text> @facetLabel <span class="cnt">(@option.GetString("FacetOption.Count"))</span> </text> } </label> </div> } } </div> <div class="btn-wrap"> <button class="btn btn-action btn-block btn-raised" onclick="Filter(@facets.GetString("Facet.QueryParameter"))"> @Translate("Anvend", "Anvend") </button> </div> </div> </li> } } @*@if (groups.GetLoop("Facets").Where(fo => fo.GetLoop("FacetOptions").Where(op => op.GetBoolean("FacetOption.Selected")).Any()).Any()) { <li class="dropdown show-mobile" role="presentation"> <a class="dropdown-toggle filter-active-option filter-reset" role="button" href="javascript:void(0)" data-filter-type="reset"> @Translate("Clear filter", "Nulstil filtre") <i class="pe-is-bt-backspace-f pe-va pe-lg" aria-hidden="true"></i> </a> </li> }*@ </ul> } } <div class="clearfix"></div> </form> </div> <script append="true"> require(['jquery', 'shared/norriq.searchfilter/norriq.searchfilter'], function ($, Filter) { var filter = new Filter(); filter.init({ $filterForm: $('#filter-form'), $filterGroups: $('.filter-group, .js-select-filter'), $filterSlider: $('.filter-slider'), $selectedFilters: $('.filter-active-option') }); }); </script> }</text> <div class="row"> <div class="col-xs-12"><div class="stroked"></div></div> <div class="col-xs-12 col-sm-6 col-sm-offset-3 text-center"> <div class="productlist-header-info"> <span class="productlist-header-quantity"> @GetString("Ecom:ProductList.PageProdCnt") @Translate("Products", "Products") </span> <span class="productlist-header-vat"> @Translate("Prices without VAT", "Prices without VAT") </span> </div> </div> <div class="col-xs-12 col-sm-3" data-align="right"> @*<div class="form-inline form-sort" data-float="left"> <label for="sortProducts"> @Translate("label_sort_products", "Sorter") </label> <select class="form-control form-control-sort" id="sortProducts"> <option value="@(HttpContext.Current.Request.Url.SetQuery("SortBy", "ProductNameSort").SetQuery("SortOrder", "ASC").PathAndQuery)" @(SortOrder == "ASC" ? "selected" : "")> @Translate("Name ascending", "Name A to Z") </option> <option value="@(HttpContext.Current.Request.Url.SetQuery("SortBy", "ProductNameSort").SetQuery("SortOrder", "DESC").PathAndQuery)" @(SortOrder == "DESC" ? "selected" : "")> @Translate("Name descending", "Name Z to A") </option> </select> </div>*@ @if (!isFavoriteList) { <div class="btn-group views" role="group" aria-label="Toggle view"> <a class="btn @(mode == "table" ? "btn-grid active" : "btn-grid")" href="@(HttpContext.Current.Request.Url.SetQuery("listmode", "table").PathAndQuery)"> <i class="icon-list" aria-hidden="true"></i> <span class="sr-only">@Translate("Table", "Tabel")</span> </a> <a class="btn @(mode == "grid" ? "btn-grid active" : "btn-grid")" href="@(HttpContext.Current.Request.Url.SetQuery("listmode", "grid").PathAndQuery)"> <i class="icon-grid" aria-hidden="true"></i> <span class="sr-only">@Translate("Grid", "Grid")</span> </a> </div> } </div> </div> } </header> @if (GetLoop("Products").Any()) { if (mode == "grid") { <div class="productlist-grid-flex"> @foreach (var product in GetLoop("Products")) { <text>@using System.Globalization @using System.Web.Mvc.Html @using Dynamicweb.NewsLetterV3 @using NORRIQ.EcomMedia @using NORRIQ.FavoriteList.Models @using StandardWebshop.CustomCode.Razor @using NORRIQ.Common8.Razor; @using NORRIQ.Common8.Factory @using Newtonsoft.Json @using Dynamicweb.eCommerce.Common; @using Dynamicweb.eCommerce.Products @using StandardWebshop.CustomCode.SupplementalUnit @using StandardWebshop.CustomCode.ViewModels.Variants; @using StandardWebshop.CustomCode.Volumenpriser @using StandardWebshop.CustomCode.Units; @using StandardWebshop.CustomCode.Units.Models @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @{ //this is required do to lazy loading //product.GetLoop("Units").Select(u => new //{ // UnitId = u.GetString("Ecom:VariantOption.ID"), // // Change the number format here: // UnitPriceDouble = (u.GetDouble("Ecom:VariantOption.Price.PricePIP") / 100d), // UnitName = u.GetString("Ecom:VariantOption.Name"), // UnitObj = u //}).OrderBy(x => x.UnitPriceDouble); var link = product.GetString("NIQ:ProductUrl"); var tilbud = product.GetBoolean("Ecom:Product:Field.Tilbud.Value"); var buy = "/default.aspx?ID=" + Navigation.GetPageIdByNavigationTag("ecom") + "&amp;productid=" + product.GetString("Ecom:Product.ID") + "&amp;cartcmd=add"; var area = GetGlobalValue("Global:Area.Lang"); var media = NORRIQ.EcomMedia.Frontend.GetProductMedia(product); // Favortitelist var availableFavoriteLists = (List<NORRIQ.FavoriteList.Models.FavoriteItemList> )product.GetValue("NIQ:FavoriteListsAvailable"); var favoriteListsWithProduct = (List<NORRIQ.FavoriteList.Models.FavoriteItemList> )product.GetValue("NIQ:FavoritListsWithProduct"); var isFavorite = favoriteListsWithProduct.Any(); var listId = availableFavoriteLists.Any() ? availableFavoriteLists.First().Id : 0; var addFav = Translate("label_make_favorite", "Føj til favoritter"); var delFav = Translate("label_remove_favorite", "Fjern fra favoritter"); var ProductSpecs = product.GetProductSpecifications(); var Image = ProductSpecs.GetAllByKey("Image").Any() ? "/Files/Images/XPI/" + ProductSpecs.GetByKey("Image").Value : media.GetFirstImage().Url; var isLoggedIn = Pageview.User.LoggedIn; var priceForGoogle = product.GetString("NIQ:PriceForGoogle"); var btn_addText = Translate("Add to cart", "Add to cart"); // Units var unitInformation = product.GetUnitInformation() as UnitInformationViewModel; var productListUnits = unitInformation.Units; var productListDefaultUnit = unitInformation.ProductDefaultUnit; //volumenPrices var productgridVolumenpriser = product.GetVolumenpriser(); bool discountedCompletely = product.GetBoolean("NIQ:Product.DiscontunedCompletely"); bool discountedTemporary = product.GetBoolean("NIQ:Product.DiscontunedTemporary"); bool isSubstituteProduct = discountedTemporary || discountedCompletely; string substituteProductID = product.GetString("NIQ:Product.SubstituteProductId"); string subStituteLink = string.Empty; if (isSubstituteProduct && substituteProductID != null) { subStituteLink = string.Format("/Default.aspx?ID={0}&productID={1}", NORRIQ.Common8.Razor.Navigation.GetPageIdByNavigationTag("ecom"), substituteProductID); } tilbud = tilbud || productListUnits.Any(x => x.IsInformativePrice); var productGridIsVolumenDiscount = productgridVolumenpriser.HasPrices() && productgridVolumenpriser.IsValid(); } @if (productListDefaultUnit != null) { <div class="@Columns @(!isSubstituteProduct ? "async-price " : "" ) js-favProduct" data-product-display="flex" data-product-key='@(product.GetJsonPriceKey((string)productListDefaultUnit.UnitId))' data-product-retail-price='@(product.GetJsonRetailPrice())' data-product-units='@JsonConvert.SerializeObject(productListUnits)'> <div itemscope itemtype="http://schema.org/Product" class="productlist-grid-product"> @RenderProductLabels(tilbud, productGridIsVolumenDiscount, discountedCompletely, discountedTemporary) <a class="productlist-grid-image" href="@link" itemprop="url"> <img src="/Admin/Public/GetImage.ashx?Width=200&amp;Height=200&amp;Crop=5&amp;Compression=80&amp;[email protected]" class="img-responsive" alt="@System.Web.HttpUtility.HtmlEncode(product.GetString("Ecom:Product.Name"))" itemprop="image" /> </a> <div class="productlist-grid-caption"> <a href="@link" class="productlist-grid-name" itemprop="name"> @System.Web.HttpUtility.HtmlEncode(product.GetString("Ecom:Product.Name")) </a> </div> <div class="offer" itemprop="offers" itemscope="" itemtype="http://schema.org/Offer"> @if (!isSubstituteProduct) { <div class="productlist-grid-info"> <span class="productlist-grid-number"> @Translate("Product Number", "Product Number") <span itemprop="sku">@product.GetString("Ecom:Product.Number")</span> </span> <span class="productlist-grid-stock"> @if (Pageview.User.LoggedIn) { <span class="async-price-stock" itemprop="availability"> <span class="icon-async icon-pulse"></span> </span> } else { @RenderStockInformations(product) } </span> </div> <div class="productlist-grid-footer"> <div class="productlist-grid-price-info"> <div class="productlist-grid-price js-price-container"> @if (Pageview.User.LoggedIn) { <span class="async-price-unit product-price-before"></span> <span class="productlist-grid-price-price async-price-total" itemprop="price"></span> } else { <span class="product-price-before">@(productListDefaultUnit.IsInformativePrice ? productListDefaultUnit.UnitBeforePrice: string.Empty)</span> <span class="productlist-grid-price-price @(productListDefaultUnit.IsInformativePrice ? "font-hilite": string.Empty)" itemprop="price" content="@priceForGoogle"> @productListDefaultUnit.UnitPrice <span itemprop="priceCurrency" content="@ProductCurrency">@ProductCurrency</span> </span> } </div> </div> @if (ObjectFactory.GetInstance<NORRIQ.Common8.Context.AreaItemSettings>().GetCurrentAreaValue<string>("ProductlistGridHideButton") == "False") { <div class="productlist-grid-buying"> @if (product.GetLoop("VariantGroups").Any()) { <a href="@link" class="btn btn-buy"> <span class="product-added-text">@Translate("Buy", "Buy")</span> </a> } else { <form class="form" id="[email protected]("Ecom:Product:Page.ID")" name="[email protected]("Ecom:Product:Page.ID")" method="post" action="/[email protected]("Global:Page.ID")"> @* Because of DW and their use of Default units, we have to do this the manual way: http://doc.dynamicweb.com/documentation-8/ecommerce/product-catalog/products#sideNavTitle1-2-5-4 The ones commented out has been deemed not necessary. *@ @*@GetString("Ecom:Product.Form.Clean")*@ @*<input type="hidden" name="ProductURL" id="ProductURL" value="" />*@ <input type="hidden" name="CartCmd" id="CartCmd" value="add" /> <input type="hidden" name="ProductID" id="ProductID" value="@(product.GetString("Ecom:Product.ID"))" /> <input type="hidden" name="VariantID" id="VariantID" value="" /> @*<input type="hidden" name="UnitID" id="UnitID" value="STK" />*@ @*<input type="hidden" name="wishListID" id="wishListID" value="0" />*@ @{ var unitService = ObjectFactory.GetInstance<SupplementalUnitService>(); } <div class="input-group popover-trigger"> <input name="quantity" id="quantity" value="1" min="1" max="99999" type="number" class="form-control text-center" autocomplete="off" data-trigger="focus" data-rule-number="true" data-rule-min="1" /> <span class="input-group-btn"> <select name="UnitId" class="form-control form-unit unit-input JS-ASYNC-UNITSELECTOR JS-ASYNC-INPUT-VALUE" @(productListUnits.Count() <= 1 ? "readonly" : "")> @foreach (var unit in productListUnits) { <option value="@unit.UnitId" @(String.Equals(unit.UnitId, productListDefaultUnit.UnitId) ? "selected" : "")>@unit.UnitName</option> } </select> </span> </div> <button role="button" type="submit" class="btn btn-primary btn-block btn-air" title="@btn_addText"> <span class="product-added-text">@btn_addText<i class="pe-is-ec-cart-1-f hide" aria-hidden="true"></i></span> </button> <div class="hide my-popover-content"> <table class="table table-condensed no-margin"> <tr> <th class="text-left">@Translate("Product pakning", "Pakning")</th> <th class="text-right">@Translate("Product indhold", "Indhold")</th> </tr> @foreach (var unit in unitService.GetSupplementalUnitByProduct(product.GetString("Ecom:Product.ID"))) { <tr> <td class="text-left">1 @unit.UnitName</td> <td class="text-right">@unit.QtyInBaseUnitOfMeasure @unit.Bom</td> </tr> } </table> </div> </form> } </div> } </div> } else { //if the product is a substitution product render this section instead. //This way to scope the feature is much easier to maintain changes in the future <div class="productlist-grid-info"> <span class="productlist-grid-number"> @Translate("Product Number", "Product Number") <span itemprop="sku">@product.GetString("Ecom:Product.Number")</span> </span> <span class="productlist-grid-stock"> @RenderStockInformations(product, true) </span> </div> <a class="btn btn-primary btn-block btn-air" href="@subStituteLink">@Translate("erstatningsvare")</a> } </div> @if (isLoggedIn && !product.GetLoop("VariantGroups").Any()) { <div class="productlist-grid-buttons"> <a href="javascript:void(0)" class="js-favorite-toggle productlist-grid-favorite" data-favorite-list-id="@listId" data-is-favorite="@(isFavorite ? "true" : "false")" data-product-id="@(product.GetString("Ecom:Product.ID"))" data-product-language-id="@(product.GetString("Ecom:Product.LanguageID"))" data-product-variant-id="@(product.GetString("Ecom:Product.VariantID"))"> @if (isFavorite) { <span class="icon-favorite-added"></span> } else { <span class="icon-favorite"></span> } </a> </div> } </div> </div> } </text> } </div> } else { var productsBinding = GetLoop("Products"); var tableModeBinding = "default"; <text>@using System.Globalization @using System.Web.Mvc.Html @using Dynamicweb.NewsLetterV3 @using NORRIQ.EcomMedia @using NORRIQ.FavoriteList.Models @using StandardWebshop.CustomCode.Razor @using NORRIQ.Common8.Razor; @using NORRIQ.Common8.Factory @using Newtonsoft.Json @using Dynamicweb.eCommerce.Common; @using NLWI.Platforms.Dynamicweb8.Specs @using StandardWebshop.CustomCode.ColorLookup @using StandardWebshop.CustomCode.SupplementalUnit @using StandardWebshop.CustomCode.Units.Models @using StandardWebshop.CustomCode.ViewModels.Variants; @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @{ var addToCartMode = ObjectFactory.GetInstance<NORRIQ.Common8.Context.AreaItemSettings>().GetCurrentAreaValue<string>("AddToCartMode"); var colorLookupService2 = ObjectFactory.GetInstance<ColorLookupService>(); var isLoggedIn = Pageview.User.LoggedIn; var products = productsBinding; if (products == null) { throw new Exception("product table binding reference is not set!"); } string tableMode = tableModeBinding; } <table class="table table-striped table-block productlist-table js-product-table"> <thead> <tr> <th class="visible-printxx"></th> <th class="productlist-table-product"> @Translate("Product", "Product") </th> @*start Variant headers*@ <th class="productlist-table-variant">@*Description: variant size*@</th> <th class="productlist-table-variant">@*Description: variant color*@</th> @*end Variant headers*@ <th class="productlist-table-number" nowrap> @Translate("Product Number", "Product Number") </th> <th class="productlist-table-stock" nowrap> @Translate("Stock", "Stock") </th> @if (isLoggedIn) { <th class="productlist-table-favorite"> <i class="icon-favorite-added" aria-hidden="true"></i><span class="sr-only">@Translate("Favorite", "Favorite")</span> </th> } <th class="productlist-table-price"> @Translate("Price", "Price") </th> <th> @Translate("Unit", "Unit") </th> <th class="productlist-table-quantity"> @Translate("Quantity", "Quantity") </th> </tr> </thead> <tbody> @foreach (var product in products) { var tilbud = product.GetBoolean("Ecom:Product:Field.Tilbud.Value"); var LoopCounter = product.GetInteger("Ecom:Product.LoopCounter") - 1; var media = NORRIQ.EcomMedia.Frontend.GetProductMedia(product); var link = product.GetString("NIQ:ProductUrl"); var area = GetGlobalValue("Global:Area.Lang"); var productSpecs = product.GetProductSpecifications(); var Image = productSpecs.GetAllByKey("Image").Any() ? "/Files/Images/XPI/" + productSpecs.GetByKey("Image").Value : media.GetFirstImage().Url; var variants = product.GetLoop("VariantGroups").GetVariants(); // In IBH, the Product Number can be used as a unique product identifier. var currentProductNumber = product.GetString("Ecom:Product.Number"); // All variant products and their associated variant groups/options. var variantProducts = product.GetLoop("VariantCombinations").GetVariantProducts(variants, currentProductNumber); var productsDictionary = VariantViewModelBuilder.GetProductsInDimensionOrder(variants, variantProducts); var selectedVariant = VariantViewModelBuilder.GetSelectedOrEmpty(variantProducts); //variants var productSpecGroup = productSpecs.GetByGroup("Specifikationer"); //custom size names IEnumerable<string> filterSizeKeys = new List<string> { "specs_Handskestorrelse", "specs_Toejstoerrelse", "specs_Skostoerrelse", "specs_Stoerrelse" }; //remove prefix "specs_" filterSizeKeys = filterSizeKeys.Select(s => s.Replace("specs_", "")); var sizeObj = productSpecs.FirstOrDefault(x => filterSizeKeys.Any(s => s.Equals(x.Key)) && !string.IsNullOrEmpty(x.Value)); var colorList = productSpecGroup.Where(x => x.Key.Equals("Farve") && !string.IsNullOrEmpty(x.Value)); //end variants bool discountedCompletely = product.GetBoolean("NIQ:Product.DiscontunedCompletely"); bool discountedTemporary = product.GetBoolean("NIQ:Product.DiscontunedTemporary"); bool isSubstituteProduct = discountedTemporary || discountedCompletely; string substituteProductID = product.GetString("NIQ:Product.SubstituteProductId"); string subStituteLink = string.Empty; if (isSubstituteProduct && substituteProductID != null) { subStituteLink = string.Format("/Default.aspx?ID={0}&productID={1}", NORRIQ.Common8.Razor.Navigation.GetPageIdByNavigationTag("ecom"), substituteProductID); } // Units var unitInformation = product.GetUnitInformation() as UnitInformationViewModel; var productListUnits = unitInformation.Units; var productListDefaultUnit = unitInformation.ProductDefaultUnit; var listDefaultUnitId = productListDefaultUnit.UnitId;//;product.GetString("Ecom:Product.DefaultUnitID"); tilbud = tilbud || productListUnits.Any(x => x.IsInformativePrice); var volumePrices = product.GetVolumenpriser(); var isVolumenDiscount = volumePrices.HasPrices() && volumePrices.IsValid(); @* These lines are required because lazy load's its data. product.GetString("Ecom:VariantGroup.Label") product.GetString("Ecom:VariantGroup.Name") product.GetLoop("VariantAvailableOptions") product.GetString("Ecom:VariantOption.ID") product.GetString("Ecom:VariantOption.Name") *@ <tr itemprop="offers" itemscope="" itemtype="http://schema.org/Offer" class="async-price js-favProduct" data-product-key='@(product.GetJsonPriceKey())' data-product-retail-price='@(product.GetJsonRetailPrice())' data-product-units='@JsonConvert.SerializeObject(productListUnits)'> <td align="left" width="50" class="visible-printxx"> @if (tableMode == "variants") { <div class="image-wrapper"> <img itemprop="image" class="img-responsive" src="/Admin/Public/GetImage.ashx?Width=400&amp;Height=400&amp;Crop=5&amp;Compression=80&amp;[email protected]" /> </div> } else { //default <img src="/Admin/Public/GetImage.ashx?Width=40&amp;Height=35&amp;Crop=5&amp;Compression=85&amp;[email protected]" /> } </td> <td class="productlist-table-product"> @RenderProductLabels(tilbud, isVolumenDiscount, discountedCompletely, discountedTemporary) <a href="@link" tabindex="0" class="productlist-table-name" itemprop="name"> @System.Web.HttpUtility.HtmlEncode(product.GetString("Ecom:Product.Name")) </a> </td> @*start Variant rows*@ <td class="productlist-table-variant productlist-table-size"> <span>@(sizeObj != null ? sizeObj.Value : string.Empty)</span> </td> <td class="productlist-table-variant productlist-table-color"> @if (colorList.Any()) { foreach (var colorObj in colorList) { var color = colorLookupService2.GetColorKey(colorObj.Value); <span class="spec-color [email protected]"></span> } } </td> @*end Variant rows*@ <td class="productlist-table-number" itemid="sku" data-label="@Translate("Product No", "Product No")" nowrap> @product.GetString("Ecom:Product.Number") </td> @if (isSubstituteProduct && false) { //if the product is a substitution product render this section instead. //This way to scope the feature is much easier to maintain changes in the future <td class="productlist-table-stock" itemprop="availability" href="http://schema.org/InStock" data-label="@Translate("Stock", "Stock")" nowrap> @RenderStockInformations(product, isSubstituteProduct) </td> if (isLoggedIn) { <td data-label="@Translate("Favorite", "Favorite")"> @RenderProductListTableFavorite(product) </td> } <td class="productlist-table-price" nowrap="nowrap"></td> <td></td> <td class="productlist-table-variant"> <a class="btn btn-primary btn-block" href="@subStituteLink">@Translate("erstatningsvare")</a> </td> } else { if (isLoggedIn) { <td class="productlist-table-stock async-price-stock" itemprop="availability" href="http://schema.org/InStock" data-label="@Translate("Stock", "Stock")" nowrap> <i class="icon-async icon-pulse"></i> </td> } else { <td class="productlist-table-stock" itemprop="availability" href="http://schema.org/InStock" data-label="@Translate("Stock", "Stock")" nowrap> @RenderStockInformations(product, isSubstituteProduct) </td> } if (isLoggedIn) { <td data-label="@Translate("Favorite", "Favorite")"> @RenderProductListTableFavorite(product) </td> } <td class="productlist-table-price js-price-container" nowrap="nowrap"> @if (isLoggedIn) { <span class="async-price-unit product-price-before"></span> <span class="productlist-table-price-price async-price-total" itemprop="price" data-label="@Translate("Price", "Price")"> <i class="icon-async icon-pulse" aria-hidden="true"></i> </span> } else { var defaultUnit = productListUnits.FirstOrDefault(x => x.UnitId.Equals(listDefaultUnitId)); if (defaultUnit != null) { if (defaultUnit.IsInformativePrice) { <span class="product-price-before">@defaultUnit.UnitBeforePrice</span> } <span class="productlist-grid-price-price @(defaultUnit.IsInformativePrice ? "font-hilite": string.Empty)" itemprop="price" content="@product.GetString("NIQ:PriceForGoogle")"> @defaultUnit.UnitPrice <span itemprop="priceCurrency" content="@Context.Currency.Symbol">@Context.Currency.Symbol</span> </span> } } </td> @* Units *@ <td> <div class="popover-trigger"> <select name="UnitId" style="min-width: 80px;" class="form-control form-unit unit-input JS-ASYNC-UNITSELECTOR JS-ASYNC-INPUT-VALUE" @(productListUnits.Count() <= 1 ? "readonly" : "")> @foreach (var unit in productListUnits) { <option value="@unit.UnitId" @(String.Equals(unit.UnitId, listDefaultUnitId) ? "selected" : "")>@unit.UnitName</option> } </select> </div> <div class="hide my-popover-content"> <table class="table table-condensed no-margin"> <tr> <th class="text-left">@Translate("Product pakning", "Pakning")</th> <th class="text-right">@Translate("Product indhold", "Indhold")</th> </tr> @{ //TODO: refactor this var unitService = ObjectFactory.GetInstance<SupplementalUnitService>(); foreach (var unit in unitService.GetSupplementalUnitByProduct(product.GetString("Ecom:Product.ID"))) { <tr> <td class="text-left">1 @unit.UnitName</td> <td class="text-right">@unit.QtyInBaseUnitOfMeasure @unit.Bom</td> </tr> } } </table> </div> </td> if (product.GetLoop("VariantGroups").Any()) { <td class="productlist-table-variant"> <a href="@link" class="btn btn-buy"><i class="icon-minicart" aria-hidden="true"></i> <span class="sr-only">@Translate("Buy", "Buy")</span></a> </td> } else { <td class="productlist-table-quantity"> @* For stadsing, we always have the "Single" add to cart. *@ @if (true || addToCartMode == "single") { <form class="form productlist-table-form" id="[email protected]("Ecom:Product:Page.ID")" name="[email protected]ring("Ecom:Product:Page.ID")" method="post" action="@GetGlobalValue("Global:Pageview.Url.Raw")"> @* Because of DW and their use of Default units, we have to do this the manual way: http://doc.dynamicweb.com/documentation-8/ecommerce/product-catalog/products#sideNavTitle1-2-5-4 The ones commented out has been deemed not necessary. *@ @*@GetString("Ecom:Product.Form.Clean")*@ @*<input type="hidden" name="ProductURL" id="ProductURL" value="" />*@ <input type="hidden" name="CartCmd" id="CartCmd" value="add" /> <input type="hidden" name="ProductID" id="ProductID" value="@(product.GetString("Ecom:Product.ID"))" /> <input type="hidden" name="VariantID" id="VariantID" value="" /> @*<input type="hidden" name="UnitID" id="UnitID" value="STK" />*@ @*<input type="hidden" name="wishListID" id="wishListID" value="0" />*@ <div class="input-group"> @*<div class="input-group-addon"> @Translate("Quantity inline", "Quantity") </div>*@ <input name="quantity" id="quantity" value="1" type="tel" class="form-control text-center qty-input-manual" autocomplete="off" data-trigger="focus" data-rule-number="true" data-rule-min="1" /> <span class="input-group-btn"> <button role="button" type="submit" class="btn btn-primary ajax-add-to-cart" title="@Translate("Add to cart", "Add to cart")"> <span class="product-added-text">@*@Translate("Add to cart", "Add to cart")*@<i class="pe-is-ec-cart-1-f" aria-hidden="true"></i></span> </button> </span> </div> </form> } else { <input type="tel" class="form-control qty-input text-center" onclick="this.focus();this.select();" name="[email protected](LoopCounter)" id="[email protected](LoopCounter)" value="@(product.GetInteger("NIQ:BasketQuantity"))" data-product-autoid="@(product.GetInteger("NIQ:ProductAutoId"))" data-tabindex="@(LoopCounter)" data-trigger="manual" /> <span class="productlist-table-added btn btn-buy qty-input-user-feedback" data-product-autoid="@(product.GetInteger("NIQ:ProductAutoId"))"> @if (product.GetInteger("NIQ:BasketQuantity") > 0) { <i class="icon-added"></i> } else { <i class="icon-minicart"></i> } </span> } </td> } } </tr> } </tbody> </table> </text> } <text>@{ // Pagination var paginationCurrentPage = GetInteger("Ecom:ProductList.CurrentPage"); var paginationTotalPages = GetInteger("Ecom:ProductList.TotalPages"); var prev = GetString("Ecom:ProductList.PrevPage.Clean"); var next = GetString("Ecom:ProductList.NextPage.Clean"); string pageCountText = Translate("Viser side") + " " + GetValue("Ecom:ProductList.CurrentPage") + " " + Translate("af") + " " + GetValue("Ecom:ProductList.TotalPages") + " (" + GetValue("Ecom:ProductList.PageProdCnt") + " " + Translate("varer") + ")"; } @if (paginationTotalPages > 1) { <nav class="productlist-pagination"> <ul class="pagination"> <li class="@(paginationCurrentPage > 1 ? "" : "disabled")"> <a href="@(paginationCurrentPage > 1 ? prev : "javascript:void()")" aria-label="Previous"> <i aria-hidden="true" class="icon-chevron-left"></i> </a> </li> @foreach (var pagination in GetLoop("Ecom:ProductList.Pages5")) { <li class="@(pagination.GetBoolean("Ecom:ProductList.Pages5.Page.IsCurrent") ? "active" : "")"> <a href="@(pagination.GetString("Ecom:ProductList.Pages5.Page.UrlHtmlEncoded"))"> @pagination.GetString("Ecom:ProductList.Pages5.Page.Number") </a> </li> } <li class="@(paginationTotalPages > paginationCurrentPage ? "" : "disabled")"> <a href="@(paginationTotalPages > paginationCurrentPage ? next : "javascript:void()")" aria-label="Next"> <i aria-hidden="true" class="icon-chevron-right"></i> </a> </li> </ul> <div class="pagecountinfo"><p>@pageCountText</p></div> </nav> } @*@if (paginationTotalPages > 1) { <nav class="productlist-pagination"> <ul class="pagination"> <li class="pagitext">@Translate("Viser side")</li> <li class="@(paginationCurrentPage > 1 ? "" : "disabled")"> <a href="@(paginationCurrentPage > 1 ? prev : "javascript:void()")" aria-label="Previous"> <i aria-hidden="true" class="icon-chevron-left"></i> </a> </li> @foreach (var pagination in GetLoop("Ecom:ProductList.Pages5")) { <li class="@(pagination.GetBoolean("Ecom:ProductList.Pages5.Page.IsCurrent") ? "active" : "")"> <a href="@(pagination.GetString("Ecom:ProductList.Pages5.Page.UrlHtmlEncoded"))"> @pagination.GetString("Ecom:ProductList.Pages5.Page.Number") </a> </li> } <li class="@(paginationTotalPages > paginationCurrentPage ? "" : "disabled")"> <a href="@(paginationTotalPages > paginationCurrentPage ? next : "javascript:void()")" aria-label="Next"> <i aria-hidden="true" class="icon-chevron-right"></i> </a> </li> <li class="pagitext">@Translate("af") @GetString("Ecom:ProductList.TotalPages")</li> </ul> </nav> }*@ @if (!String.IsNullOrEmpty(GetString("Ecom:Group.Description"))) { <div class="productlist-description visible-xs"> @GetString("Ecom:Group.Description") </div> }</text> } </section> <script append="true"> require(['standardwebshop/areas/ecom/product-list'], function (productList) { var getPrices = @(Pageview.User.LoggedIn ? 1 : 0); productList.init({ containerScope: '.js-product-list .async-price', asyncTemplate: $('#async-price'), productSort: $('#sortProducts'), getPrices: getPrices, //unit-selector options baseUnit: "", // Get from data currencyCode: "@ProductCurrency", currentCulture: "@System.Globalization.CultureInfo.CurrentCulture.Name" }); }); require(['standardwebshop/areas/ecom/favoritelist'], function (favoriteList) { favoriteList.init({ isFavoriteMode: @isFavoriteList.ToString().ToLower(), $productParent: $('.js-favProduct') }); }); </script> @if (!string.IsNullOrEmpty(query)) { <script type="text/javascript"> var results = @GetLoop("Products").Count; var postfix = results > 0 ? "ProductsFound" : "Empty"; var category = "EcomSearch - " + postfix; // Datalayer originates from GTM if (typeof variable !== 'undefined') dataLayer.push({ 'event': 'EcomSearch', 'eventCategory': category, 'eventAction': '@query', 'eventLabel': results }); </script> }

Vi bruger cookies for at forbedre din oplevelse af stadsing.dk. Ved at klikke OK accepterer du vores brug af cookies.