0
Din indkøbskurv

Opdaterer kurv

stk. a

-
+

Din kurv i alt (ex. fragt)

Handel videre

Gå til kassen
Dankort VISA VISA Elektron American express Santander Mobilepay
Find forhandler

,

Tlf.

Se alle

Error executing template "Designs/Mobler2018/eCom/Productlist/Productlist.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_37928c2b9eec41faba01eb29c6de39d5.Execute() in D:\dynamicweb.net\Solutions\mobler.LIVE\Files\Templates\Designs\Mobler2018\eCom\Productlist\Productlist.cshtml:line 49
   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.<RunCompile>b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
   at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @using Mobler.Website.CustomModules.MoblerHelpers 2 @using System.Text.RegularExpressions 3 @using Dynamicweb 4 @using Dynamicweb.Admin 5 @using Group = Dynamicweb.Ecommerce.Products.Group 6 @using Services = Dynamicweb.Ecommerce.Services 7 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 8 9 @{ 10 string GroupName = GetString("Ecom:Group.Name"); 11 string GroupId = GetString("Ecom:Group.ID"); 12 string GroupImage = GetString("Ecom:Group.LargeImage"); 13 string GroupDescription = GetString("Ecom:Group.Description").Replace("||", "<br/>"); 14 bool HideSubgroups = GetBoolean("Ecom:Group:Field.FirstwebDoNotRenderSubgroups"); 15 string uspProductlistLink = GetString("Ecom:Group:Field.uspproductlistlink"); 16 int uspPageId = 0; 17 if ( uspProductlistLink != "" ) 18 { 19 uspPageId = Int32.Parse( uspProductlistLink.Substring( uspProductlistLink.LastIndexOf( '=' ) + 1 ) ); 20 } 21 var ProductLoop = GetLoop("Products"); 22 bool NoProducts = ProductLoop.Count == 0 ? true : false; 23 var RelatedBlogs = Firstweb.Custom.CustomCode.Frontend.Helpers.Blogs.GetBlogsRelatedToGroup(GroupId); 24 int BlogCount = RelatedBlogs.Count; 25 int ProductCount = ProductLoop.Count; 26 int RenderedBlogs = 0; 27 int RenderedProducts = 0; 28 System.Web.HttpContext.Current.Items["OverrideOgTags"] = true; 29 bool isGroupList = String.IsNullOrEmpty(GroupId) ? false : true; 30 var RelevantGroupFacets = Firstweb.EcomFilterManagement.Frontend.Helper.GetEcomGroupFilters(GroupId).OrderBy(x => x.Sorting).ToList(); 31 var ParentGroups = Firstweb.Custom.CustomCode.Frontend.Helpers.EcomGroups.getBreadCrumbGroupList(GroupId); 32 var SubGroups = Firstweb.Custom.CustomCode.Frontend.Helpers.EcomGroups.GetSubgroups(GroupId); 33 var hasSubGroupsInitially = SubGroups.Any(); 34 if (SubGroups.Count > 4) 35 { 36 SubGroups = SubGroups.ToList(); 37 } 38 39 if ( !hasSubGroupsInitially ) 40 { 41 foreach ( var parentGroup in ParentGroups ) 42 { 43 if ( parentGroup.Subgroups.Any( g => g.Id.Equals( GroupId ) ) ) 44 { 45 SubGroups = parentGroup.Subgroups.ToList(); 46 } 47 } 48 } 49 bool grp = Services.ProductGroups.GetGroup( GroupId ).Subgroups.Any(); 50 51 var PageId = Dynamicweb.Frontend.PageView.Current().ID; 52 53 string QuickDeliveryDescription = Firstweb.Custom.CustomCode.Frontend.Helpers.AreaItems.GetString("QuickDeliveryDescription"); 54 string NormalDeliveryDescription = Firstweb.Custom.CustomCode.Frontend.Helpers.AreaItems.GetString("NormalDeliveryDescription"); 55 int TotalPages = GetInteger("Ecom:ProductList.TotalPages"); 56 int CurrentPage = GetInteger("Ecom:ProductList.CurrentPage"); 57 } 58 59 @SnippetStart("OgTags") 60 <meta property="og:type" content="product.group" /> 61 <meta property="og:description" content="@Regex.Replace(GroupDescription, "<.*?>", String.Empty)" /> 62 <meta property="og:image" content="@GroupImage" /> 63 @SnippetEnd("OgTags") 64 65 @using System.Collections 66 @using Dynamicweb.Core 67 @using Dynamicweb.Ecommerce 68 @using Mobler.Website.CustomModules.MoblerHelpers 69 @using Dynamicweb.Ecommerce.Products 70 @using Dynamicweb.Ecommerce.Variants 71 @using Humanizer 72 @using Mobler.Website.CustomCode 73 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 74 75 @using Mobler.Website.CustomModules.MoblerHelpers 76 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 77 78 @helper RenderPricing(LoopItem product, bool hasVariants) 79 { 80 // Theming 81 string blackFridayTheme = Firstweb.Custom.CustomCode.Frontend.Helpers.AreaItems.GetString("BlackFridayTheme"); 82 83 // Pricing 84 DateTime newItemExpiryDate = product.GetDate( "Ecom:Product:Field.NewItemExpiryDate" ); 85 bool hasNewItemExpiryDate = newItemExpiryDate.Date > DateTime.Now.Date; 86 bool newItem = product.GetBoolean("Ecom:Product:Field.NewItem") && hasNewItemExpiryDate; 87 bool LowPrice = product.GetBoolean("Ecom:Product:Field.Splash3"); 88 double CostPrice = product.GetDouble("Ecom:Product:Field.FirstwebCostPrice.Value.Raw"); 89 string PriceSaving = product.GetString("Ecom:Product:Field.Spar.Value"); 90 double ActualPrice = product.GetDouble("Ecom:Product.Price.Price"); 91 92 // Initialize variables 93 double spar = 0; 94 double price = 0; 95 double normalPrice = 0; 96 97 string priceFormatted = ""; 98 string sparFormatted = ""; 99 string normalPriceFormatted = ""; 100 101 string campaignColor = ""; 102 string campaignText = ""; 103 string campaignDate = ""; 104 105 bool CampaignActiveOnProduct = product.GetBoolean("CampaignModule:Product.CampaignActiveOnProduct"); 106 bool IsLocalWebshopProduct = (Mobler.Website.CustomCode.Frontend.Helper.IsLocalWebshop() && !product.GetBoolean("Ecom:Product:Field.SystemIsMasterShopProduct")); 107 108 if (!CampaignActiveOnProduct && !IsLocalWebshopProduct) 109 { 110 price = ActualPrice; 111 priceFormatted = MoblerHelpers.formatPrice(price); 112 } 113 else if (IsLocalWebshopProduct) 114 { 115 price = ActualPrice; 116 priceFormatted = MoblerHelpers.formatPrice(price); 117 118 normalPrice = product.GetDouble("Ecom:Product:Field.ForPris"); 119 normalPriceFormatted = MoblerHelpers.formatPrice(normalPrice); 120 121 spar = product.GetDouble("Ecom:Product:Field.Spar"); 122 sparFormatted = MoblerHelpers.formatPrice(spar); 123 124 bool SplashLwCombiPrice = product.GetBoolean("Ecom:Product:Field.SplashLwCombiPrice"); 125 DateTime SplashLwCombiPriceExpiryDate = product.GetDate("Ecom:Product:Field.SplashLwCombiPriceExpiryDate"); 126 127 if (SplashLwCombiPrice && (SplashLwCombiPriceExpiryDate == DateTime.MinValue || SplashLwCombiPriceExpiryDate > DateTime.Now)) 128 { 129 campaignText = "KOMBI"; 130 } 131 } 132 else 133 { 134 normalPrice = product.GetDouble("CampaignModule:Product.CampaignProduct.NormalPrice"); 135 normalPriceFormatted = product.GetString("CampaignModule:Product.CampaignProduct.NormalPrice.FormattedRetail"); 136 137 price = product.GetDouble("CampaignModule:Product.CampaignProduct.CampaignPrice"); 138 priceFormatted = product.GetString("CampaignModule:Product.CampaignProduct.CampaignPrice.FormattedRetail"); 139 140 spar = product.GetDouble("CampaignModule:Product.CampaignProduct.DiscountAmount"); 141 sparFormatted = product.GetString("CampaignModule:Product.CampaignProduct.DiscountAmount.FormattedRetail"); 142 143 campaignColor = product.GetString("CampaignModule:Product.Campaign.Color"); 144 campaignText = product.GetString("CampaignModule:Product.Campaign.Text"); 145 } 146 147 // Set Splash Types 148 string splashType = ""; 149 if (campaignText == "KOMBI") 150 { 151 splashType = "combo"; 152 } 153 else if (CostPrice > 0) 154 { 155 splashType = "priceshape"; 156 } 157 else if (spar > 0) 158 { 159 splashType = "offer"; 160 } 161 else if (newItem) 162 { 163 splashType = "new"; 164 } 165 else if (LowPrice) 166 { 167 splashType = "low"; 168 } 169 170 <div> 171 <p class="product-item__price fs3 font-weight-bold"> 172 @if (hasVariants) 173 { 174 <span class="font-weight-semibold fs0 mr-2">@Translate("ProductPrice.From", "Fra")</span> 175 } 176 @priceFormatted 177 </p> 178 @if (splashType == "combo") 179 { 180 <div class="splash splash--on-top"> 181 <p class="m-0">@Translate("ProductCombinationOffer", "Sætpris")</p> 182 </div> 183 <div class="d-flex justify-content-between mb-2"> 184 <p class="color-subtle fs0 m-0 text-uppercase">@Translate("PriceBeforeCombo", "Før") @normalPriceFormatted</p> 185 <p class="splash fs0 text-uppercase m-0 px-2">@Translate("PriceSaving", "Spar") @sparFormatted</p> 186 </div> 187 } 188 else if (splashType == "priceshape") 189 { 190 string DailyPriceBackgroundColor = Firstweb.Custom.CustomCode.Frontend.Helpers.AreaItems.GetString("AktuelDagsprisBackgroundColor"); 191 string DailyPriceTextColor = Firstweb.Custom.CustomCode.Frontend.Helpers.AreaItems.GetString("AktuelDagsprisTextColor"); 192 193 <div class="splash splash--on-top price-shape" style="background-color: @DailyPriceBackgroundColor"> 194 <p class="m-0" style="color: @DailyPriceTextColor;">@Translate("ProductDailyPriceSplash", "Dagspris")</p> 195 </div> 196 } 197 else if (splashType == "offer") 198 { 199 if (blackFridayTheme == "True") 200 { 201 <div class="splash splash--on-top bf-bg-black bf-color-white"> 202 <p class="m-0">@Translate("ProductOffer", "Tilbud")</p> 203 </div> 204 } 205 else 206 { 207 <div class="splash splash--on-top p-1"> 208 <p class="m-0">@Translate("ProductOffer", "Tilbud")</p> 209 </div> 210 } 211 <div class="d-flex justify-content-between mb-2"> 212 <p class="color-subtle fs0 m-0 text-uppercase">@Translate("PriceBefore", "Før") @normalPriceFormatted</p> 213 <p class="splash fs0 m-0 text-uppercase px-2">@Translate("PriceSaving", "Spar") @sparFormatted</p> 214 </div> 215 } 216 else if (splashType == "new") 217 { 218 <div class="splash splash--on-top p-1 new-item"> 219 <p class="m-0">@Translate("ProductNew", "Nyhed")</p> 220 </div> 221 } 222 else if (splashType == "low") 223 { 224 <div class="splash splash--on-top p-1 low-price"> 225 <p class="m-0">@Translate("ProductLowPrice", "Fast lavpris")</p> 226 </div> 227 } 228 </div> 229 } 230 231 232 @helper RenderProduct(LoopItem product, Boolean powerStep = false) 233 { 234 // Group Specific - Exclude Bed Accessories 235 bool excludeBedAccessories = product.GetBoolean("Ecom:Product.CategoryField.Senge.ExcludeBedAccessories.Value"); 236 237 // Product General Info 238 string productId = product.GetString("Ecom:Product.ID"); 239 string productName = product.GetString("Ecom:Product.Name"); 240 string productLink = product.GetString("Ecom:Product.Link.Clean"); 241 string shortDescription = product.GetString("Ecom:Product.ShortDescription"); 242 string languageId = product.GetString("Ecom:Product.LanguageID"); 243 244 // Variants 245 string defaultVariantId = product.GetString("Ecom:Product.DefaultVariantComboID"); 246 string variantId = product.GetString("Ecom:Product.VariantID"); 247 if (String.IsNullOrEmpty(variantId)) { 248 variantId = defaultVariantId; 249 } 250 if (!String.IsNullOrEmpty(variantId)) { 251 productLink = productLink + "&variantid=" + variantId; 252 } 253 254 // Product Images 255 List<string> images = MoblerHelpers.GetProductImages(productId, variantId); 256 string productImage = string.Format("/Admin/Public/GetImage.ashx?Image={0}&Width=280&height=220&Format=webP&Quality=90&Crop=5&resolution=50", images.FirstOrDefault()); //MoblerHelpers.GetProductListImageWithMainImage(ProductID, ProductNumber); 257 258 // Product Dimensions 259 string productDepth = product.GetString("Ecom:Product:Field.dybdeint.Value.Clean"); 260 string productHeight = product.GetString("Ecom:Product:Field.hoejdeint.Value.Clean"); 261 string productWidth = product.GetString("Ecom:Product:Field.breddeint.Value.Clean"); 262 bool hasProductDepth = !string.IsNullOrWhiteSpace(productDepth) && productDepth != "0"; 263 bool hasProductHeight = !string.IsNullOrWhiteSpace(productHeight) && productHeight != "0"; 264 bool hasProductWidth = !string.IsNullOrWhiteSpace(productWidth) && productWidth != "0"; 265 266 // Campaign 267 string campaignDateStart = ""; 268 string campaignDateEnd = ""; 269 270 bool campaignActiveOnProduct = product.GetBoolean("CampaignModule:Product.CampaignActiveOnProduct"); 271 if (campaignActiveOnProduct) 272 { 273 campaignDateStart = product.GetString("CampaignModule:Product.CampaignProduct.Campaign.Start"); 274 campaignDateEnd = product.GetString("CampaignModule:Product.CampaignProduct.Campaign.End"); 275 } 276 277 bool hasCampaignDateStart = !string.IsNullOrWhiteSpace(campaignDateStart); 278 279 bool hasCampaignDateEnd = !string.IsNullOrWhiteSpace(campaignDateEnd); 280 string campaignText = ""; 281 if (hasCampaignDateStart && hasCampaignDateStart) 282 { 283 campaignText = $"{Translate("Campaign.BeforeDate.Text", "Gældende fra:")} {campaignDateStart} {Translate("Campaign.BeforeDate.Text2", "t.o.m.")} {campaignDateEnd}"; 284 } 285 286 <div class="col-12 col-sm-6 col-lg-3 product-item js-product-list-item"> 287 <div class="product-item__header"> 288 <a href="@productLink" class="product-item__image"> 289 <img class="js-product-image-@productId" src="@productImage" alt="@productName" loading="lazy"/> 290 </a> 291 @{ 292 int colorOptionsToShow = 4; 293 List<string> variantCombinationVariantIds = product.GetLoop("Co3VariantCombinations").Select(p => p.GetString("Ecom:VariantCombination.VariantID")).ToList(); 294 bool hasVariants = false; 295 } 296 @if (variantCombinationVariantIds.Any() && !powerStep) 297 { 298 hasVariants = true; 299 300 <div class="product-item__variants d-flex align-items-center"> 301 @foreach (LoopItem vg in product.GetLoop("VariantGroups")) 302 { 303 int variantOptionWithColorCount = 0; 304 305 @* Only show variants with hex colors *@ 306 foreach (LoopItem variantOption in vg.GetLoop("VariantAvailableOptions")) 307 { 308 <p class="unimportant-hidden">@variantOptionWithColorCount</p> 309 string variantOptionColor = variantOption.GetString("Ecom:VariantOption.ColorHex"); 310 311 // Get count of variants with color 312 if (variantOptionColor.Any()) 313 { 314 variantOptionWithColorCount++; 315 } 316 // Only show this specific amount of variants 317 if (variantOptionColor.Any() && variantOptionWithColorCount < colorOptionsToShow) 318 { 319 // Get variant option id, then compare with variant combinations, to get the link to the specific variant 320 string variantOptionId = variantOption.GetString("Ecom:VariantOption.ID"); 321 string variantIdWithColorOptionId = variantCombinationVariantIds.FirstOrDefault(vid => vid.Contains(variantOptionId)); 322 323 if (variantIdWithColorOptionId.IsNullOrEmpty() == false) 324 { 325 string variantLink = product.GetString("Ecom:Product.Link.Clean") + "&variantid=" + variantIdWithColorOptionId; 326 <a href="@variantLink" class="product-item__variant" style="background-color: @variantOptionColor;"></a> 327 } 328 } 329 else if (variantOptionColor.Any() && variantOptionWithColorCount == colorOptionsToShow) 330 { 331 <a href="@productLink" class="fs2 product-item__more-variants">+</a> 332 } 333 else 334 { 335 break; 336 } 337 } 338 } 339 @if (hasVariants) 340 { 341 <a href="@productLink" class="ml-4 fs-s"> 342 <i class="fas fa-pen mr-1 fs-2"></i> 343 @Translate("Ecom:Product.Pricing.Designer", "Design selv") 344 </a> 345 } 346 </div> 347 } 348 </div> 349 350 <div class="product-item__body"> 351 <a href="@productLink" class="product-item__title"> 352 <h3 class="fs0">@productName</h3> 353 </a> 354 <div class="product-item__description fs0 color-subtle">@shortDescription</div> 355 @if (hasProductDepth && !powerStep || hasProductHeight && !powerStep || hasProductWidth && !powerStep) 356 { 357 <p class="product-item__dimensions fs0 color-subtle"> 358 @if (hasProductDepth) 359 { 360 <span>D/L: @productDepth</span> 361 } 362 @if (hasProductHeight) 363 { 364 <span>H: @productHeight</span> 365 } 366 @if (hasProductWidth) 367 { 368 <span>B: @productWidth</span> 369 } 370 </p> 371 } 372 </div> 373 374 <div class="product-item__footer"> 375 @RenderPricing(product, hasVariants) 376 377 @if (excludeBedAccessories && !powerStep) 378 { 379 <p class="color-subtle fs-s m-0">@Translate("Ecom:Product.Pricing.Excludes.Beds", "Prisen er ekskl. ben og gavl.")</p> 380 } 381 @if (hasVariants && !powerStep) 382 { 383 <div class="variant-price-disclaimer color-subtle fs-s">@Translate("VariantPriceDisclaimer", "Prisen kan variere efter materialevalg")</div> 384 } 385 @if (hasCampaignDateStart && hasCampaignDateEnd && !powerStep) 386 { 387 <div class="product-item__campaign"> 388 <p class="color-subtle fs-s">@campaignText</p> 389 </div> 390 } 391 </div> 392 </div> 393 } 394 395 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 396 397 @helper RenderLoadMore(int totalPages, string queryString) 398 { 399 string loadMoreQueryString = ""; 400 if (!string.IsNullOrEmpty(queryString)) 401 { 402 loadMoreQueryString = "queryString: '" + queryString + "',"; 403 } 404 <div class="col-12 d-flex justify-content-center" id="loadMoreTrigger" data-bind="loadMoreProducts: { totalPages: @totalPages, currentPage: 2, @loadMoreQueryString loadingInformation: LoadingInformation() }"> 405 <p id="load-more-products" class="btn btn-primary m-0 px-4">@Translate("ProductList:LoadMoreButton.Text", "Vis flere produkter")</p> 406 <div class="productlist-loader unimportant-hidden" data-bind="css: { 'd-flex': LoadingInformation().active }"> 407 <p class="fs4 m-0">@Translate("ProductList.LoadingProducts", "Indl&aelig;ser produkter") <i class="fa fa-circle-notch fa-spin ml-3 fs5"></i></p> 408 </div> 409 </div> 410 } 411 412 413 @using Mobler.Website.CustomModules.MoblerHelpers 414 @using Dynamicweb.Ecommerce.Products 415 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 416 417 @helper RenderFilters(string GroupId, List<Firstweb.EcomFilterManagement.Models.EcomGroupFacet> RelevantGroupFacets) 418 { 419 if (!String.IsNullOrEmpty(GroupId)) 420 { 421 <form id="filters-form" class="filters js-filters-form" method="get"> 422 <input type="hidden" name="GroupId" value="@GroupId" /> 423 424 <div class="row accordion" id="collapseGroup"> 425 @foreach (LoopItem facetGroup in GetLoop("FacetGroups")) 426 { 427 foreach (var FacetGroup in RelevantGroupFacets.Where(x => x.FacetSystemName != "Nyhed" && x.FacetSystemName != "Tilbud")) 428 { 429 var facets = facetGroup.GetLoop("Facets").Where(x => x.GetString("Facet.Name") == FacetGroup.FacetSystemName); 430 if (facets.Any()) 431 { 432 var facet = facets.FirstOrDefault(); 433 string FacetName = facet.GetString("Facet.Name"); 434 string QueryParameter = facet.GetString("Facet.QueryParameter"); 435 var FacetOptions = facet.GetLoop("FacetOptions"); 436 <div class="col-6 col-sm-4 mt-3"> 437 438 <div class="filter-drop p-2 d-flex justify-content-between align-items-center pointer" data-toggle="collapse" data-target="#@QueryParameter"> 439 <p class="m-0">@Translate("FacetName." + FacetName, FacetName)</p> 440 <i class="fas fa-chevron-down"></i> 441 </div> 442 <div id="@QueryParameter" class="collapse inputs bg-white" data-parent="#collapseGroup"> 443 <div class="p-2"> 444 <div> 445 @foreach (var fo in FacetOptions) 446 { 447 string OptionName = fo.GetString("FacetOption.Name"); 448 bool OptionSelected = fo.GetBoolean("FacetOption.Selected"); 449 string OptionValue = fo.GetString("FacetOption.Value"); 450 int OptionCount = fo.GetInteger("FacetOption.Count"); 451 string Selected = OptionSelected ? "checked" : ""; 452 string CapitalizeClass = FacetName == "FMærkevarer" ? "text-capitalize" : ""; 453 <div> 454 <label class="custom-checkbox mb-2 @CapitalizeClass" data-toggle="collapse" data-target="#@QueryParameter"> 455 <input type="checkbox" name="@QueryParameter" value="@OptionValue" @Selected /> 456 <span class="checkbox"> 457 <i class="fas fa-check color-primary icon"></i> 458 </span> 459 <span class="label"> 460 <span>@OptionName (@OptionCount)</span> 461 </span> 462 </label> 463 </div> 464 } 465 </div> 466 </div> 467 </div> 468 469 </div> 470 } 471 } 472 } 473 474 <div class="col-6 d-flex mt-3"> 475 @foreach (LoopItem facetGroup in GetLoop("FacetGroups")) 476 { 477 var facets = facetGroup.GetLoop("Facets").Where(x => x.GetString("Facet.Name") == "Nyhed"); 478 foreach (var facet in facets) 479 { 480 foreach (LoopItem option in facet.GetLoop("FacetOptions")) 481 { 482 var value = option.GetValue("FacetOption.Value"); 483 var selected = ""; 484 var label = facet.GetString("Facet.Name"); 485 var count = option.GetInteger("FacetOption.Count"); 486 if (option.GetBoolean("FacetOption.Selected")) 487 { 488 selected = "checked"; 489 } 490 if (option.GetString("FacetOption.Label") != "False") 491 { 492 <label class="custom-checkbox mb-0 mr-3 mr-md-5"> 493 <input type="checkbox" name="@facet.GetString("Facet.Name")" value="@value" @selected /> 494 <span class="checkbox"> 495 <i class="fas fa-check color-primary icon"></i> 496 </span> 497 <span class="label"> 498 <span>@label (@count)</span> 499 </span> 500 </label> 501 } 502 } 503 } 504 } 505 506 </div> 507 508 </div> 509 510 </form> 511 } 512 } 513 514 @using Mobler.Website.CustomModules.MoblerHelpers 515 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 516 517 @helper RenderBlogTeaser(Firstweb.Custom.CustomCode.Frontend.Helpers.Blog Blog) 518 { 519 string PageId = GetGlobalValue( "Global:Page.ID" ); 520 string CleanLink = Blog.Link.Replace("default.aspx?id", "Default.aspx?Id"); 521 <div class="col-12 col-md-4 px-0 px-md-3 mb-4"> 522 <a href="@CleanLink" class="blog d-block"> 523 <div class="image" style="background-image:url('@Blog.Image')"> 524 <img class="d-none" src="@Blog.Image" alt="Alternate Text" /> 525 </div> 526 <div class="text"> 527 <div class="positioning"> 528 <h4 class="col-10 col-md-9 px-2 pt-3 bg-white font-weight-bold text-center mx-auto">@Blog.Header</h4> 529 @if ( PageId != "7613" ) 530 { 531 <p class="text-center color-subtle">@Blog.Date</p> 532 } 533 <p class="text-center font-weight-bold m-0 color-primary">@Translate("BlogReadMore", "L&aelig;s mere her")</p> 534 </div> 535 </div> 536 </a> 537 </div> 538 } 539 540 @helper RenderLargeBlogTeaser(Firstweb.Custom.CustomCode.Frontend.Helpers.Blog Blog, string ImagePosition) 541 { 542 string ImageClass = ImagePosition == "Left" ? "" : "offset-md-4"; 543 string TextClass = ImagePosition == "Left" ? "" : "left"; 544 string Image = "/Admin/Public/GetImage.ashx?Image=" + Blog.Image + "&Format=webP&Quality=90&Height=400&Crop=0"; 545 string CleanLink = Blog.Link.Replace("default.aspx?id", "Default.aspx?Id"); 546 <div class="col-12 blog"> 547 <div class="row"> 548 <div class="col-12 col-md-8 px-0 px-md-3 @ImageClass"> 549 <div class="image-container" style="background-image:url('@Image')"> 550 <img class="img-fluid" src="@Image" alt="@Blog.Header" /> 551 </div> 552 </div> 553 <div class="col-12 col-md-6 text-container mb-5 mb-md-0 @TextClass"> 554 <div class="text bg-white p-3"> 555 <div> 556 <h4>@Blog.Header</h4> 557 @Blog.Teaser 558 </div> 559 <a class="font-weight-bold" href="@CleanLink">@Translate("BlogReadMore", "L&aelig;s mere her")</a> 560 </div> 561 </div> 562 </div> 563 </div> 564 } 565 566 @helper RenderLatestBlogsTeasers() 567 { 568 var LatestBlogs = Firstweb.Custom.CustomCode.Frontend.Helpers.Blogs.GetLatestBlogs(); 569 foreach (var Blog in LatestBlogs) 570 { 571 @RenderBlogTeaser(Blog) 572 } 573 } 574 575 576 <div class="container d-none d-md-block"> 577 <div class="bread"> 578 <p class="color-subtle">@Translate("Breadcrumb.CurrentPage", "Her er du:")</p> 579 <p class="bread-item color-subtle"> 580 <a href="/"> 581 @Translate("Breadcrumb.Frontpage", "Forside") 582 </a> 583 </p> 584 @foreach (var Group in ParentGroups) 585 { 586 <p class="bread-item color-subtle"> 587 @if (Group == ParentGroups.First()) 588 { 589 @Group.Name 590 } 591 else 592 { 593 <a href="/Default.aspx?Id=@PageId&GroupId=@Group.Id"> 594 @Group.Name 595 </a> 596 } 597 </p> 598 } 599 600 <p class="active color-subtle">@GroupName</p> 601 </div> 602 </div> 603 604 <div class="groups my-5 container @(!hasSubGroupsInitially ? "d-none d-lg-flex" : "")"> 605 @if (SubGroups.Any() && !HideSubgroups) 606 { 607 foreach (Group group in SubGroups) 608 { 609 var TopLevelGroup = Firstweb.Custom.CustomCode.Frontend.Helpers.EcomGroups.GetTopLevelGroup(group); 610 string linkDestination = group.ProductGroupFieldValues.GetProductGroupFieldValue("LinkToGroupsPrimaryPosition").HasValue && !string.IsNullOrEmpty(group.ProductGroupFieldValues.GetProductGroupFieldValue("LinkToGroupsPrimaryPosition").Value.ToString()) ? group.ProductGroupFieldValues.GetProductGroupFieldValue("LinkToGroupsPrimaryPosition").Value.ToString() : "/" + TopLevelGroup.Meta.PrimaryPage + "&GroupID=" + group.Id; 611 string name = group.Name; 612 string image = ""; 613 if (!string.IsNullOrEmpty(group.SmallImage)) 614 { 615 image = "/files/" + group.SmallImage; 616 } 617 if (!string.IsNullOrEmpty(image)) 618 { 619 <div class="groups__group text-center @(group.Id.Equals(GroupId) || grp ? "active" : "")"> 620 <a href="@linkDestination"> 621 <img src="@image" alt="@name" class="img-fluid"/> 622 <p class="mt-2 mb-0">@name</p> 623 </a> 624 </div> 625 } 626 } 627 } 628 </div> 629 630 <div data-bind="viewModel: 'ProductListViewModel'"> 631 632 <div class="container mb-5"> 633 634 <div class="delivery-information-popup" data-bind="css: { 'd-flex': QuickDeliveryInfoOpen }, click: ToggleQuickDeliveryInfo"> 635 <div class="description-content bg-white px-3 py-4 px-lg-4 position-relative" data-bind="click: OpenQuickDeliveryInfo, clickBubble: false"> 636 <div class="modal-closer-custom" data-bind="click: ToggleQuickDeliveryInfo, clickBubble: false"> 637 <img src="/Files/Templates/Designs/Mobler2018/assets/img/icons/close.svg" /> 638 </div> 639 <div> 640 @QuickDeliveryDescription 641 </div> 642 </div> 643 </div> 644 <div class="delivery-information-popup" data-bind="css: { 'd-flex': NormalDeliveryInfoOpen }, click: ToggleNormalDeliveryInfo"> 645 <div class="description-content bg-white px-3 py-4 px-lg-4 position-relative" data-bind="click: OpenNormalDeliveryInfo, clickBubble: false"> 646 <div class="modal-closer-custom" data-bind="click: ToggleNormalDeliveryInfo, clickBubble: false"> 647 <img src="/Files/Templates/Designs/Mobler2018/assets/img/icons/close.svg" /> 648 </div> 649 <div> 650 @NormalDeliveryDescription 651 </div> 652 </div> 653 </div> 654 <div class="d-flex align-items-center"> 655 <h1 class="">@GroupName</h1> 656 </div> 657 <div class="group-description mb-2 d-none d-md-block"> 658 @GroupDescription 659 </div> 660 </div> 661 662 <div class="container" data-bind="viewModel: 'ProductListViewModel'"> 663 <div class="js-filters-area"> 664 @RenderFilters(GroupId, RelevantGroupFacets) 665 </div> 666 667 @if ( uspPageId != 0 ) 668 { 669 <div data-bind="universe: { target: '#js-product-list' }"> 670 @RenderPageContent( uspPageId ) 671 </div> 672 } 673 674 <div class="row" id="js-product-list"> 675 @foreach (LoopItem Product in ProductLoop) 676 { 677 RenderedProducts++; 678 679 @RenderProduct(Product) 680 if (RenderedProducts == 12 && BlogCount > 0 && RenderedBlogs == 0) 681 { 682 <div class="feature-blogs col-12 my-5 js-productlist-blogs"> 683 <div class="row"> 684 @foreach (var Blog in RelatedBlogs) 685 { 686 if (RenderedBlogs < 1) 687 { 688 @RenderLargeBlogTeaser(Blog, "Left") 689 RenderedBlogs++; 690 } 691 } 692 </div> 693 </div> 694 } 695 } 696 697 @RenderLoadMore(TotalPages, "") 698 699 @if (NoProducts) 700 { 701 <div class="col-12"> 702 <p class="fs4 font-weight-bold">@Translate("ProductListNoProducts", "Der er ingen produkter at vise")</p> 703 </div> 704 } 705 </div> 706 707 @if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.GrpupDescriptionBottom"))) 708 { 709 <div class="group-description my-5">@GetString("Ecom:Group:Field.GrpupDescriptionBottom")</div> 710 if (!String.IsNullOrEmpty( GetString("Ecom:Group:Field.GroupDescriptionBottomFoldout")) ) 711 { 712 <p><a aria-controls="collapse" aria-expanded="false" class="btn btn-primary" data-toggle="collapse" href="#collapse" role="button">@Translate("CollapseShowMore", "Vis mere")</a></p> 713 <div class="collapse" id="collapse"> 714 <div class="card card-body"> 715 <div class="group-description my-5">@GetString("Ecom:Group:Field.GroupDescriptionBottomFoldout")</div> 716 </div> 717 </div> 718 } 719 } 720 721 @if (RenderedBlogs < BlogCount) 722 { 723 string ImagePosition = "Left"; 724 int NewBlogCounter = 0; 725 <div class="feature-blogs my-5"> 726 <div class="row"> 727 @foreach (var Blog in RelatedBlogs) 728 { 729 if (NewBlogCounter >= RenderedBlogs) 730 { 731 @RenderLargeBlogTeaser(Blog, ImagePosition) 732 if (ImagePosition == "Left") 733 { 734 ImagePosition = "Right"; 735 } 736 else 737 { 738 ImagePosition = "Left"; 739 } 740 } 741 NewBlogCounter++; 742 } 743 </div> 744 </div> 745 } 746 </div> 747 </div> 748