Logo
Exception in template (Designs\Merrild\eCom/Productlist/ProductListPageNoPagination.cshtml): System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.cccebaafecfcd.Execute()
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context)
   at RazorEngine.Razor.Parse[T](String razorTemplate, T model, String cacheName)
   at Dynamicweb.Rendering.Template.Output()
@inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @using System; @using System.Web; @using Lavazza.CustomModules.Classes; @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @using System; @using System.Web; @using Lavazza.CustomModules; @using Lavazza.CustomModules.Classes; @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @using System; @using System.Web; @using System.Text.RegularExpressions @functions{ public class WrapMethods { //Gets the contrasting color public static string getContrastYIQ(string hexcolor) { if (hexcolor != "") { hexcolor = Regex.Replace(hexcolor, "[^0-9a-zA-Z]+", ""); int r = Convert.ToByte(hexcolor.Substring(0, 2), 16); int g = Convert.ToByte(hexcolor.Substring(2, 2), 16); int b = Convert.ToByte(hexcolor.Substring(4, 2), 16); int yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000; if (yiq >= 128) { return "black"; } else { return "white"; } } else { return "black"; } } //Truncate text public static string Truncate (string value, int count, bool strip=true) { if (strip == true){ value = StripHtmlTagByCharArray(value); } if (value.Length > count) { value = value.Substring(0, count - 1) + "..."; } return value; } //Strip text from HTML public static string StripHtmlTagByCharArray(string htmlString) { char[] array = new char[htmlString.Length]; int arrayIndex = 0; bool inside = false; for (int i = 0; i < htmlString.Length; i++) { char let = htmlString[i]; if (let == '<') { inside = true; continue; } if (let == '>') { inside = false; continue; } if (!inside) { array[arrayIndex] = let; arrayIndex++; } } return new string(array, 0, arrayIndex); } //Make the correct count of columns public static string ColumnMaker(int Col, string ScreenSize) { string Columns = ""; switch (Col) { case 1: Columns = "col-"+ScreenSize+"-12"; break; case 2: Columns = "col-"+ScreenSize+"-6"; break; case 3: Columns = "col-"+ScreenSize+"-4"; break; case 4: Columns = "col-"+ScreenSize+"-3"; break; default: Columns = "col-"+ScreenSize+"-3"; break; } return Columns; } private string Custom(string firstoption, string secondoption) { if (firstoption == "custom") { return secondoption; } else { return firstoption; } } } } @helper GetProductList(dynamic Loop, int ColMD = 3, int ColSM = 3, int ColXS = 1) { <script type="text/javascript"> MasonryLayoutMode = "fitRows"; </script> string searchWords = HttpContext.Current.Request.QueryString["search"]; bool isSearch = searchWords != null; int Count = 0; string ColumnsMD = WrapMethods.ColumnMaker(ColMD, "md"); string ColumnsSM = WrapMethods.ColumnMaker(ColSM, "sm"); string ColumnsXS = WrapMethods.ColumnMaker(ColXS, "xs"); foreach (LoopItem product in Loop) { string ProductID = product.GetString("Ecom:Product.ID"); string Image = product.GetString("Ecom:Product:Field.MainProductImage"); string Picto = product.GetString("Ecom:Product:Field.ProductPictogram"); string GroupLink = product.GetString("Ecom:Product.LinkGroup.Clean"); string Name = product.GetString("Ecom:Product.Name"); string Description = product.GetString("Ecom:Product.ShortDescription"); string Discount = product.GetString("Ecom:Product.Discount.Price"); string Price = product.GetString("Ecom:Product.Price"); string RawPrice = product.GetString("Ecom:Product.Price.PricePIP"); string Filters = product.GetString("Ecom:Product:Field.FilterValues"); string filterClasses = string.Empty; string addFavorite = product.GetString("Ecom:Product.AddToFavorites"); string removeFavorite = product.GetString("Ecom:Product.RemoveFromList"); bool inFavoriteList = product.GetBoolean("Ecom:Product.IsProductInFavoriteList"); string AlternativeProductName = product.GetString("Ecom:Product:Field.TxtMachinesCoffee"); if (!string.IsNullOrWhiteSpace(AlternativeProductName)) { Name = AlternativeProductName; } if (isSearch) { var groupId = product.GetString("Ecom:Product.PrimaryOrFirstGroupID"); if(!string.IsNullOrEmpty(groupId)) { var groupIds = Pageview.Area.Item["MachinesGroupIds"].ToString().Split(','); foreach (var id in groupIds) { // If machine, we link to the right page if(PIMCommerceUtilities.BelongsToSubHierarchy(groupId, Dynamicweb.eCommerce.Products.Group.GetGroupByID(id))) { GroupLink = String.Format("Default.aspx?ID=9102&GroupID={0}&ProductID={1}", groupId, ProductID); } } } } //if (!string.IsNullOrWhiteSpace(Filters)) //{ // filterClasses = "filter-" + Filters.Trim().Replace(",", " filter-"); //} <div class="productlist grid-item @ColumnsMD @ColumnsSM @ColumnsXS @filterClasses" data-name="@HttpUtility.HtmlEncode(Name.ToLower())" data-price="@RawPrice" data-filter-classes="@filterClasses"> <div class="boxproduct wp-block product"> <div class="listproductright"> <a href="@GroupLink" title="@HttpUtility.HtmlEncode(Name)"> <figure class="productfigure" id="productimgbox"> <img alt="@HttpUtility.HtmlEncode(Name)" src="@PIMCommerceUtilities.GetPerfionImageUrl(Image,"251x251")" class=" img-center"> </figure> @if (!string.IsNullOrEmpty(Picto)) { <span class="product-picto"><img alt="" src="@PIMCommerceUtilities.GetPerfionImageUrl(Picto, "50x50")" /></span> } </a> </div> <div class="extracolumn"> <h2 class="product-title"><a href="@GroupLink">@Name</a></h2> <p class="product-shortdesc"><a href="@GroupLink">@Description</a></p> </div> @*<div class="listproductleft wp-block-footer">*@ @*@if (Discount != Price) { <span class="productprice price pull-left" style="padding: 0 0 0 0 !important; font-size: 16px !important"><strong>@Discount</strong></span> <span class="productpricebr"></span> <p class="productoldprice price" style="margin-top: 0px !important; padding-top: 0px !important; color: #AAAAAA !important; font-size: 12px !important; text-decoration: line-through">@Price</p> } else { <span class="productprice price pull-left" style="font-size: 16px !important"><strong>@Price</strong></span> }*@ @*<div class="pull-left icon facebook"><a href="http://facebook.com" target="_blank" title="@Translate("Share on facebook", "Share on Facebook")"><i class="fa fa-facebook fa-lg" aria-hidden="true"></i></a></div> <div class="pull-left icon pinterest"><a href="http://pinterest.com" target="_blank" title="@Translate("Share on pinterest", "Share on Pinterest")"><i class="fa fa-pinterest-p fa-lg" aria-hidden="true"></i></a></div>*@ @*<div class="pull-right icon cart-arrow"><a href="@GroupLink" title="@Translate("Add to basket", "Add to basket")"><i class="fa fa-cart-arrow-down fa-lg" aria-hidden="true"></i></a></div>*@ @*Add/remove MyList if logged in*@ @*@if (Dynamicweb.Input.FormatBoolean(GetGlobalValue("Global:Extranet.UserName"))) { if (inFavoriteList == true) { <div class="pull-right icon pinterest"><a class="heart" href="@removeFavorite" title="@Translate("Remove from favoritlist", "Remove from favoritlist")"><i class="fa fa-heart fa-lg" aria-hidden="true"></i></a></div> } else { <div class="pull-right icon pinterest"> <a class="heart" href="@addFavorite" title="@Translate("Add to favoritlist", "Add to favoritlist")"><i class="fa fa-heart-o fa-lg" aria-hidden="true"></i></a> </div> } }*@ @*<div class="pull-right icon eye"><a href="@GroupLink" title="@Translate("View details", "View details")"><i class="fa fa-eye fa-lg" aria-hidden="true"></i></a></div>*@ @*</div>*@ @*@if (Discount != Price) { if (Pageview.Area.Item["EcommerceStickerType"].ToString() == "ribbon") { <span class="ribbon base">@Translate("On sale!", "On sale!")</span> } if (Pageview.Area.Item["EcommerceStickerType"].ToString() == "ball") { <span class="ball">@Translate("On sale!", "On sale!")</span> } }*@ </div> </div> @*Count++; if (Count == ColMD) { <div class="row"></div> Count = 0; }*@ } } @{ string searchWords = HttpContext.Current.Request.QueryString["search"]; bool isSearch = searchWords != null; string grouplink = ""; if (!string.IsNullOrWhiteSpace(GetString("Ecom:ProductList:Page.GroupID"))) { grouplink = "/Default.aspx?ID=" + GetString("Ecom:ProductList:Page.ID") + "&amp;GroupID=" + GetString("Ecom:ProductList:Page.GroupID"); } else { grouplink = "/Default.aspx?ID=" + GetString("Ecom:ProductList:Page.ID") + "&amp;search=" + GetString("Ecom:ProductList:Search.Query"); } var products = GetLoop("Products"); var distinctFilters = (from LoopItem product in products select product.GetString("Ecom:Product:Field.FilterValues").Split(',')).SelectMany(x => x).Distinct(); } <div class="row"> <div class="col-md-10 col-sm-9 col-xs-12 topinfo"> @if (isSearch) { <h3 class="section-title">@searchWords</h3> } else { <h3 class="section-title">@GetString("Ecom:ProductList:Page.GroupName")</h3> if (!string.IsNullOrEmpty(GetString("Ecom:Group.Description"))) { <p>@GetString("Ecom:Group.Description")</p> } } </div> @*<div class="col-md-4 col-sm-4 col-xs-4 hidden-xs"></div>*@ <div class="col-md-2 col-sm-3 col-xs-4 pull-right hidden-xs"> <div class="btn-group pull-right hidden-xs" style="" id="viewbtns"> <button type="button" class="btn btn-xs btn-three" onclick="BoxView(true)"><span class="glyphicon glyphicon-th fa-2x"></span></button> <button type="button" class="btn btn-xs btn-three" onclick="ListView(true)"><span class="glyphicon glyphicon-th-list fa-2x"></span></button> </div> <div class="pull-right"> @*<div class="btn-group"> <button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false"> @Translate("Sort by", "Sort by") <span class="caret"></span> </button> <ul class="dropdown-menu dropdown-menu-right" role="menu"> <li><a class="pill-left sort-btn" data-sortby="price" data-sortorder="asc">@Translate("Price low-high", "Price low-high")</a></li> <li><a class="pill-left sort-btn" data-sortby="price" data-sortorder="desc">@Translate("Price high-low", "Price high-low")</a></li> </ul> </div> &nbsp;&nbsp;*@ </div> </div> </div> @if (!isSearch) { <div class="row"> <div class="col-md-12"> <ul class="filters-list"> @foreach (var feature in GetLoop("FilterFeatures")) { int nbFilters = (from LoopItem option in feature.GetLoop("Options") select option.GetString("Option.Value")).Distinct().Count(); if (nbFilters > 1) { var options = feature.GetLoop("Options"); var applicableFilters = options.Count(x => distinctFilters.Contains(x.GetString("Option.Value"))); if (applicableFilters > 1) { <li class="filter button-group" data-filter-group="@feature.GetString("Feature.name")"> <h4>@feature.GetString("Feature.caption")</h4> <ul class="filter-options-list"> <li class="filter-option is-checked" data-filter=""> @Translate("AllFilters", "All") </li> @foreach (var option in options) { if (distinctFilters.Contains(option.GetString("Option.Value"))) { <li class="filter-option" data-filter=".filter-@option.GetString("Option.Value")"> @option.GetString("Option.Label") </li> } } </ul> </li> } } } </ul> </div> @*(groupdescription)*@ @*<div class="col-md-12 group-description"> <article> <p> @GetString("Ecom:Group.Description") </p> </article> </div>*@ <div class="col-md-12 col-sm-12 col-xs-12 sortbutton"> <p class="center-white pull-right" style="margin-bottom: 30px !important"> <a href='@Translate("ProductlisteLinkKaffeTop", "http://foodservice.merrild.dk/kontakt")' class="btn btn-dw-primary ">@Translate("ProductlisteLinkKaffeTopText", "Kontakt os")</a> </p> </div> </div> } <div class="row grid main-product-list"> @GetProductList(products, 4) </div> <div class="row"> <div class="col-md-12 col-sm-12 col-xs-12 sortbutton"> <p class="center-white pull-right" style="margin-bottom: 30px !important"> <a href='@Translate("ProductlisteLinkKaffeBund", "http://foodservice.merrild.dk/kontakt")' class="btn btn-dw-primary ">@Translate("ProductlisteLinkKaffeBundText", "Kontakt os her")</a> </p> </div> </div> <script> @{ string banner = string.Empty, background = string.Empty, bannerMobile = string.Empty; if (!isSearch) { var parents = Dynamicweb.eCommerce.Products.Group.GetGroupByID(GetString("Ecom:Group.ID")).ParentGroups; if (string.IsNullOrEmpty(GetString("Ecom:Group:Field.Banner")) ) { if (parents.Count > 0) { string parentBanner = parents[0].ProductGroupFieldValues.GetProductGroupFieldValue("Banner").Value.ToString(); if (!string.IsNullOrEmpty(parentBanner)) { banner = PIMCommerceUtilities.GetPerfionImageUrl(parentBanner); } } } else { banner = PIMCommerceUtilities.GetPerfionImageUrl(GetString("Ecom:Group:Field.Banner")); } if (string.IsNullOrEmpty(GetString("Ecom:Group:Field.MobileBanner"))) { if (parents.Count > 0) { string parentBannerMobile = parents[0].ProductGroupFieldValues.GetProductGroupFieldValue("MobileBanner").Value.ToString(); if (!string.IsNullOrEmpty(parentBannerMobile)) { bannerMobile = PIMCommerceUtilities.GetPerfionImageUrl(parentBannerMobile); } } } else { bannerMobile = PIMCommerceUtilities.GetPerfionImageUrl(GetString("Ecom:Group:Field.MobileBanner")); } if (string.IsNullOrEmpty(GetString("Ecom:Group:Field.CategoryBackground"))) { if (parents.Count > 0) { string parentBackground = parents[0].ProductGroupFieldValues.GetProductGroupFieldValue("CategoryBackground").Value.ToString(); if (!string.IsNullOrEmpty(parentBackground)) { background = PIMCommerceUtilities.GetPerfionImageUrl(parentBackground); } } } else { background = PIMCommerceUtilities.GetPerfionImageUrl(GetString("Ecom:Group:Field.CategoryBackground")); } } } ProductListSettings = { GroupLink: '@grouplink', GroupBanner: '@banner', GroupBannerMobile: '@bannerMobile', GroupBackground: '@background', EcommerceProductListForm: '@Pageview.Area.Item["EcommerceProductListForm"].ToString()', SortSettings: { sortBy: 'original-order' }, IsSearch: @isSearch.ToString().ToLower() }; </script> <script src="/Files/Templates/Designs/Dwsimple/js/pages/productlist.js" defer="defer"></script>
logo
bean

Ofte stillede spørgsmål

Hvordan kontakter jeg jer?

Du kan kontakte os her:

Telefon:+45 63 103 103
Email: kundeservice@merrild-kaffe.dk

Vi har åbent mandag-torsdag kl. 08.00 - 16.00, og fredag fra 08.00 - 15.30.

Er det jer, der sælger den originale Merrild kaffe?

Ja, det er os der har den velkendte Merrild-kaffe i sortiment

Vi har både formalet kaffe, hele bønner og instant kaffe. Og vi kan også tilbyde økologisk og bæredygtig Merrild kaffe.

Sælger I kaffeautomater?

Ja, vi har et bredt udvalg af kaffeautomater

Vi har et sortiment, der dækker et bredt behov:

 - Espresso: manuel, fuldautomatisk, BLUE - lille men med stor smag

 - Filter: løsninger til filterbønner og filterbryg

 - Instant: hurtige kaffeløsninger uden at gå på krompomis med smagen

Bliv klogere på vores løsninger her.

Hvor lang tid tager levering?

Hvis du bestiller inden kl. 12.00, modtager du dine varer inden for 2 hverdage.

Sælger I også te?

Ja, det gør vi

Vi har den helt fantastiske Whittington te i sortiment - bliv inspireret.

Accepter cookies på dette website

Ved at besøge www.merrild.dk accepterer du, at der anvendes cookies, som vi og vores samarbejdspartnere benytter til funktionalitet, statistik og markedsføring. Læs mere om cookies her>
Du kan altid slette gemte cookies i dine browser indstillinger.

Accepter alle cookies