TILBUD L'ECOLE NO 41

Error executing template "Designs/Rapido/eCom/Productlist/ProductList.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_0885eee22fca49c7b5d3b1c49e6ad5d7.Execute() in D:\dynamicweb.net\Solutions\Dynamicweb\juulsvin.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\eCom\Productlist\ProductList.cshtml:line 42
   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.Core 3 @using System.Web; 4 @using System 5 6 @{ 7 string pageId = GetGlobalValue("Global:Page.ID"); 8 string pageName = GetString("Ecom:Group.Name") != "" ? GetString("Ecom:Group.Name") : Translate("Products"); 9 string listHeader = HttpContext.Current.Request.QueryString.Get("Search") != null ? Translate("Search result for") + " \"" + HttpContext.Current.Request.QueryString.Get("Search") + "\" : " : pageName + ": "; 10 listHeader = HttpContext.Current.Request.QueryString.Get("ListName") != null ? HttpContext.Current.Request.QueryString.Get("ListName") + ": " : listHeader; 11 listHeader += GetString("Ecom:ProductList.PageProdCnt"); 12 bool onlyPreview = Converter.ToBoolean(Pageview.Area.Item["OnlyPreviewForAnonymous"]) && Pageview.User == null; 13 14 Dictionary<string, string> Sorts = new Dictionary<string, string>() { 15 {"CreatedDESC", Translate("Newest")}, 16 {"PriceDESC", Translate("Price high - low")}, 17 {"PriceASC", Translate("Price low - high")} 18 }; 19 20 string sortBy = HttpContext.Current.Request.QueryString.Get("SortBy"); 21 string sortOrder = HttpContext.Current.Request.QueryString.Get("SortOrder"); 22 23 string selectedSort = string.IsNullOrEmpty(sortBy) ? Translate("Default") : Sorts[sortBy + sortOrder]; 24 bool hideSorting = Converter.ToBoolean(Pageview.Area.Item["HideSorting"]); 25 26 Dynamicweb.Content.Items.Item icons = Dynamicweb.Content.Items.Item.GetItemById("Icons", Pageview.Area.Item["Icons"].ToString()); 27 string cartIcon = icons["CartIcon"] != null ? icons["CartIcon"].ToString() : "fas fa-shopping-cart"; 28 29 var navigationMarkup = RenderNavigation(new 30 { 31 id = "leftnav", 32 cssclass = "dwnavigation", 33 startLevel = 1, 34 endlevel = 5, 35 template = "LeftNavigationEcom.xslt" 36 }); 37 } 38 39 <form name="multiForm" id="multiForm" method="post"> 40 <input type="hidden" name="CartCmd" id="CartCmd" value="addMulti" /> 41 <div class="grid grid--external-bleed grid--align-content-start"> 42 @if (Pageview.Page.PropertyItem["LeftMenu"].ToString() == "True" && Pageview.Page.NavigationSettings.UseEcomGroups) 43 { 44 <div class="grid__col-3 grid__col--bleed-x"> 45 <h2>@Translate("Product categories")</h2> 46 47 <div class="u-padding-bottom--lg"> 48 @navigationMarkup 49 </div> 50 </div> 51 } 52 53 <div class="grid__col-auto grid__col--bleed-x"> 54 <div class="grid__cell"> 55 <div class="u-pull--left u-margin-left"> 56 <h2>@listHeader</h2> 57 </div> 58 @if (!hideSorting) 59 { 60 <div class="collection u-pull--right u-no-margin u-margin-right"> 61 <h5 class="u-inline-block u-margin-right">@Translate("Sort by")</h5> 62 <input type="checkbox" id="ProductSort" class="dropdown-trigger" /> 63 <div class="dropdown u-w150px u-margin-right u-inline-block dw-mod"> 64 <label class="dropdown__header dropdown__btn dropdown__btn--small dw-mod" for="ProductSort">@selectedSort</label> 65 <div class="dropdown__content dw-mod"> 66 <div class="dropdown__item" onclick="window.location = '/Default.aspx?ID=@pageId'">@Translate("Default")</div> 67 <div class="dropdown__item" onclick="window.location = '/Default.aspx?ID=@pageId&SortBy=Created&SortOrder=DESC'">@Translate("Newest")</div> 68 <div class="dropdown__item" onclick="window.location = '/Default.aspx?ID=@pageId&SortBy=Price&SortOrder=ASC'">@Translate("Price low - high")</div> 69 <div class="dropdown__item" onclick="window.location = '/Default.aspx?ID=@pageId&SortBy=Price&SortOrder=DESC'">@Translate("Price high - low")</div> 70 <div class="dropdown__item" onclick="window.location = '/Default.aspx?ID=@pageId&SortBy=NameForSort&SortOrder=ASC'">@Translate("A - Z")</div> 71 <div class="dropdown__item" onclick="window.location = '/Default.aspx?ID=@pageId&SortBy=NameForSort&SortOrder=DESC'">@Translate("Z - A")</div> 72 </div> 73 <label class="dropdown-trigger-off" for="ProductSort"></label> 74 </div> 75 </div> 76 } 77 78 <div class="grid product-list dw-mod"> 79 @foreach (LoopItem product in GetLoop("Products")) 80 { 81 string uniqueId = product.GetString("Ecom:Product.ID") + product.GetString("Ecom:Product.VariantID"); 82 string onSale = !Converter.ToBoolean(Pageview.Area.Item["EnableSaleTags"]) || product.GetString("Ecom:Product.Discount.Price.PriceFormatted") == product.GetString("Ecom:Product.Price.PriceFormatted") ? "u-hidden" : ""; 83 string newSticker = Pageview.Area.Item["NewStickersEnable"].ToString() == "True" && product.GetDate("Ecom:Product.Created").AddDays(Converter.ToDouble(Pageview.Area.Item["NewStickersExpiration"])) > DateTime.Now ? "" : "u-hidden"; 84 string link = "/" + product.GetString("Ecom:Product.LinkGroup.Clean") + (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product.VariantID")) ? "&VariantID=" + product.GetString("Ecom:Product.VariantID") : ""); 85 bool hasVariants = product.GetLoop("VariantGroups").Count > 0 ? true : false; 86 string price = product.GetString("Ecom:Product.Discount.Price.PriceFormatted") != product.GetString("Ecom:Product.Price.PriceFormatted") ? product.GetString("Ecom:Product.Discount.Price.PriceFormatted") : product.GetString("Ecom:Product.Price.PriceFormatted"); 87 string discount = product.GetString("Ecom:Product.Discount.Price.PriceFormatted") != product.GetString("Ecom:Product.Price.PriceFormatted") ? product.GetString("Ecom:Product.Price.PriceFormatted") : ""; 88 bool hasUnits = product.GetLoop("Units").Count > 0 ? true : false; 89 90 <input type="hidden" name="ProductLoopCounter@uniqueId" value="@uniqueId" /> 91 <input type="hidden" name="ProductID@uniqueId" value="@product.GetString("Ecom:Product.ID")" /> 92 <div class="grid product-list__list-item dw-mod"> 93 @if (!string.IsNullOrEmpty(product.GetString("Ecom:Product.ImageLarge.Default.Clean"))) 94 { 95 <div class="grid__col-md-4 product-list__list-item__left dw-mod"> 96 <div class="grid__cell"> 97 <div class="stickers-container dw-mod"> 98 <div class="stickers-container__tag stickers-container__tag--new @newSticker dw-mod">@Translate("New!")</div> 99 <div class="stickers-container__tag stickers-container__tag--sale @onSale dw-mod">@Translate("Sale!")</div> 100 </div> 101 <a href="@link" onclick="Scroll.SavePosition(event)"><img class="grid__cell-img grid__cell-img--centered b-lazy" src="/Files/Images/placeholder.gif" data-src="/Admin/Public/GetImage.ashx?width=300&amp;height=300&amp;crop=5&amp;Compression=75&amp;DoNotUpscale=true&amp;image=@product.GetString("Ecom:Product.ImageLarge.Default.Clean")" alt="@product.GetString("Ecom:Product.Name")" /></a> 102 </div> 103 </div> 104 } 105 <div class="grid__col-md-auto product-list__list-item__right dw-mod"> 106 <div> 107 <div class="u-pull--left"> 108 <a href="@link" onclick="Scroll.SavePosition(event)" title="@product.GetString("Ecom:Product.Name")"><h2>@product.GetString("Ecom:Product.Name")</h2></a> 109 <div class="item-number dw-mod">@product.GetString("Ecom:Product.Number")</div> 110 </div> 111 @*@if (!hasVariants || !hasUnits) 112 { 113 <div id="Favorite" data-template="FavoriteTemplate" class="favorites u-pull--right dw-mod"></div> 114 }*@ 115 </div> 116 117 <div class="grid__cell"> 118 @product.GetString("Ecom:Product.ShortDescription") 119 </div> 120 @if (!onlyPreview) 121 { 122 <div class="grid__cell-footer"> 123 <div class="grid__cell"> 124 <div class="product-list__list-item__price-actions dw-mod"> 125 <div class="u-margin-bottom"> 126 <div class="before-price @onSale dw-mod">@discount</div> 127 <div class="price dw-mod">@price</div> 128 </div> 129 <div class="buttons-collection buttons-collection--right"> 130 @if (!hasVariants || !hasUnits) 131 { 132 <button type="button" id="CartButton_@product.GetString("Ecom:Product.ID")" class="btn btn--primary btn--condensed u-pull--right dw-mod" name="submit" onclick="Cart.AddToCart(event, '@product.GetString("Ecom:Product.ID")', document.getElementById('Quantity_@product.GetString("Ecom:Product.ID")').value, 'Unit_@product.GetString("Ecom:Product.ID")', 'Variant_@product.GetString("Ecom:Product.ID")');"><i class="@cartIcon"></i><span class="u-hidden-xs u-hidden-xxs"> @Translate("Add to cart")</span></button> 133 } 134 else 135 { 136 <a href="@link" id="CartButton_@product.GetString("Ecom:Product.ID")" class="btn btn--secondary btn--full u-no-margin dw-mod">@Translate("View")</a> 137 } 138 <input type="number" class="u-w80px u-pull--right" id="Quantity_@product.GetString("Ecom:Product.ID")" name="Quantity@uniqueId" value="1" min="1"> 139 140 <input type="checkbox" id="UnitOptions_@product.GetString("Ecom:Product.ID")" class="dropdown-trigger" /> 141 <input type="hidden" value="@uniqueId" name="Unit@uniqueID" id="Unit_@product.GetString("Ecom:Product.ID")" /> 142 <input type="hidden" value="@product.GetString("Ecom:Product.VariantID")" name="VariantID@uniqueID" id="Variant_@product.GetString("Ecom:Product.ID")" /> 143 </div> 144 </div> 145 </div> 146 </div> 147 } 148 else 149 { 150 <button type="button" id="CartButton_@product.GetString("Ecom:Product.ID")" class="u-hidden"></button> 151 } 152 </div> 153 </div> 154 155 } 156 </div> 157 </div> 158 </div> 159 160 <div class="grid__col-12 u-margin-top"> 161 <div class="pager"> 162 <div class="pager__info"> 163 @Translate("Page") @GetValue("Ecom:ProductList.CurrentPage") @Translate("of") @GetValue("Ecom:ProductList.TotalPages") 164 </div> 165 <ul class="pager__list"> 166 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:ProductList.PrevPage.Clean"))) 167 { 168 <li class="pager__btn"> 169 <a href="@GetString("Ecom:ProductList.PrevPage.Clean")" class="pager__num dw-mod"><i class="fas fa-angle-left"></i></a> 170 </li> 171 } 172 173 @foreach (LoopItem page in GetLoop("Ecom:ProductList.Pages")) 174 { 175 bool isActive = page.GetBoolean("Ecom:ProductList.Pages.Page.IsCurrent"); 176 <li class="pager__btn"> 177 @if (isActive) 178 { 179 <span class="pager__num pager__num--current dw-mod"> 180 @page.GetValue("Ecom:ProductList.Pages.Page.Number") 181 </span> 182 } 183 else 184 { 185 <a href="@page.GetString("Ecom:ProductList.Pages.Page.Url")" class="pager__num dw-mod"> 186 @page.GetValue("Ecom:ProductList.Pages.Page.Number") 187 </a> 188 } 189 </li> 190 } 191 192 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:ProductList.NextPage.Clean"))) 193 { 194 <li class="pager__btn"> 195 <a href="@GetString("Ecom:ProductList.NextPage.Clean")" class="pager__num dw-mod"><i class="fas fa-angle-right"></i></a> 196 </li> 197 } 198 </ul> 199 </div> 200 </div> 201 </div> 202 </form>

TILMELD DIG JUULS VIN & SPIRITUS NYHEDSBREV OG GÅ IKKE GLIP AF SPÆNDENDE NYHEDER, INFORMATION OM EVENTS OG EN MASSE GODE TILBUD.