Magnusson & Freij Logotyp
Vi fixar det
Magnusson & Freij
Det fixar vi!
Kundtjänst 031 - 709 62 00
Det fixar vi!
Kundtjänst 031 - 709 62 00
Sök
SUMMA VARUKORG
0 (exkl. moms)
0
Kundtjänst 031 - 709 62 00
Exception in template (Designs\MF-Responsive\eCom/Productlist/ProductList.cshtml): System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.fbfbcaccbabefb.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.Web; @{ var groupId = Convert.ToString(HttpContext.Current.Request.QueryString["GroupID"]); var pagingHref = GetGlobalValue("Global:Request.Url"); if (!string.IsNullOrWhiteSpace(groupId) && groupId.Length < 11) { <div class="row no-gutters"> <div class="col-12 mf-grey-bg"> <ul class="breadcrumbs pl-3 standart-padding"> <li> <span class="text-mf-darkest-blue text-size-12 font-weight-bold">@GetString("Ecom:Group.Name") /</span> </li> </ul> </div> </div> <div class="row m-0 p-0"> <div class="col-lg-6 col-md-12 col-12 p-3 p-md-5 standart-padding mf-group-header font-weight-bold"> @GetString("Ecom:Group:Field.Header") </div> <div class="col-lg-6 col-md-12 col-12 m-0 p-0 mf-banner-img"> <img class="img-fluid" src="@GetString("Ecom:Group.LargeImage")" /> </div> </div> <div class="row m-0 " style="min-height: 250px"> <div class="col-md-6 col-lg-9 col-sm-12 m-0 p-0 border-left-grey"> <div class="row m-0 pt-3 pt-md-5 pb-5 standart-padding pr-3 pl-3 h-100"> <div class="col-12 m-0 p-0"> <div class="position-vertical-middle"> @GetString("Ecom:Group.Description") </div> </div> </div> </div> <div class="col-md-6 col-lg-3 hidden-sm-down border-left-grey"> <div class="card-block text-center"> <img src="/Files/Images/web/kundtjanst.gif" style="width: 70px" alt="kundtjänst" /> <div class="card-title text-mf-darkest-blue text-size-24 font-Covered-By-Your-Grace" >Beh&ouml;ver du r&aring;d?</div> @RenderSnippet("CustomerCervice") </div> </div> </div> <div class="row mf-devider standart-padding pr-3 pl-3"> <div class="mf-devider-text text-uppercase col-md-12"> V&auml;lj kategori </div> </div> <div class="row p-0 m-0"> @foreach (var group in GetLoop("Subgroups")) { var link = group.GetString("Ecom:Group.Link.Clean"); var name = group.GetString("Ecom:Group.Name"); var img = group.GetString("Ecom:Group.SmallImage"); var count = group.GetString("Ecom:Group.ProductCount"); <a class="mf-group-link mf-link-visible-corner col-12 col-md-6 p-0" href="@link" alt="@name"> <div class="row m-0 pt-5 pb-5 pl-0"> <div class="col-3 col-md-3 p-3 m-auto"> <img class="mf-group-image img-fluid" src="@img" /> </div> <div class="col-7 col-md-9 mf-group-text py-md-2 "> <div class="mf-group-rubrik text-size-24 mb-0 font-weight-bold"> @name </div> <div class="mf-group-undertext font-italic text-size-14"> @count produkter </div> </div> <div class="col-2 hidden-md-up p-0 pr-3 m-0" style="height: inherit; vertical-align:middle"> <img src="/Files/Images/arrow-right.png" alt="Höger" /> </div> <div class="mf-corner-hover-visible"> <img src="/Files/Images/corner-hover.gif" alt="Vänster" /> </div> </div> </a> } </div> } else { if (string.IsNullOrWhiteSpace(Convert.ToString(HttpContext.Current.Request.QueryString["FreeTextSearch"]))) { if (!string.IsNullOrWhiteSpace(groupId)) { var parentId = Dynamicweb.eCommerce.Products.Group.GetGroupByID(GetString("Ecom:Group.ID")).ParentGroupsDefaultLanguage[0].ID; var parent = Dynamicweb.eCommerce.Products.Group.GetGroupByID(parentId); var parentName = parent.Name; var parentLink = pagingHref.Replace("groupid=" + GetString("Ecom:Group.ID"), "groupid=" + parentId); <div class="row no-gutters"> <div class="col-12 mf-grey-bg"> <ul class="breadcrumbs pl-3 standart-padding"> <li> <a class="text-mf-blue text-size-12" href="@parentLink">@parentName</a> </li> <li> <span class="text-mf-darkest-blue text-size-12">@GetString("Ecom:Group.Name")</span> </li> </ul> </div> </div> } <div class="row m-0 p-0"> <div class="col-12 pr-3 pl-3 standart-padding pb-4 pt-4 mf-group-header font-weight-bold"> @GetString("Ecom:Group.Name") </div> </div> <div class="row m-0" style="min-height: 250px"> <div class="col-lg-9 col-md-6 col-sm-12 m-0 p-0 border-left-grey"> <div class="row m-0 pt-5 pb-5 standart-padding pr-3 pl-3" style="height:100%"> <div class="col-12 m-0 p-0"> <div class="position-vertical-middle"> @GetString("Ecom:Group.Description") </div> </div> </div> </div> <div class="col-lg-3 col-md-6 hidden-sm-down border-left-grey"> <div class="card-block text-center"> <img src="/Files/Images/web/kundtjanst.gif" style="width: 70px" alt="kundtjänst" /> <div class="card-title text-mf-darkest-blue text-size-24 font-Covered-By-Your-Grace">Behöver du r&aring;d?</div> @RenderSnippet("CustomerCervice") </div> </div> </div> } <div class="row m-0 p-0 mf-devider-menu"> <div class="col-lg-2 m-0 standart-padding hidden-md-down mf-devider-menu-text"> FILTRERA </div> <div class="col-lg-3 p-0 m-0 no-border-radius"> @GetValue("GroupFilter") </div> <div class="col-lg-2 push-lg-5 p-0 m-0 mf-sortera no-border-radius"> <div class="btn btn-info btn-select m-0 p-0 mw-100" id="sortering"> <input class="btn-select-input" type="hidden" name="" value="" /> <span class="btn-select-value font-italic" id="" style="height: 45px">Sortera efter ...</span> <span class='btn-select-arrow'></span> <ul class="col-12 col-md-2 mw-100"> <li id="UserDefined" value="UserDefined,asc">Standard</li> <li id="Name" value="Name,asc">Alfabetisk</li> <li id="Price" value="Price,asc">Pris</li> </ul> </div> </div> <div class="col-lg-3 pull-lg-2 p-0 m-0 pl-2 mf-checkbox mf-miljomarkning-filter " style=""> <input type="checkbox" id="Miljomarkning" value="touchscreen" class="filter-checkbox no-border-radius" > <label class="text-size-14 font-italic" id="checkbox-label-filter" >Visa bara milj&ouml;m&auml;rkta produkter</label> </div> <div class="col-lg-2 pull-lg-2 p-0 m-0 hidden-md-down no-border-radius"> <div class="btn btn-info btn-select m-0 p-0 mw-100" id="antalProducts"> <input class="btn-select-input" name="" value="" type="hidden" /> <span class="btn-select-value font-italic" id="">24 st/sida</span> <span class='btn-select-arrow'></span> <ul class="col-12 col-md-2 mw-100"> <li id="24" value="24">24 st/sida</li> <li id="48" value="48">48 st/sida</li> <li id="96" value="96">96 st/sida</li> </ul> </div> </div> </div> @******** product list********@ <div class="card-group row m-0 p-0"> <script type="text/javascript"> var itemList = false; </script> @foreach (var product in GetLoop("Products")) { var calcPrice = product.GetDouble("Ecom:Product:Field.Kalkpris"); var stockText = product.GetValue("MF.Stock.Text"); var stockImage = product.GetValue("Ecom:Product:Stock.Image.Clean"); var priceWithoutVat = product.GetValue("Ecom:Product.Price.PriceWithoutVAT"); var currencySymbol = product.GetValue("Ecom:Product.Price.Currency.Symbol"); var productLink = product.GetString("Ecom:Product.LinkGroup.Clean"); var productName = product.GetString("Ecom:Product.Name"); var productNumber = product.GetString("Ecom:Product.Number"); var productId = product.GetString("Ecom:Product.ID"); var productImage = product.GetString("Ecom:Product.ImageSmall.Default.Clean"); var productUnit = product.GetString("Ecom:Product:Field.Enhet.Value"); var unitExists = product.GetString("MF.Units.Exists"); var unitSelectId = string.Format("{0}img", productNumber); var altEnhetOrderstd = product.GetBoolean("Ecom:Product:Field.AltEnhetOrderstd"); var isCampaign = product.GetBoolean("Ecom:Product:Field.IsCampaign"); var isLowPrice = product.GetBoolean("Ecom:Product:Field.LowPrice.Value"); var campaignPriceClass = isCampaign ? "mf-campaign-price" : ""; var hasYouTubeLink = product.GetString("Ecom:Product:Field.YouTubeKlipp.Value") != ""; var isEco = product.GetBoolean("Ecom:Product:Field.Miljomarkt"); var ecoLabelImage = new string[6]; var ExpiredProduct = product.GetBoolean("Ecom:Product:Field.ExpiringProduct"); for (var i = 0; i < 6; i++) { var nr = i + 1; var value = "Ecom:Product:Field.Ecolabel" + nr + ".Value.Clean"; if (product.GetBoolean(value)) { ecoLabelImage[i] = "<img src='/admin/public/GetImage.aspx?Image=/Files/Images/mm" + nr + ".png&Format=png&Width=64&Height=64&Resolution=100&crop=5' alt='eco" + nr + "' style='width: inherit;' />"; isEco = true; } } var ecoClass = isEco? "product-eco-vertical" : ""; if (string.IsNullOrWhiteSpace(productImage)) { productImage = "/Files/Images/Ecom/Products/ingenbild.png"; } else { //productImage = string.Format("/Admin/Public/GetImage.ashx?Image={0}&Format=jpg&Width=200&Height=200&Crop=6&DoNotUpscale=True", productImage); } <div class="product card col-md-3 col-6 m-0 p-0 @ecoClass"> <div class="card-header"> @if (isCampaign || ExpiredProduct || isLowPrice) { var flagCount = 0; if (isCampaign) { flagCount += 1; } if (ExpiredProduct) { flagCount += 1; } if (isLowPrice) { flagCount += 1; } if (flagCount > 1) { <ul> @if (isCampaign) { <li><div><span>Kampanj</span></div></li> } @if (ExpiredProduct) { <li><div><span>Utgående</span></div></li> } @if (isLowPrice) { <li><div><span>Alltid lågpris</span></div></li> } </ul> } else { <ul> @if (isCampaign) { <li><div><span>Kampanj</span></div></li> <li><div style="background-color: white !important" ;><span></span></div></li> } @if (ExpiredProduct) { <li><div><span>Utgående</span></div></li> <li><div style="background-color: white !important" ;><span></span></div></li> } @if (isLowPrice) { <li><div><span>Alltid lågpris</span></div></li> <li><div style="background-color: white !important" ;><span></span></div></li> } </ul> } } </div> <a class="product-link" href="@productLink"> <div class="productlist-eco-wrapper"> @for (var i = 0; i < 6; i++) { if (ecoLabelImage[i] != "") { @ecoLabelImage[i] } } </div> <div class="productlist-youtube-wrapper"> @if (hasYouTubeLink) { <div class="youtube-image-view-1"></div> } </div> <div class="img-wrapper"> <img class="card-img-top img-fluid" src="@productImage" alt="@productName"> </div> <div class="card-block text-center"> @{ var textSizeClass = "text-size-16"; if (productName.Length > 44) { textSizeClass = "text-size-16 text-size-sm-12"; } } <h4 class="card-title @textSizeClass">@productName</h4> <p class="card-text"> <span class="stock-dot"> <img src="@stockImage" title="@stockText" alt="@stockText"/><span class="font-italic text-size-12">Art nr: @productNumber</span> </span> <div> <span id="itemPrice" class="itemPrice @campaignPriceClass">@priceWithoutVat @currencySymbol</span> @if (calcPrice > 0) { <span id="itemCalcPrice" class="kalkpris-list2">(Kp:@calcPrice)</span> } </div> </p> </div> </a> <div class="card-footer"> <form action="" method="post" class=""> <div class="row no-gutters product-quantity-controller"> <div class="col-3 col-lg-2 amount"> <input type="hidden" name="productid" value="@productId" /> <input type="hidden" name="cartcmd" value="add" /> <input id="quantity" data-product-id="@productId" class="NumericQuantityText w-100 h-100 text-center border-0" maxlength="4" name="quantity" type="text" value="1" /> </div> <div class="col-2 col-lg-1 amount-increase-decrease"> <div data-increase-product-id="@productId" class='h-50 w-100 text-center increase-amount text-grey'>+</div> <div data-decrease-product-id="@productId" class='h-50 w-100 text-center decrease-amount text-grey'>-</div> </div> <div class="col-7 col-lg-5 p-0 m-0 no-border-radius"> <div class="btn btn-info btn-select m-0 p-0 mw-100 buy-buttons"> <input class="btn-select-input" type="hidden" name="UnitID" value="" /> <span class="btn-select-value font-italic " data-id="@unitSelectId" data-volume="" data-price="" data-calcprice=""></span> <span class='btn-select-arrow'></span> <ul class="col-12 col-md-2 mw-100"> @{ var selecte = ""; if (!altEnhetOrderstd) { selecte = "selected"; <li class="@selecte" id="@productUnit" value="@productUnit" data-volume="" data-price="@priceWithoutVat" data-calcprice="@calcPrice"> @productUnit </li> } } @foreach (LoopItem unit in product.GetLoop("MFUnits")) { var unitId = unit.GetString("MF.Unit.ID"); selecte = selecte == "" ? "selected" : "sel"; <li class="@selecte" id="@unitId.ToUpper()" value="@unitId" data-volume="@unit.GetString("MF.Unit.Volume")" data-price="@priceWithoutVat" data-calcprice="@calcPrice"> @unitId.ToUpper() </li> } </ul> </div> </div> <div class="col-12 col-lg-4 cart-button-wrapper"> <input type="submit" alt="K&Ouml;P" value="K&Ouml;P" class="btn btn-primary btn-buy float-right w-100" /> </div> </div> </form> </div> </div> } <script type="text/javascript"> itemList = true; </script> </div> for (var i = 2; i < GetInteger("Ecom:ProductList.TotalPages") + 1; i++) { <div class="card-group row m-0 p-0 productList-LoadMore hidden-lg-up" id='@i' data-nr="@i"></div> } @******** Pagination *********@ <div class="row m-0 p-0 mf-devider-menu"> <div class="col-12 standart-padding m-0 p-0"> <ul class="pagination hidden-sm-down" style="padding-top: 11px;"> @{ var totalpages = GetInteger("Ecom:ProductList.TotalPages"); var currentpage = GetInteger("Ecom:ProductList.CurrentPage"); int start, slut; if (totalpages < 6) { start = 0; slut = totalpages; } else { start = (totalpages - currentpage) > 5 ? (currentpage > 3 ? currentpage - 3 : 0) : totalpages - 6; slut = currentpage < totalpages - 2 ? (currentpage > 4 ? currentpage + 3 : 6) : totalpages + 1; } if (totalpages > 1) { <li class="page-item disable"><span class="">Sida:</span></li> foreach (var page in GetLoop("Ecom:ProductList.Pages")) { var pagenumber = (int)page.GetValue("Ecom:ProductList.Pages.Page.Number"); var firstPageLink = page.GetBoolean("Ecom:ProductList.Pages.Page.IsFirstPage") ? page.GetString("Ecom:ProductList.Pages.Page.UrlHtmlEncoded") : "#"; var lastPageLink = page.GetBoolean("Ecom:ProductList.Pages.Page.IsLastPage") ? page.GetString("Ecom:ProductList.Pages.Page.UrlHtmlEncoded") : "#"; if (firstPageLink != "#" && currentpage > 3 && totalpages > 5) { <li class="page-item text-mf-blue pl-3"> <a class="mf-page-link" href="@firstPageLink"> @pagenumber </a> </li> <li class="page-item pl-3 text-mf-blue">...</li> } if (start < pagenumber && pagenumber <= slut) { if (page.GetBoolean("Ecom:ProductList.Pages.Page.IsCurrent")) { <li class="page-item disable product-list-paging-current text-mf-grey-dark pl-3"> <strong>@page.GetValue("Ecom:ProductList.Pages.Page.Number")</strong> </li> } else { <li class="page-item text-mf-blue pl-3"> <a class="mf-page-link" href="@page.GetString("Ecom:ProductList.Pages.Page.UrlHtmlEncoded")"> @pagenumber </a> </li> } } if (lastPageLink != "#" && currentpage < totalpages - 2 && totalpages > 5) { <li class="page-item pl-3 text-mf-blue">...</li> <li class="page-item pl-3 text-mf-blue"> <a class="mf-page-link" href="@lastPageLink"> @pagenumber </a> </li> } } } } </ul> @{ var separation = pagingHref.Contains("?") ? "&" : "?"; var nyUrl = pagingHref + separation + "PageNum="; <div class="hidden-lg-up text-center m-0 p-0" id="btn-load-more"> <input type="button" class="btn btn-link text-mf-blue btn-lg m-0 p-0 btn-load-more" data-load-more-type="productList" data-next-page="2" data-page-url="@nyUrl" data-totalpages="@totalpages" id="loadMoreBtn" value="L&auml;s in fler..."> </div> } </div> </div> } }
Ta del av erbjudanden och aktuell information
Anmäl dig till vårt nyhetsbrev!
© Magnusson & Freij 2018 Org.nummer: 556068-6940
Org.nummer: 556068-6940