Familiehygge i bolig

Et hjem uten radon

Publisert den: 28-05-2020.

Det er ingen tvil om at ventilasjon er viktig for et godt inneklima, men huset ditt kan ventileres både mekanisk og naturlig. Vi har laget en guide, så du kan se fordelene og ulempene med begge metodene. 

Ventilasjon er viktig, ettersom du kan få hodepine, oppleve tretthet og få astma hvis inneklimaet er dårligt. Hvis du bor nærme trafikkerte veier, skipstrafikk eller i nærheten av vedovner, så kan luften utenfor vinduet ditt være forurenset. Men du forurenser også luften når du oppholder deg i boligen din. De små hverdagslige tingene som å lage mat, dusje og vaske tøy, forurenser luften i boligen din. 
 
Det er derfor viktig å ha fokus på et sunt og godt inneklima, så deg og familien din ikke blir syke. Behovet for ventilasjon kommer an på flere forhold. F.eks. hvor mange mennesker som bor i huset og hvor stort huset er. Hvis dere er mange mennesker på liten plass, er behovet for ventilasjon større.  

Er du usikker på hvordan du nedbringer radonnivået i boligen din eller hvilket filter som passer i anlegget dit? Så kan du kontakt våre flinke filtereksperter her.

Radon stiger opp fra overflaten og er en usynlig risiko for deg og din familie, spesielt i vinterhalvåret. Radon er luktfri, kan ikke ses eller smakes, men den er der. Mengde og konsentrasjon avhenger av været, hvor du bor og boligen din.

Hvis huset ditt har lekkasjer i fundamentet, stiger radon gjennom basen og fundamentet. Små sprekker og revner lukker det kreftfremkallende radonet i hjemmet ditt. Tidligere ble det feilaktig antatt at radon bare var et problem i kjellere, men det er dessverre ikke tilfellet. Alle bør undersøke radonnivået i hjemmet.

 

Mål radonnivået – enkelt og greit 


Det har førhen været en længere proces at foretage en Tidligere har det vært en lang prosess å få målt radonnivået, men ikke lengere! 
Med Airthings Wave – en avansert radonmåler – kan du måle radonnivået enkelt og greit. Du vinker til Airthings som så viser fargen ”grønn”, ”gul” eller ”rød”. Hvor grønn symboliserer et godt og sundt inneklima, og rød et dårligt. 
 
Vil du ha en mer detaljert måling, så kan du gå inn på appen å se radonnivået, luftfuktigheten og CO2 nivået i din bolig. 
 
Du kan sette opp flere målere i boligen din, og f.eks. måle nivået i kjelleren og på første etasje. Les mer om Airthings her.

equipment-pressure-measure

Nedbring radonnivået i boligen din

Selv om et høyt radonnivå ofte henger sammen med et dårlig inneklima, er det ikke nok kun å lufte. 
 
For at nedbringe radon er det viktig å tette gulvkonstruktioner, hulrom i vegger og andre revner hvor radon kan sive opp fra undergrunnen. 
I tillegg er det viktig at huset ditt er ventileres riktig. Filterhuset anbefaler alltid mekanisk ventilasjon, som er mer effektiv og sikker – Og du slipper for varmetap. Mekanisk ventilasjon kan også hjelpe med fuktproblemer i boligen. 

 
Et ventilasjonsanlegg suger luften ut av boligen og blåser ny luft inn. På den måten er det et konstant og kontrollert luftbytte. Før luften kommer inn i boligen filtreres den gjennom et filter som sikrer at luften er ren og sikker. 

temperature-down

Test inneklimaet med en radonmåler 

Airthings Wave

Airthings Wave er en avansert Radonmåler som måler radonnivå, luftfuktighet og temperatur i boligen din. Målingene blir lagret, og kan ses i appen på din smartphone. Hvis radonnivået blir for høyt kommer det en alarm som advarer deg i tide. Airthings advarer med farger om du har grønt, gult eller rødt radon nivå.

Error executing template "Designs/danfilter/eCom/Productlist/espresso.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at Dynamicweb.Ecommerce.LiveIntegration.Products.PriceManager.ProcessResponse(XmlDocument response)
at Dynamicweb.Ecommerce.LiveIntegration.Products.PriceManager.FetchQuantityPrices(Product product)
at Co3.Danfilter.Website.Services.ProductService.GetPrices(Product product, PriceType priceType) in C:\Users\csv\Documents\Git_Co3\danfilter\Co3.Danfilter.Website\Services\ProductService.cs:line 41
at CompiledRazorTemplates.Dynamic.RazorEngine_11a7c5531e71459588b75788577fcf86.<>c__DisplayClass16_0.<ProductlistItem>b__0(TextWriter __razor_helper_writer) in E:\Dynamicweb.NET\Solutions\danfilter.espresso4.dk\files\Templates\Designs\danfilter\eCom\Productlist\espresso.cshtml:line 363
at CompiledRazorTemplates.Dynamic.RazorEngine_11a7c5531e71459588b75788577fcf86.Execute() in E:\Dynamicweb.NET\Solutions\danfilter.espresso4.dk\files\Templates\Designs\danfilter\eCom\Productlist\espresso.cshtml:line 693
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 Co3.Espresso.Website.Services; @using Dynamicweb.Frontend; @using Dynamicweb.Rendering; @using Co3.Espresso.Base.Extensions; @using Co3.Espresso.Website.Models.FrontEnd; @using Dynamicweb.Ecommerce.Common @using Dynamicweb.Ecommerce.Products @inherits RazorTemplateBase< RazorTemplateModel< Template > > @using System.Globalization @using System.Security.Cryptography.X509Certificates @using Co3.Danfilter.Website.Models.FrontEnd @using danfilterModels = Co3.Danfilter.Data.Models @using Co3.Danfilter.Website.Services @using Co3.Espresso.Base.Extensions @using Co3.Espresso.Website.Models.FrontEnd @using Co3.Espresso.Website.Services @using Dynamicweb.Content @using Dynamicweb.Ecommerce @using Dynamicweb.Frontend @using Dynamicweb.Rendering @using Dynamicweb.Rendering.Translation @using EcomContext = Dynamicweb.Ecommerce.Common.Context @using ProductService = Co3.Espresso.Website.Services.ProductService @using danfilterService = Co3.Danfilter.Website.Services @using Dynamicweb.Ecommerce.Orders @using Co3.Danfilter.Data.Services @using Co3.Espresso.Website.Models.FrontEnd.Elements @using Dynamicweb.Ecommerce.Products @using Dynamicweb.SystemTools @using System.Web @functions { public static List<dynamic> GetFilterTypes(IEnumerable< RazorTemplateBase< RazorTemplateModel< Template > >.LoopItem > productCategories){ List<dynamic> returnValue = new List< dynamic >(); foreach ( RazorTemplateBase< RazorTemplateModel< Template > >.LoopItem productCategory in productCategories ) { foreach ( RazorTemplateBase< RazorTemplateModel< Template > >.LoopItem productCategoryField in productCategory.GetLoop( "ProductCategoryFields" ) ) { if ( productCategoryField.GetString( "Ecom:Product.CategoryField.ID" ) == "B2CFilterType" ) { if ( !string.IsNullOrEmpty( productCategoryField.GetString( "Ecom:Product.CategoryField.Value.Clean" ) ) ) { string[] filterTypesLabels = productCategoryField.GetString( "Ecom:Product.CategoryField.OptionLabel" ).Split( ',' ); string[] filterTypeValues = productCategoryField.GetString( "Ecom:Product.CategoryField.Value.Clean" ).Split( ',' ); int index = 0; foreach ( string filterTypeValue in filterTypeValues ) { returnValue.Add( new { url = string.Format( "/admin/public/getimage.ashx?Crop=0&Image=/Files/Images/danfilter/ikon-{0}.png&Format=png&Width=40&Height=40&Quality=75", filterTypeValue ), label = Translation.GetTranslation("eCom Product - Filter type label - " + filterTypesLabels[ index ]) } ); ++index; } } } } } return returnValue; } public static List< dynamic > GetImageOverlays(IEnumerable< RazorTemplateBase< RazorTemplateModel< Template > >.LoopItem > productCategories) { List<dynamic> returnValue = new List< dynamic >(); foreach ( RazorTemplateBase< RazorTemplateModel< Template > >.LoopItem productCategory in productCategories ) { foreach ( RazorTemplateBase< RazorTemplateModel< Template > >.LoopItem productCategoryField in productCategory.GetLoop( "ProductCategoryFields" ) ) { if ( productCategoryField.GetString( "Ecom:Product.CategoryField.ID" ) == "ImageOverlay" ) { if ( !string.IsNullOrEmpty( productCategoryField.GetString( "Ecom:Product.CategoryField.Value.Clean" ) ) ) { if ( productCategoryField.GetString( "Ecom:Product.CategoryField.Value.Clean" ) != "noOverlay" ) { string imageOverlayValue = productCategoryField.GetString( "Ecom:Product.CategoryField.Value.Clean" ); string globalAreaLang = PageView.Current().Area.CultureInfo.TwoLetterISOLanguageName; returnValue.Add( new { label = productCategoryField.GetString( "Ecom:Product.CategoryField.OptionLabel" ), value = productCategoryField.GetString( "Ecom:Product.CategoryField.Value.Clean" ), url = string.Format( "/admin/public/getimage.ashx?Crop=0&Image=/Files/Images/danfilter/imageOverlay-{0}-{1}.png&Format=png&Width=150&Height=150&Quality=75", imageOverlayValue, globalAreaLang ), } ); } } } } } return returnValue; } public string getCountryCodeFromArea( Area area ) { RegionInfo regionInfo = new RegionInfo( area.CultureInfo.LCID ); return regionInfo.TwoLetterISORegionName; } public static string GetStandardCollapseToggleTextExpand() { return "Se mere"; } public static string GetStandardCollapseToggleTextCollapse() { return "Se mindre"; } public static bool HasFreeDelivery( string productID = "" ) { bool returnValue = false; if ( !string.IsNullOrEmpty( productID ) ) { Shipping shippingWithLowestFreeFeeAmount = Services.Shippings.GetShippings( EcomContext.LanguageID )?.Where( s => s.Active && s.FreeFeeAmount != default( double ) )?.OrderBy( s => s.FreeFeeAmount ).FirstOrDefault(); if ( shippingWithLowestFreeFeeAmount != null ) { EspressoPrice price = danfilterService.ProductService.Instance.GetPrice( productID ); EspressoPrice priceBefore = danfilterService.ProductService.Instance.GetBeforePrice( productID ); EspressoPrice priceToUse; if ( priceBefore.Price != default( double ) && priceBefore.Price < price.Price ) { priceToUse = priceBefore; } else { priceToUse = price; } returnValue = danfilterService.ProductService.Instance.GetPriceWithOrWithoutVAT( shippingWithLowestFreeFeeAmount.FreeFeeAmount ).Price < priceToUse.Price; } } return returnValue; } public static bool HasDiscount( string productID = "" ) { bool returnValue = false; if ( !string.IsNullOrEmpty( productID ) ) { Co3.Danfilter.Data.Models.PriceList prices = danfilterService.ProductService.Instance.GetPrices( productID, EcomContext.LanguageID, PriceType.QuantityPrice ); returnValue = prices.Prices.Count > 1; } return returnValue; } public static EspressoPrice GetLowestEspressoPrice(string productID, danfilterModels.PriceList prices ) { EspressoPrice returnValue = danfilterService.ProductService.Instance.GetPrice( productID ); foreach ( KeyValuePair< double, danfilterModels.Price > price in prices.Prices ) { EspressoPrice itemEspressoPrice = danfilterService.ProductService.Instance.GetPriceWithOrWithoutVAT( decimal.ToDouble( price.Value.ProductPrice ) ); if ( itemEspressoPrice.Price < returnValue.Price ) { returnValue = itemEspressoPrice; } } return returnValue; } public static EspressoPrice GetLowestEspressoBeforePrice(string productID, danfilterModels.PriceList prices ) { EspressoPrice espressoPrice = danfilterService.ProductService.Instance.GetPrice( productID ); EspressoPrice returnValue = danfilterService.ProductService.Instance.GetBeforePrice( productID ); foreach ( KeyValuePair< double, danfilterModels.Price > price in prices.Prices ) { EspressoPrice itemEspressoPrice = danfilterService.ProductService.Instance.GetPriceWithOrWithoutVAT( decimal.ToDouble( price.Value.ProductPrice ) ); EspressoPrice itemEspressoBeforePrice = danfilterService.ProductService.Instance.GetPriceWithOrWithoutVAT( decimal.ToDouble( price.Value.ProductBasePrice ) ); if ( itemEspressoPrice.Price < espressoPrice.Price ) { returnValue = itemEspressoBeforePrice; } } return returnValue; } public static EspressoPrice GetHighestEspressoPrice(string productID, danfilterModels.PriceList prices ) { EspressoPrice returnValue = danfilterService.ProductService.Instance.GetPrice( productID ); foreach ( KeyValuePair< double, danfilterModels.Price > price in prices.Prices ) { EspressoPrice itemEspressoPrice = danfilterService.ProductService.Instance.GetPriceWithOrWithoutVAT( decimal.ToDouble( price.Value.ProductPrice ) ); if ( itemEspressoPrice.Price > returnValue.Price ) { returnValue = itemEspressoPrice; } } return returnValue; } public static EspressoPrice GetHighestEspressoBeforePrice(string productID, danfilterModels.PriceList prices ) { EspressoPrice espressoPrice = danfilterService.ProductService.Instance.GetPrice( productID ); EspressoPrice returnValue = danfilterService.ProductService.Instance.GetBeforePrice( productID ); foreach ( KeyValuePair< double, danfilterModels.Price > price in prices.Prices ) { EspressoPrice itemEspressoPrice = danfilterService.ProductService.Instance.GetPriceWithOrWithoutVAT( decimal.ToDouble( price.Value.ProductPrice ) ); EspressoPrice itemEspressoBeforePrice = danfilterService.ProductService.Instance.GetPriceWithOrWithoutVAT( decimal.ToDouble( price.Value.ProductBasePrice ) ); if ( itemEspressoPrice.Price > espressoPrice.Price ) { returnValue = itemEspressoBeforePrice; } } return returnValue; } public static string GetPricePrefix( string productID, danfilterModels.PriceList prices ) { string returnValue = string.Empty; EspressoPrice espressoPrice = danfilterService.ProductService.Instance.GetPrice( productID ); foreach ( KeyValuePair< double, danfilterModels.Price > price in prices.Prices ) { EspressoPrice itemEspressoPrice = danfilterService.ProductService.Instance.GetPriceWithOrWithoutVAT( decimal.ToDouble( price.Value.ProductPrice ) ); if ( itemEspressoPrice.Price < espressoPrice.Price ) { returnValue = string.Format("{0} ", Translation.GetTranslation( "eCom Productlist - Price from - Text" )); break; } } return returnValue; } } @helper ProductDescription( string sectionClasses = "e-section", bool sectionCollapse = false, string contentClasses = null, string heading = null, string content = null, string collapseToggleTextExpand = null, string collapseToggleTextCollapse = null ) { if ( string.IsNullOrEmpty( content ) == false ) { ClassList headingClassList = new ClassList(); headingClassList.AddClasses( "col-12" ); ClassList contentClassList = new ClassList(); contentClassList.AddClasses( "col-12" ); @sectionStart( sectionClasses: sectionClasses, sectionCollapse: sectionCollapse, contentClasses: contentClasses, collapseToggleTextCollapse: collapseToggleTextCollapse, collapseToggleTextExpand: collapseToggleTextExpand ) if ( string.IsNullOrEmpty( heading ) == false ) { <div class="@headingClassList"> <h2 class="h2">@heading</h2> </div> } <div class="@contentClassList"> @content </div> @sectionEnd() } } @helper ProductVideo( string sectionClasses = "e-section", string contentClasses = null, string heading = null, string videoURL = null ) { if ( string.IsNullOrEmpty( videoURL ) == false ) { ClassList headingClassList = new ClassList(); headingClassList.AddClasses( "col-12" ); ClassList contentClassList = new ClassList(); contentClassList.AddClasses( "col-12" ); @sectionStart( sectionClasses: sectionClasses, contentClasses: contentClasses ) if ( string.IsNullOrEmpty( heading ) == false ) { <div class="@headingClassList"> <p class="h2">@heading</p> </div> } <div class="@contentClassList"> <div class="embed-responsive embed-responsive-16by9 mb-2"> <iframe class="embed-responsive-item" src="@videoURL" width="1080" height="608" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> </div> </div> @sectionEnd() } } @helper ProductRelatedProducts( string sectionClasses = "e-section", string contentClasses = null, string heading = null, IEnumerable< RazorTemplateBase< RazorTemplateModel< Template > >.LoopItem > productLoop = null ) { if ( productLoop != null && productLoop.Any() == true ) { ClassList headingClassList = new ClassList(); headingClassList.AddClasses( "col-12" ); ClassList contentClassList = new ClassList(); contentClassList.AddClasses( "col-12" ); @sectionStart( sectionClasses: sectionClasses, contentClasses: contentClasses ) if ( string.IsNullOrEmpty( heading ) == false ) { <div class="@headingClassList"> <h2 class="text-center">@heading</h2> </div> } <div class="@contentClassList"> <div class="e-products mb-2"> <div class="row justify-content-center"> @{ string productlistItemClassList = ProductlistService.Instance.GetGridItemWidth( null ).ToResponsiveClasses(); } @foreach ( RazorTemplateBase< RazorTemplateModel< Template > >.LoopItem product in productLoop ) { @ProductlistItem( product, productlistItemClassList ) } </div> </div> </div> @sectionEnd() } } @helper ProductRelatedProductsDanFilter( string sectionClasses = "e-section", string contentClasses = null, string heading = null, IEnumerable< RazorTemplateBase< RazorTemplateModel< Template > >.LoopItem > productLoop = null ) { if ( productLoop != null && productLoop.Any() == true ) { ClassList headingClassList = new ClassList(); headingClassList.AddClasses( "col-12" ); ClassList contentClassList = new ClassList(); contentClassList.AddClasses( "col-12" ); @sectionStart( sectionClasses: sectionClasses, contentClasses: contentClasses ) if ( string.IsNullOrEmpty( heading ) == false ) { <div class="@headingClassList"> <h2 class="text-center">@heading</h2> </div> } <div class="@contentClassList"> <div class="e-products mb-2"> <div class="row justify-content-center"> @{ string productlistItemClassList = ProductlistService.Instance.GetGridItemWidth( null ).ToResponsiveClasses(); } @foreach ( RazorTemplateBase< RazorTemplateModel< Template > >.LoopItem product in productLoop ) { @ProductlistItemDanFilter( product, productlistItemClassList ) } </div> </div> </div> @sectionEnd() } } @helper ProductlistItem( RazorTemplateBase< RazorTemplateModel< Template > >.LoopItem product, string productlistItemClassList = null ) { if ( product != null ) { List<dynamic> filterTypes = GetFilterTypes( product.GetLoop( "ProductCategories" ) ); List<dynamic> imageOverlays = GetImageOverlays( product.GetLoop( "ProductCategories" ) ); danfilterModels.PriceList prices = danfilterService.ProductService.Instance.GetPrices( product.GetString( "Ecom:Product.ID" ), EcomContext.LanguageID, PriceType.QuantityPrice ); EspressoPrice productEspressoPrice = GetLowestEspressoPrice( product.GetString( "Ecom:Product.ID" ), prices ); EspressoPrice productEspressoBeforePrice = GetLowestEspressoBeforePrice( product.GetString( "Ecom:Product.ID" ), prices ); string pricePrefix = GetPricePrefix(product.GetString( "Ecom:Product.ID" ), prices); dynamic productData = new { id = product.GetString( "Ecom:Product.ID" ), variantId = product.GetString( "Ecom:Product.VariantID" ), url = ProductService.Instance.GetProductLink( product.GetString( "Ecom:Product.PrimaryOrFirstGroupID" ), product.GetString( "Ecom:Product.ID" ), product.GetString( "Ecom:Product.VariantID" ) ), number = product.GetString( "Ecom:Product.Number" ), name = ProductService.Instance.GetName( product.GetString( "Ecom:Product.ID" ), product.GetString( "Ecom:Product.VariantID" ) ), imageLarge = ImageService.Instance.GetImageURL( product.GetString( "Ecom:Product.ImageDefault.Clean" ), 400, 400, 5 ), pricePrefix = pricePrefix, price = productEspressoPrice,//danfilterService.ProductService.Instance.GetPrice( product.GetString( "Ecom:Product.ID" ) ), priceBefore = productEspressoBeforePrice,//danfilterService.ProductService.Instance.GetBeforePrice( product.GetString( "Ecom:Product.ID" ) ), descriptionShortExtra01 = product.GetString( "Ecom:Product:Field.DescriptionShortExtra01" ), discountLable = HasDiscount(product.GetString( "Ecom:Product.ID" )), freeDeliveryLable = HasFreeDelivery(product.GetString( "Ecom:Product.ID" )), filterTypes = filterTypes, hasFilterTypes = filterTypes.Count > 0, imageOverlays = imageOverlays, hasImageOverlays = imageOverlays.Count > 0, stock = new { id = product.GetString( "Ecom:Product:Stock.ID" ), quantity = product.GetString( "Ecom:Product.Stock" ), text = product.GetString( "Ecom:Product:Stock.Text" ), delivery = product.GetString( "Ecom:Product:Stock.DeliveryText" ) } }; bool showBeforePrice = productData.priceBefore.Price != 0 && productData.priceBefore.Price > productData.price.Price; <div class="@productlistItemClassList"> <div class="e-products-item js-e-products-item js-e-products-item-@productData.id js-e-block-link e-block-link " data-variant-id="@productData.variantId"> <div class="e-products-item-container"> <div class="e-products-item-image-container"> <a class="e-products-item-image-wrapper" href="@productData.url" onclick="trackProductClick(@HttpUtility.HtmlAttributeEncode( JsonService.Instance.ToJson( productData )))"> <img src="@productData.imageLarge" alt="" class="e-products-item-image"> @if ( productData.freeDeliveryLable && !productData.discountLable ) { <span class="danfilter-productlist-item-label label-freedelivery"> <span class="label-text">@Translation.GetTranslation( "eCom Product - Label - Free delivery" )</span> </span> } @if ( productData.discountLable && !productData.freeDeliveryLable ) { <span class="danfilter-productlist-item-label label-discount"> <span class="label-text">@Translation.GetTranslation( "eCom Product - Label - Discounts" )</span> </span> } @if ( productData.discountLable && productData.freeDeliveryLable ) { <span class="danfilter-productlist-item-label label-both"> <span class="label-text">@Translation.GetTranslation( "eCom Product - Label - Free delivery and discounts" )</span> </span> } @if ( imageOverlays.Any() ) { foreach ( dynamic imageOverlay in imageOverlays ) { <span class="danfilter-productlist-item-label-imageoverlay danfilter-label-@imageOverlay.value"> <span class="label-text"> <img src="@imageOverlay.url" alt="@imageOverlay.label" title="@imageOverlay.label"> </span> </span> } } </a> </div> <div class="e-products-item-text-container text-center"> <h3 class="e-products-item-name mb-0"> <a href="@productData.url" onclick="trackProductClick(@HttpUtility.HtmlAttributeEncode( JsonService.Instance.ToJson( productData )))"> @productData.name </a> </h3> <div class="danfilter-productlist-item-pictogram-wrapper"> @if ( productData.filterTypes.Count > 0 ) { foreach ( dynamic filterType in productData.filterTypes ) { <img src="@filterType.url" alt="@filterType.label" title="@filterType.label"> } } </div> @{ ProductStatus productStatus = Co3.Danfilter.Website.Services.ProductService.Instance.GetProductStatus( productData.id, productData.variantId ); } @RenderingService.Instance.PartialView( "/eCom/Product/_partials/productStatusStock.cshtml", productStatus ) @if ( showBeforePrice ) { <p class="e-products-item-text mb-0 small"> <small class="e-products-item-price m-0 e-product-price-before text-muted"> <a href="@productData.url" onclick="trackProductClick(@HttpUtility.HtmlAttributeEncode( JsonService.Instance.ToJson( productData )))"> @productData.priceBefore </a> </small> </p> } <p class="e-products-item-text mb-0"> <small class="e-products-item-price"> <a href="@productData.url" onclick="trackProductClick(@HttpUtility.HtmlAttributeEncode( JsonService.Instance.ToJson( productData )))"> @string.Format("{0}{1}", pricePrefix, productData.price) </a> </small> </p> <form action="/system/data/cart" class="e-product-form js-e-product-form" method="post"> <input name="CartCmd" type="hidden" value="Add"> <input type="hidden" name="ProductID" value="@productData.id"> <input name="VariantID" type="hidden" value=""> <input name="UnitID" type="hidden" value=""> <input name="Redirect" type="hidden" value=""> <div class="danfilter-product-list-add-to-cart-wrapper"> <input name="Quantity" type="hidden" value="1"> <button class="btn btn-primary" type="submit">@Translation.GetTranslation( "eCom Product - Add To Cart - Button" )</button> </div> </form> </div> </div> </div> </div> } } @helper ProductlistItemDanFilter( RazorTemplateBase< RazorTemplateModel< Template > >.LoopItem product, string productlistItemClassList = null ) { if ( product != null ) { List<dynamic> filterTypes = GetFilterTypes( product.GetLoop( "ProductCategories" ) ); List<dynamic> imageOverlays = GetImageOverlays( product.GetLoop( "ProductCategories" ) ); danfilterModels.PriceList prices = danfilterService.ProductService.Instance.GetPrices( product.GetString( "Ecom:Product.ID" ), EcomContext.LanguageID, PriceType.QuantityPrice ); EspressoPrice productEspressoPrice = GetLowestEspressoPrice( product.GetString( "Ecom:Product.ID" ), prices ); EspressoPrice productEspressoBeforePrice = GetLowestEspressoBeforePrice( product.GetString( "Ecom:Product.ID" ), prices ); string pricePrefix = GetPricePrefix(product.GetString( "Ecom:Product.ID" ), prices); dynamic productData = new { id = product.GetString( "Ecom:Product.ID" ), variantId = product.GetString( "Ecom:Product.VariantID" ), url = ProductService.Instance.GetProductLink( product.GetString( "Ecom:Product.PrimaryOrFirstGroupID" ), product.GetString( "Ecom:Product.ID" ), product.GetString( "Ecom:Product.VariantID" ) ), number = product.GetString( "Ecom:Product.Number" ), name = ProductService.Instance.GetName( product.GetString( "Ecom:Product.ID" ), product.GetString( "Ecom:Product.VariantID" ) ), imageLarge = ImageService.Instance.GetImageURL( product.GetString( "Ecom:Product.ImageDefault.Clean" ), 400, 400, 5 ), pricePrefix = pricePrefix, price = productEspressoPrice,//danfilterService.ProductService.Instance.GetPrice( product.GetString( "Ecom:Product.ID" ) ), priceBefore = productEspressoBeforePrice,//danfilterService.ProductService.Instance.GetBeforePrice( product.GetString( "Ecom:Product.ID" ) ), descriptionShortExtra01 = product.GetString( "Ecom:Product:Field.DescriptionShortExtra01" ), discountLable = HasDiscount(product.GetString( "Ecom:Product.ID" )), freeDeliveryLable = HasFreeDelivery(product.GetString( "Ecom:Product.ID" )), filterTypes = filterTypes, hasFilterTypes = filterTypes.Count > 0, imageOverlays = imageOverlays, hasImageOverlays = imageOverlays.Count > 0, stock = new { id = product.GetString( "Ecom:Product:Stock.ID" ), quantity = product.GetString( "Ecom:Product.Stock" ), text = product.GetString( "Ecom:Product:Stock.Text" ), delivery = product.GetString( "Ecom:Product:Stock.DeliveryText" ) } }; bool showBeforePrice = productData.priceBefore.Price != 0 && productData.priceBefore.Price > productData.price.Price; <div class="@productlistItemClassList"> <div class="e-products-item js-e-products-item js-e-products-item-@productData.id js-e-block-link e-block-link " data-variant-id="@productData.variantId"> <div class="e-products-item-container"> <div class="e-products-item-image-container"> <a class="e-products-item-image-wrapper" href="@productData.url"> <img src="@productData.imageLarge" alt="" class="e-products-item-image"> </a> </div> <div class="e-products-item-text-container text-center"> <h3 class="e-products-item-name mb-0"> <a href="@productData.url"> @productData.name </a> </h3> <div class="danfilter-productlist-item-pictogram-wrapper"> @if ( productData.filterTypes.Count > 0 ) { foreach ( dynamic filterType in productData.filterTypes ) { <img src="@filterType.url" alt="@filterType.label" title="@filterType.label"> } } </div> @{ ProductStatus productStatus = Co3.Danfilter.Website.Services.ProductService.Instance.GetProductStatus( productData.id, productData.variantId ); } @RenderingService.Instance.PartialView( "/eCom/Product/_partials/productStatusStock.cshtml", productStatus ) <form action="/system/data/cart" class="e-product-form js-e-product-form" method="post"> <input name="CartCmd" type="hidden" value="Add"> <input type="hidden" name="ProductID" value="@productData.id"> <input name="VariantID" type="hidden" value=""> <input name="UnitID" type="hidden" value=""> <input name="Redirect" type="hidden" value=""> <div class="danfilter-product-list-add-to-cart-wrapper"> <input name="Quantity" type="hidden" value="1"> <button class="btn btn-primary" type="submit">@Translation.GetTranslation( "eCom Product - Add To Cart - Button" )</button> </div> </form> </div> </div> </div> </div> } } @helper sectionStart( string sectionClasses = "e-section", string contentClasses = null, bool sectionCollapse = false, string sectionId = null, string collapseToggleTextExpand = null, string collapseToggleTextCollapse = null ) { sectionId = string.IsNullOrEmpty( sectionId ) ? Guid.NewGuid().ToString( "N" ) : sectionId; ClassList sectionClassList = new ClassList(); sectionClassList.AddClasses( sectionClasses ); ClassList contentClassList; if ( contentClasses == null ) { contentClassList = Co3.Espresso.Website.Services.PageService.Instance.GetResponsiveClassesFromPageItem( PageView.Current().Page.Item ); } else { contentClassList = new ClassList(); contentClassList.AddClasses( contentClasses ); } // TODO: Split collapse logic into separate helper function. string collapseId = Guid.NewGuid().ToString( "N" ); ClassList collapseToggleClassList = new ClassList(); if ( sectionCollapse ) { sectionClassList.AddClasses( "p-section-collapse js-p-section-collapse" ); collapseToggleClassList.AddClasses( contentClasses ); collapseToggleClassList.AddClasses( "p-section-collapse-toggle collapsed order-last text-center" ); contentClassList.AddClasses( "p-section-collapse-content collapse is-md" ); } @:<section class="@sectionClassList" id="@sectionId"> @:<div class="container-fluid"> @:<div class="row"> // TODO: Split collapse logic into separate helper function. if ( sectionCollapse ) { <div class="@collapseToggleClassList" data-toggle="collapse" data-target="#@collapseId"> <button class="btn bg-white p-section-collapse-toggle-btn" type="button"> <i class="material-icons p-section-collapse-toggle-icon">keyboard_arrow_down</i> </button> <small class="h4 p-section-collapse-toggle-text" data-expand-text="@( string.IsNullOrEmpty( collapseToggleTextExpand ) ? GetStandardCollapseToggleTextExpand() : collapseToggleTextExpand )" data-collapse-text="@( string.IsNullOrEmpty( collapseToggleTextCollapse ) ? GetStandardCollapseToggleTextCollapse() : collapseToggleTextCollapse )"></small> </div> } @:<div class="@contentClassList" id="@collapseId"> @:<div class="row"> } @helper sectionEnd() { @:</div> @:</div> @:</div> @:</div> @:</section> } 2 3@{ ClassList productlistItemClassList = new ClassList(); Dictionary< string, decimal > paragraphEcommerceGridItemWidth = ProductlistService.Instance.GetGridItemWidth( PageView.Current().CurrentParagraph.Item.GetValue< string >( "ItemWidth" ) ); productlistItemClassList.AddClasses ( paragraphEcommerceGridItemWidth.ToResponsiveClasses () ); } <script> function trackProductClick(productObj) { dataLayer.push({ 'event': 'productClick', 'ecommerce': { 'click': { 'products': [{ 'name': productObj.name, 'id': productObj.id, 'price': productObj.price.Price }] } }, 'eventCallback': function() { document.location = productObj.url; } }); return false; } </script> <div class="e-productlist js-gtm-tracking-productlist"> <div class="row"> <div class="col-12"> <div class="e-productlist-body"> <div class="row"> <div class="col-12"> <div class="e-products"> <div class="row"> @{ int productIndex = 1; } <script> var arrImpressions = []; </script> @foreach ( LoopItem product in GetLoop( "Products" ) ) { if ( product.GetBoolean("Ecom:Product.Discontinued") == false ) { @ProductlistItem( product, productlistItemClassList.ToString() ) IEnumerable< ProductGroupRelation > groups = Dynamicweb.Ecommerce.Services.ProductGroups.GetProductGroupRelations( product.GetString( "Ecom:Product.ID" ) ); string listName = string.Empty; if ( groups != null && groups.FirstOrDefault( g => g.IsPrimary ) != null ) { listName = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup( groups.FirstOrDefault( g => g.IsPrimary ).GroupId )?.Name ; } <script> arrImpressions.push({ "id": '@product.GetString( "Ecom:Product.ID" )', "name": '@product.GetString( "Ecom:Product.Name" )', "price": @product.GetDouble( "Ecom:Product.Price.Price" ), "position": @productIndex, "list": '@listName' }); </script> productIndex++; } } </div> </div> </div> </div> </div> </div> </div> </div> <script> dataLayer.push({ "ecommerce": { "currencyCode": "@Context.Currency.Code", "impressions": arrImpressions } }); </script>
Error executing template "Designs/danfilter/eCom/Productlist/espresso.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at Dynamicweb.Ecommerce.LiveIntegration.Products.PriceManager.ProcessResponse(XmlDocument response)
at Dynamicweb.Ecommerce.LiveIntegration.Products.PriceManager.FetchQuantityPrices(Product product)
at Co3.Danfilter.Website.Services.ProductService.GetPrices(Product product, PriceType priceType) in C:\Users\csv\Documents\Git_Co3\danfilter\Co3.Danfilter.Website\Services\ProductService.cs:line 41
at CompiledRazorTemplates.Dynamic.RazorEngine_11a7c5531e71459588b75788577fcf86.<>c__DisplayClass16_0.<ProductlistItem>b__0(TextWriter __razor_helper_writer) in E:\Dynamicweb.NET\Solutions\danfilter.espresso4.dk\files\Templates\Designs\danfilter\eCom\Productlist\espresso.cshtml:line 363
at CompiledRazorTemplates.Dynamic.RazorEngine_11a7c5531e71459588b75788577fcf86.Execute() in E:\Dynamicweb.NET\Solutions\danfilter.espresso4.dk\files\Templates\Designs\danfilter\eCom\Productlist\espresso.cshtml:line 693
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 Co3.Espresso.Website.Services; @using Dynamicweb.Frontend; @using Dynamicweb.Rendering; @using Co3.Espresso.Base.Extensions; @using Co3.Espresso.Website.Models.FrontEnd; @using Dynamicweb.Ecommerce.Common @using Dynamicweb.Ecommerce.Products @inherits RazorTemplateBase< RazorTemplateModel< Template > > @using System.Globalization @using System.Security.Cryptography.X509Certificates @using Co3.Danfilter.Website.Models.FrontEnd @using danfilterModels = Co3.Danfilter.Data.Models @using Co3.Danfilter.Website.Services @using Co3.Espresso.Base.Extensions @using Co3.Espresso.Website.Models.FrontEnd @using Co3.Espresso.Website.Services @using Dynamicweb.Content @using Dynamicweb.Ecommerce @using Dynamicweb.Frontend @using Dynamicweb.Rendering @using Dynamicweb.Rendering.Translation @using EcomContext = Dynamicweb.Ecommerce.Common.Context @using ProductService = Co3.Espresso.Website.Services.ProductService @using danfilterService = Co3.Danfilter.Website.Services @using Dynamicweb.Ecommerce.Orders @using Co3.Danfilter.Data.Services @using Co3.Espresso.Website.Models.FrontEnd.Elements @using Dynamicweb.Ecommerce.Products @using Dynamicweb.SystemTools @using System.Web @functions { public static List<dynamic> GetFilterTypes(IEnumerable< RazorTemplateBase< RazorTemplateModel< Template > >.LoopItem > productCategories){ List<dynamic> returnValue = new List< dynamic >(); foreach ( RazorTemplateBase< RazorTemplateModel< Template > >.LoopItem productCategory in productCategories ) { foreach ( RazorTemplateBase< RazorTemplateModel< Template > >.LoopItem productCategoryField in productCategory.GetLoop( "ProductCategoryFields" ) ) { if ( productCategoryField.GetString( "Ecom:Product.CategoryField.ID" ) == "B2CFilterType" ) { if ( !string.IsNullOrEmpty( productCategoryField.GetString( "Ecom:Product.CategoryField.Value.Clean" ) ) ) { string[] filterTypesLabels = productCategoryField.GetString( "Ecom:Product.CategoryField.OptionLabel" ).Split( ',' ); string[] filterTypeValues = productCategoryField.GetString( "Ecom:Product.CategoryField.Value.Clean" ).Split( ',' ); int index = 0; foreach ( string filterTypeValue in filterTypeValues ) { returnValue.Add( new { url = string.Format( "/admin/public/getimage.ashx?Crop=0&Image=/Files/Images/danfilter/ikon-{0}.png&Format=png&Width=40&Height=40&Quality=75", filterTypeValue ), label = Translation.GetTranslation("eCom Product - Filter type label - " + filterTypesLabels[ index ]) } ); ++index; } } } } } return returnValue; } public static List< dynamic > GetImageOverlays(IEnumerable< RazorTemplateBase< RazorTemplateModel< Template > >.LoopItem > productCategories) { List<dynamic> returnValue = new List< dynamic >(); foreach ( RazorTemplateBase< RazorTemplateModel< Template > >.LoopItem productCategory in productCategories ) { foreach ( RazorTemplateBase< RazorTemplateModel< Template > >.LoopItem productCategoryField in productCategory.GetLoop( "ProductCategoryFields" ) ) { if ( productCategoryField.GetString( "Ecom:Product.CategoryField.ID" ) == "ImageOverlay" ) { if ( !string.IsNullOrEmpty( productCategoryField.GetString( "Ecom:Product.CategoryField.Value.Clean" ) ) ) { if ( productCategoryField.GetString( "Ecom:Product.CategoryField.Value.Clean" ) != "noOverlay" ) { string imageOverlayValue = productCategoryField.GetString( "Ecom:Product.CategoryField.Value.Clean" ); string globalAreaLang = PageView.Current().Area.CultureInfo.TwoLetterISOLanguageName; returnValue.Add( new { label = productCategoryField.GetString( "Ecom:Product.CategoryField.OptionLabel" ), value = productCategoryField.GetString( "Ecom:Product.CategoryField.Value.Clean" ), url = string.Format( "/admin/public/getimage.ashx?Crop=0&Image=/Files/Images/danfilter/imageOverlay-{0}-{1}.png&Format=png&Width=150&Height=150&Quality=75", imageOverlayValue, globalAreaLang ), } ); } } } } } return returnValue; } public string getCountryCodeFromArea( Area area ) { RegionInfo regionInfo = new RegionInfo( area.CultureInfo.LCID ); return regionInfo.TwoLetterISORegionName; } public static string GetStandardCollapseToggleTextExpand() { return "Se mere"; } public static string GetStandardCollapseToggleTextCollapse() { return "Se mindre"; } public static bool HasFreeDelivery( string productID = "" ) { bool returnValue = false; if ( !string.IsNullOrEmpty( productID ) ) { Shipping shippingWithLowestFreeFeeAmount = Services.Shippings.GetShippings( EcomContext.LanguageID )?.Where( s => s.Active && s.FreeFeeAmount != default( double ) )?.OrderBy( s => s.FreeFeeAmount ).FirstOrDefault(); if ( shippingWithLowestFreeFeeAmount != null ) { EspressoPrice price = danfilterService.ProductService.Instance.GetPrice( productID ); EspressoPrice priceBefore = danfilterService.ProductService.Instance.GetBeforePrice( productID ); EspressoPrice priceToUse; if ( priceBefore.Price != default( double ) && priceBefore.Price < price.Price ) { priceToUse = priceBefore; } else { priceToUse = price; } returnValue = danfilterService.ProductService.Instance.GetPriceWithOrWithoutVAT( shippingWithLowestFreeFeeAmount.FreeFeeAmount ).Price < priceToUse.Price; } } return returnValue; } public static bool HasDiscount( string productID = "" ) { bool returnValue = false; if ( !string.IsNullOrEmpty( productID ) ) { Co3.Danfilter.Data.Models.PriceList prices = danfilterService.ProductService.Instance.GetPrices( productID, EcomContext.LanguageID, PriceType.QuantityPrice ); returnValue = prices.Prices.Count > 1; } return returnValue; } public static EspressoPrice GetLowestEspressoPrice(string productID, danfilterModels.PriceList prices ) { EspressoPrice returnValue = danfilterService.ProductService.Instance.GetPrice( productID ); foreach ( KeyValuePair< double, danfilterModels.Price > price in prices.Prices ) { EspressoPrice itemEspressoPrice = danfilterService.ProductService.Instance.GetPriceWithOrWithoutVAT( decimal.ToDouble( price.Value.ProductPrice ) ); if ( itemEspressoPrice.Price < returnValue.Price ) { returnValue = itemEspressoPrice; } } return returnValue; } public static EspressoPrice GetLowestEspressoBeforePrice(string productID, danfilterModels.PriceList prices ) { EspressoPrice espressoPrice = danfilterService.ProductService.Instance.GetPrice( productID ); EspressoPrice returnValue = danfilterService.ProductService.Instance.GetBeforePrice( productID ); foreach ( KeyValuePair< double, danfilterModels.Price > price in prices.Prices ) { EspressoPrice itemEspressoPrice = danfilterService.ProductService.Instance.GetPriceWithOrWithoutVAT( decimal.ToDouble( price.Value.ProductPrice ) ); EspressoPrice itemEspressoBeforePrice = danfilterService.ProductService.Instance.GetPriceWithOrWithoutVAT( decimal.ToDouble( price.Value.ProductBasePrice ) ); if ( itemEspressoPrice.Price < espressoPrice.Price ) { returnValue = itemEspressoBeforePrice; } } return returnValue; } public static EspressoPrice GetHighestEspressoPrice(string productID, danfilterModels.PriceList prices ) { EspressoPrice returnValue = danfilterService.ProductService.Instance.GetPrice( productID ); foreach ( KeyValuePair< double, danfilterModels.Price > price in prices.Prices ) { EspressoPrice itemEspressoPrice = danfilterService.ProductService.Instance.GetPriceWithOrWithoutVAT( decimal.ToDouble( price.Value.ProductPrice ) ); if ( itemEspressoPrice.Price > returnValue.Price ) { returnValue = itemEspressoPrice; } } return returnValue; } public static EspressoPrice GetHighestEspressoBeforePrice(string productID, danfilterModels.PriceList prices ) { EspressoPrice espressoPrice = danfilterService.ProductService.Instance.GetPrice( productID ); EspressoPrice returnValue = danfilterService.ProductService.Instance.GetBeforePrice( productID ); foreach ( KeyValuePair< double, danfilterModels.Price > price in prices.Prices ) { EspressoPrice itemEspressoPrice = danfilterService.ProductService.Instance.GetPriceWithOrWithoutVAT( decimal.ToDouble( price.Value.ProductPrice ) ); EspressoPrice itemEspressoBeforePrice = danfilterService.ProductService.Instance.GetPriceWithOrWithoutVAT( decimal.ToDouble( price.Value.ProductBasePrice ) ); if ( itemEspressoPrice.Price > espressoPrice.Price ) { returnValue = itemEspressoBeforePrice; } } return returnValue; } public static string GetPricePrefix( string productID, danfilterModels.PriceList prices ) { string returnValue = string.Empty; EspressoPrice espressoPrice = danfilterService.ProductService.Instance.GetPrice( productID ); foreach ( KeyValuePair< double, danfilterModels.Price > price in prices.Prices ) { EspressoPrice itemEspressoPrice = danfilterService.ProductService.Instance.GetPriceWithOrWithoutVAT( decimal.ToDouble( price.Value.ProductPrice ) ); if ( itemEspressoPrice.Price < espressoPrice.Price ) { returnValue = string.Format("{0} ", Translation.GetTranslation( "eCom Productlist - Price from - Text" )); break; } } return returnValue; } } @helper ProductDescription( string sectionClasses = "e-section", bool sectionCollapse = false, string contentClasses = null, string heading = null, string content = null, string collapseToggleTextExpand = null, string collapseToggleTextCollapse = null ) { if ( string.IsNullOrEmpty( content ) == false ) { ClassList headingClassList = new ClassList(); headingClassList.AddClasses( "col-12" ); ClassList contentClassList = new ClassList(); contentClassList.AddClasses( "col-12" ); @sectionStart( sectionClasses: sectionClasses, sectionCollapse: sectionCollapse, contentClasses: contentClasses, collapseToggleTextCollapse: collapseToggleTextCollapse, collapseToggleTextExpand: collapseToggleTextExpand ) if ( string.IsNullOrEmpty( heading ) == false ) { <div class="@headingClassList"> <h2 class="h2">@heading</h2> </div> } <div class="@contentClassList"> @content </div> @sectionEnd() } } @helper ProductVideo( string sectionClasses = "e-section", string contentClasses = null, string heading = null, string videoURL = null ) { if ( string.IsNullOrEmpty( videoURL ) == false ) { ClassList headingClassList = new ClassList(); headingClassList.AddClasses( "col-12" ); ClassList contentClassList = new ClassList(); contentClassList.AddClasses( "col-12" ); @sectionStart( sectionClasses: sectionClasses, contentClasses: contentClasses ) if ( string.IsNullOrEmpty( heading ) == false ) { <div class="@headingClassList"> <p class="h2">@heading</p> </div> } <div class="@contentClassList"> <div class="embed-responsive embed-responsive-16by9 mb-2"> <iframe class="embed-responsive-item" src="@videoURL" width="1080" height="608" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> </div> </div> @sectionEnd() } } @helper ProductRelatedProducts( string sectionClasses = "e-section", string contentClasses = null, string heading = null, IEnumerable< RazorTemplateBase< RazorTemplateModel< Template > >.LoopItem > productLoop = null ) { if ( productLoop != null && productLoop.Any() == true ) { ClassList headingClassList = new ClassList(); headingClassList.AddClasses( "col-12" ); ClassList contentClassList = new ClassList(); contentClassList.AddClasses( "col-12" ); @sectionStart( sectionClasses: sectionClasses, contentClasses: contentClasses ) if ( string.IsNullOrEmpty( heading ) == false ) { <div class="@headingClassList"> <h2 class="text-center">@heading</h2> </div> } <div class="@contentClassList"> <div class="e-products mb-2"> <div class="row justify-content-center"> @{ string productlistItemClassList = ProductlistService.Instance.GetGridItemWidth( null ).ToResponsiveClasses(); } @foreach ( RazorTemplateBase< RazorTemplateModel< Template > >.LoopItem product in productLoop ) { @ProductlistItem( product, productlistItemClassList ) } </div> </div> </div> @sectionEnd() } } @helper ProductRelatedProductsDanFilter( string sectionClasses = "e-section", string contentClasses = null, string heading = null, IEnumerable< RazorTemplateBase< RazorTemplateModel< Template > >.LoopItem > productLoop = null ) { if ( productLoop != null && productLoop.Any() == true ) { ClassList headingClassList = new ClassList(); headingClassList.AddClasses( "col-12" ); ClassList contentClassList = new ClassList(); contentClassList.AddClasses( "col-12" ); @sectionStart( sectionClasses: sectionClasses, contentClasses: contentClasses ) if ( string.IsNullOrEmpty( heading ) == false ) { <div class="@headingClassList"> <h2 class="text-center">@heading</h2> </div> } <div class="@contentClassList"> <div class="e-products mb-2"> <div class="row justify-content-center"> @{ string productlistItemClassList = ProductlistService.Instance.GetGridItemWidth( null ).ToResponsiveClasses(); } @foreach ( RazorTemplateBase< RazorTemplateModel< Template > >.LoopItem product in productLoop ) { @ProductlistItemDanFilter( product, productlistItemClassList ) } </div> </div> </div> @sectionEnd() } } @helper ProductlistItem( RazorTemplateBase< RazorTemplateModel< Template > >.LoopItem product, string productlistItemClassList = null ) { if ( product != null ) { List<dynamic> filterTypes = GetFilterTypes( product.GetLoop( "ProductCategories" ) ); List<dynamic> imageOverlays = GetImageOverlays( product.GetLoop( "ProductCategories" ) ); danfilterModels.PriceList prices = danfilterService.ProductService.Instance.GetPrices( product.GetString( "Ecom:Product.ID" ), EcomContext.LanguageID, PriceType.QuantityPrice ); EspressoPrice productEspressoPrice = GetLowestEspressoPrice( product.GetString( "Ecom:Product.ID" ), prices ); EspressoPrice productEspressoBeforePrice = GetLowestEspressoBeforePrice( product.GetString( "Ecom:Product.ID" ), prices ); string pricePrefix = GetPricePrefix(product.GetString( "Ecom:Product.ID" ), prices); dynamic productData = new { id = product.GetString( "Ecom:Product.ID" ), variantId = product.GetString( "Ecom:Product.VariantID" ), url = ProductService.Instance.GetProductLink( product.GetString( "Ecom:Product.PrimaryOrFirstGroupID" ), product.GetString( "Ecom:Product.ID" ), product.GetString( "Ecom:Product.VariantID" ) ), number = product.GetString( "Ecom:Product.Number" ), name = ProductService.Instance.GetName( product.GetString( "Ecom:Product.ID" ), product.GetString( "Ecom:Product.VariantID" ) ), imageLarge = ImageService.Instance.GetImageURL( product.GetString( "Ecom:Product.ImageDefault.Clean" ), 400, 400, 5 ), pricePrefix = pricePrefix, price = productEspressoPrice,//danfilterService.ProductService.Instance.GetPrice( product.GetString( "Ecom:Product.ID" ) ), priceBefore = productEspressoBeforePrice,//danfilterService.ProductService.Instance.GetBeforePrice( product.GetString( "Ecom:Product.ID" ) ), descriptionShortExtra01 = product.GetString( "Ecom:Product:Field.DescriptionShortExtra01" ), discountLable = HasDiscount(product.GetString( "Ecom:Product.ID" )), freeDeliveryLable = HasFreeDelivery(product.GetString( "Ecom:Product.ID" )), filterTypes = filterTypes, hasFilterTypes = filterTypes.Count > 0, imageOverlays = imageOverlays, hasImageOverlays = imageOverlays.Count > 0, stock = new { id = product.GetString( "Ecom:Product:Stock.ID" ), quantity = product.GetString( "Ecom:Product.Stock" ), text = product.GetString( "Ecom:Product:Stock.Text" ), delivery = product.GetString( "Ecom:Product:Stock.DeliveryText" ) } }; bool showBeforePrice = productData.priceBefore.Price != 0 && productData.priceBefore.Price > productData.price.Price; <div class="@productlistItemClassList"> <div class="e-products-item js-e-products-item js-e-products-item-@productData.id js-e-block-link e-block-link " data-variant-id="@productData.variantId"> <div class="e-products-item-container"> <div class="e-products-item-image-container"> <a class="e-products-item-image-wrapper" href="@productData.url" onclick="trackProductClick(@HttpUtility.HtmlAttributeEncode( JsonService.Instance.ToJson( productData )))"> <img src="@productData.imageLarge" alt="" class="e-products-item-image"> @if ( productData.freeDeliveryLable && !productData.discountLable ) { <span class="danfilter-productlist-item-label label-freedelivery"> <span class="label-text">@Translation.GetTranslation( "eCom Product - Label - Free delivery" )</span> </span> } @if ( productData.discountLable && !productData.freeDeliveryLable ) { <span class="danfilter-productlist-item-label label-discount"> <span class="label-text">@Translation.GetTranslation( "eCom Product - Label - Discounts" )</span> </span> } @if ( productData.discountLable && productData.freeDeliveryLable ) { <span class="danfilter-productlist-item-label label-both"> <span class="label-text">@Translation.GetTranslation( "eCom Product - Label - Free delivery and discounts" )</span> </span> } @if ( imageOverlays.Any() ) { foreach ( dynamic imageOverlay in imageOverlays ) { <span class="danfilter-productlist-item-label-imageoverlay danfilter-label-@imageOverlay.value"> <span class="label-text"> <img src="@imageOverlay.url" alt="@imageOverlay.label" title="@imageOverlay.label"> </span> </span> } } </a> </div> <div class="e-products-item-text-container text-center"> <h3 class="e-products-item-name mb-0"> <a href="@productData.url" onclick="trackProductClick(@HttpUtility.HtmlAttributeEncode( JsonService.Instance.ToJson( productData )))"> @productData.name </a> </h3> <div class="danfilter-productlist-item-pictogram-wrapper"> @if ( productData.filterTypes.Count > 0 ) { foreach ( dynamic filterType in productData.filterTypes ) { <img src="@filterType.url" alt="@filterType.label" title="@filterType.label"> } } </div> @{ ProductStatus productStatus = Co3.Danfilter.Website.Services.ProductService.Instance.GetProductStatus( productData.id, productData.variantId ); } @RenderingService.Instance.PartialView( "/eCom/Product/_partials/productStatusStock.cshtml", productStatus ) @if ( showBeforePrice ) { <p class="e-products-item-text mb-0 small"> <small class="e-products-item-price m-0 e-product-price-before text-muted"> <a href="@productData.url" onclick="trackProductClick(@HttpUtility.HtmlAttributeEncode( JsonService.Instance.ToJson( productData )))"> @productData.priceBefore </a> </small> </p> } <p class="e-products-item-text mb-0"> <small class="e-products-item-price"> <a href="@productData.url" onclick="trackProductClick(@HttpUtility.HtmlAttributeEncode( JsonService.Instance.ToJson( productData )))"> @string.Format("{0}{1}", pricePrefix, productData.price) </a> </small> </p> <form action="/system/data/cart" class="e-product-form js-e-product-form" method="post"> <input name="CartCmd" type="hidden" value="Add"> <input type="hidden" name="ProductID" value="@productData.id"> <input name="VariantID" type="hidden" value=""> <input name="UnitID" type="hidden" value=""> <input name="Redirect" type="hidden" value=""> <div class="danfilter-product-list-add-to-cart-wrapper"> <input name="Quantity" type="hidden" value="1"> <button class="btn btn-primary" type="submit">@Translation.GetTranslation( "eCom Product - Add To Cart - Button" )</button> </div> </form> </div> </div> </div> </div> } } @helper ProductlistItemDanFilter( RazorTemplateBase< RazorTemplateModel< Template > >.LoopItem product, string productlistItemClassList = null ) { if ( product != null ) { List<dynamic> filterTypes = GetFilterTypes( product.GetLoop( "ProductCategories" ) ); List<dynamic> imageOverlays = GetImageOverlays( product.GetLoop( "ProductCategories" ) ); danfilterModels.PriceList prices = danfilterService.ProductService.Instance.GetPrices( product.GetString( "Ecom:Product.ID" ), EcomContext.LanguageID, PriceType.QuantityPrice ); EspressoPrice productEspressoPrice = GetLowestEspressoPrice( product.GetString( "Ecom:Product.ID" ), prices ); EspressoPrice productEspressoBeforePrice = GetLowestEspressoBeforePrice( product.GetString( "Ecom:Product.ID" ), prices ); string pricePrefix = GetPricePrefix(product.GetString( "Ecom:Product.ID" ), prices); dynamic productData = new { id = product.GetString( "Ecom:Product.ID" ), variantId = product.GetString( "Ecom:Product.VariantID" ), url = ProductService.Instance.GetProductLink( product.GetString( "Ecom:Product.PrimaryOrFirstGroupID" ), product.GetString( "Ecom:Product.ID" ), product.GetString( "Ecom:Product.VariantID" ) ), number = product.GetString( "Ecom:Product.Number" ), name = ProductService.Instance.GetName( product.GetString( "Ecom:Product.ID" ), product.GetString( "Ecom:Product.VariantID" ) ), imageLarge = ImageService.Instance.GetImageURL( product.GetString( "Ecom:Product.ImageDefault.Clean" ), 400, 400, 5 ), pricePrefix = pricePrefix, price = productEspressoPrice,//danfilterService.ProductService.Instance.GetPrice( product.GetString( "Ecom:Product.ID" ) ), priceBefore = productEspressoBeforePrice,//danfilterService.ProductService.Instance.GetBeforePrice( product.GetString( "Ecom:Product.ID" ) ), descriptionShortExtra01 = product.GetString( "Ecom:Product:Field.DescriptionShortExtra01" ), discountLable = HasDiscount(product.GetString( "Ecom:Product.ID" )), freeDeliveryLable = HasFreeDelivery(product.GetString( "Ecom:Product.ID" )), filterTypes = filterTypes, hasFilterTypes = filterTypes.Count > 0, imageOverlays = imageOverlays, hasImageOverlays = imageOverlays.Count > 0, stock = new { id = product.GetString( "Ecom:Product:Stock.ID" ), quantity = product.GetString( "Ecom:Product.Stock" ), text = product.GetString( "Ecom:Product:Stock.Text" ), delivery = product.GetString( "Ecom:Product:Stock.DeliveryText" ) } }; bool showBeforePrice = productData.priceBefore.Price != 0 && productData.priceBefore.Price > productData.price.Price; <div class="@productlistItemClassList"> <div class="e-products-item js-e-products-item js-e-products-item-@productData.id js-e-block-link e-block-link " data-variant-id="@productData.variantId"> <div class="e-products-item-container"> <div class="e-products-item-image-container"> <a class="e-products-item-image-wrapper" href="@productData.url"> <img src="@productData.imageLarge" alt="" class="e-products-item-image"> </a> </div> <div class="e-products-item-text-container text-center"> <h3 class="e-products-item-name mb-0"> <a href="@productData.url"> @productData.name </a> </h3> <div class="danfilter-productlist-item-pictogram-wrapper"> @if ( productData.filterTypes.Count > 0 ) { foreach ( dynamic filterType in productData.filterTypes ) { <img src="@filterType.url" alt="@filterType.label" title="@filterType.label"> } } </div> @{ ProductStatus productStatus = Co3.Danfilter.Website.Services.ProductService.Instance.GetProductStatus( productData.id, productData.variantId ); } @RenderingService.Instance.PartialView( "/eCom/Product/_partials/productStatusStock.cshtml", productStatus ) <form action="/system/data/cart" class="e-product-form js-e-product-form" method="post"> <input name="CartCmd" type="hidden" value="Add"> <input type="hidden" name="ProductID" value="@productData.id"> <input name="VariantID" type="hidden" value=""> <input name="UnitID" type="hidden" value=""> <input name="Redirect" type="hidden" value=""> <div class="danfilter-product-list-add-to-cart-wrapper"> <input name="Quantity" type="hidden" value="1"> <button class="btn btn-primary" type="submit">@Translation.GetTranslation( "eCom Product - Add To Cart - Button" )</button> </div> </form> </div> </div> </div> </div> } } @helper sectionStart( string sectionClasses = "e-section", string contentClasses = null, bool sectionCollapse = false, string sectionId = null, string collapseToggleTextExpand = null, string collapseToggleTextCollapse = null ) { sectionId = string.IsNullOrEmpty( sectionId ) ? Guid.NewGuid().ToString( "N" ) : sectionId; ClassList sectionClassList = new ClassList(); sectionClassList.AddClasses( sectionClasses ); ClassList contentClassList; if ( contentClasses == null ) { contentClassList = Co3.Espresso.Website.Services.PageService.Instance.GetResponsiveClassesFromPageItem( PageView.Current().Page.Item ); } else { contentClassList = new ClassList(); contentClassList.AddClasses( contentClasses ); } // TODO: Split collapse logic into separate helper function. string collapseId = Guid.NewGuid().ToString( "N" ); ClassList collapseToggleClassList = new ClassList(); if ( sectionCollapse ) { sectionClassList.AddClasses( "p-section-collapse js-p-section-collapse" ); collapseToggleClassList.AddClasses( contentClasses ); collapseToggleClassList.AddClasses( "p-section-collapse-toggle collapsed order-last text-center" ); contentClassList.AddClasses( "p-section-collapse-content collapse is-md" ); } @:<section class="@sectionClassList" id="@sectionId"> @:<div class="container-fluid"> @:<div class="row"> // TODO: Split collapse logic into separate helper function. if ( sectionCollapse ) { <div class="@collapseToggleClassList" data-toggle="collapse" data-target="#@collapseId"> <button class="btn bg-white p-section-collapse-toggle-btn" type="button"> <i class="material-icons p-section-collapse-toggle-icon">keyboard_arrow_down</i> </button> <small class="h4 p-section-collapse-toggle-text" data-expand-text="@( string.IsNullOrEmpty( collapseToggleTextExpand ) ? GetStandardCollapseToggleTextExpand() : collapseToggleTextExpand )" data-collapse-text="@( string.IsNullOrEmpty( collapseToggleTextCollapse ) ? GetStandardCollapseToggleTextCollapse() : collapseToggleTextCollapse )"></small> </div> } @:<div class="@contentClassList" id="@collapseId"> @:<div class="row"> } @helper sectionEnd() { @:</div> @:</div> @:</div> @:</div> @:</section> } 2 3@{ ClassList productlistItemClassList = new ClassList(); Dictionary< string, decimal > paragraphEcommerceGridItemWidth = ProductlistService.Instance.GetGridItemWidth( PageView.Current().CurrentParagraph.Item.GetValue< string >( "ItemWidth" ) ); productlistItemClassList.AddClasses ( paragraphEcommerceGridItemWidth.ToResponsiveClasses () ); } <script> function trackProductClick(productObj) { dataLayer.push({ 'event': 'productClick', 'ecommerce': { 'click': { 'products': [{ 'name': productObj.name, 'id': productObj.id, 'price': productObj.price.Price }] } }, 'eventCallback': function() { document.location = productObj.url; } }); return false; } </script> <div class="e-productlist js-gtm-tracking-productlist"> <div class="row"> <div class="col-12"> <div class="e-productlist-body"> <div class="row"> <div class="col-12"> <div class="e-products"> <div class="row"> @{ int productIndex = 1; } <script> var arrImpressions = []; </script> @foreach ( LoopItem product in GetLoop( "Products" ) ) { if ( product.GetBoolean("Ecom:Product.Discontinued") == false ) { @ProductlistItem( product, productlistItemClassList.ToString() ) IEnumerable< ProductGroupRelation > groups = Dynamicweb.Ecommerce.Services.ProductGroups.GetProductGroupRelations( product.GetString( "Ecom:Product.ID" ) ); string listName = string.Empty; if ( groups != null && groups.FirstOrDefault( g => g.IsPrimary ) != null ) { listName = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup( groups.FirstOrDefault( g => g.IsPrimary ).GroupId )?.Name ; } <script> arrImpressions.push({ "id": '@product.GetString( "Ecom:Product.ID" )', "name": '@product.GetString( "Ecom:Product.Name" )', "price": @product.GetDouble( "Ecom:Product.Price.Price" ), "position": @productIndex, "list": '@listName' }); </script> productIndex++; } } </div> </div> </div> </div> </div> </div> </div> </div> <script> dataLayer.push({ "ecommerce": { "currencyCode": "@Context.Currency.Code", "impressions": arrImpressions } }); </script>

Er du usikker på, hvordan du nedbringer radonnivået i boligen din, eller hvilket filter som passer til anlegget ditt? Så kan du kontakte våre flinke filtereksperter her.

Skrevet af: Michelle, Filterhuset

Tilmeld nyhedsbrev

​ Tags

Inneklima

Les mer av inspirasjonsartiklene våre

keyboard_arrow_up