STÄNG

Denna webbplats använder cookies för statistik, anpassat innehåll och annonser. Läs mer

träffar.

No hits.
Exception in template (eCom/Product/M_Product_MR.cshtml): System.NullReferenceException: Objektreferensen har inte angetts till en instans av ett objekt.
   vid CompiledRazorTemplates.Dynamic.fbebebdcfbf.Execute()
   vid RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context)
   vid RazorEngine.Razor.Parse[T](String razorTemplate, T model, String cacheName)
   vid Dynamicweb.Rendering.Template.Output()
@using System.Linq; <section class="content productpage"> <div class="div-max1170-centered"> <div class="row"> <div class="col-sm-5"> <!-- Left Column --> <div class="productimages-area"> <div class="productimages-wrapp"> @{ bool imgControl = false; bool imgFunctions = false; } <div class="carousel slide" id="carousel-productimages"> <!-- Wrapper for slides --> <div class="carousel-inner"> @{ var counter = 0; var prodnumber = GetValue("Ecom:Product.Number"); var curprodpath = Dynamicweb.Base.GetGs("/Globalsettings/monteriva/productimagepath") + "/" + prodnumber; var imglist = new List<string>(); try { string[] imgfiles = System.IO.Directory.GetFiles(System.Web.HttpContext.Current.Server.MapPath(curprodpath)); for (int i = 0; i < imgfiles.Length; i++) { string firstimagename = prodnumber + ".jpg"; if (!imgfiles[i].EndsWith(".jpg")) { continue; } string imgname = System.IO.Path.GetFileName(imgfiles[i]); string fullpath = curprodpath + "/" + imgname; imglist.Add(fullpath); var active = (counter == 0 ? "active" : ""); <div data-slide-number="@counter" class="item @active" data-hires="/admin/public/getimage.ashx?Image=@fullpath&Format=jpg&Compression=90&&width=825&altFmImage_path=/Files/Images/NoImageAvailable.png"> <img src="/admin/public/getimage.ashx?Image=@fullpath&Format=jpg&Quality=100&width=40000&altFmImage_path=/Files/Images/NoImageAvailable.png" alt="" title="@imgname" class="img-responsive panzoom-elements" /> </div> counter = counter + 1; // Only show image functions if there is at least one image if (counter == 1) { imgFunctions = true; } // Only show image controls if there is at least two images if (counter == 2) { imgControl = true; } } } catch (System.Exception e) { <div class="item active"> <img src="/admin/public/getimage.ashx?Image=/Files/Images/NoImageAvailable.png&Format=png&Compression=90&&width=403" alt="" class="img-responsive" /> </div> }; } </div> @if (imgControl) { <!-- Controls --> <a class="left carousel-control" href="#carousel-productimages" data-slide="prev"> <span class="icon-prev icon-large"></span> </a> <a class="right carousel-control" href="#carousel-productimages" data-slide="next"> <span class="icon-next icon-large"></span> </a> } </div> @if (imgFunctions) { <div class="text-right hidden-xs"> <a href="javascript:;" id="download" title="Ladda ner högupplöst..."><i class="fa fa-download"></i></a> <a href="javascript:;" id="y-zoom" title="Förstora..."><i class="fa fa-search"></i></a> </div> } @if (imgControl) { <div class="text-center"> <ul class="image-thumbs list-inline hidden-xs"> @{ var counterThumbs = 0; foreach (var src in imglist) { <li> <a id="carousel-selector-@counterThumbs"> <img class="img-responsive" src="/admin/public/getimage.ashx?Image=@src&Format=jpg&Compression=90&width=55&altFmImage_path=/Files/Images/NoImageAvailable.png"> </a> </li> counterThumbs = counterThumbs + 1; } } </ul> </div> } @if (imgFunctions) { <div class="modal fade y-modalCarousel" id="myModal2" role="dialog"> <div class="modal-dialog"> <button class="close" type="button" data-dismiss="modal"> <i class="fa fa-times"></i> </button> <div id="modalCarousel" class="carousel slide"> <div class="carousel-inner"> </div> @if (imgControl) { <a class="left carousel-control" href="#modalCarousel" data-slide="prev"> <span class="icon-prev icon-large"></span> </a> <a class="right carousel-control" href="#modalCarousel" data-slide="next"> <span class="icon-next icon-large"></span> </a> } <span class="cl-area" data-dismiss="modal"></span> </div> </div> </div> } </div> <!-- #END carousel area --> <div class="row blurbs-wrapp"> @{ string youtubeVId = string.Empty; // string.Empty; if (@GetString("Ecom:Product:Field.YouTypeLink.Value.Clean").Contains("?v=")) { var tempArr = @GetString("Ecom:Product:Field.YouTypeLink.Value.Clean").Split('='); youtubeVId = tempArr[1]; } } @if (!string.IsNullOrEmpty(youtubeVId)) { var videoThumb = "http://img.youtube.com/vi/" + youtubeVId + "/0.jpg"; <div class="col-md-12"> <div class="thumbnail display-box hidden-xs Y-animate"> <a href="@GetValue("Ecom:Product:Field.YouTypeLink.Value.Clean")" target="_blank"> <div class="display-img img-wrapp"> <div class="img-inner"> <img src="@videoThumb" class="img-responsive" alt="..."> </div> </div> <div class="caption text-center display-caption caption-wrapp"> <h3><span>Film på Youtube</span></h3> </div> </a> </div> </div> } </div> <!-- #END blurbs --> <div class="row blurbs-wrapp"> <div class="col-md-6"> @if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.banner1link.Value.Clean")) && !string.IsNullOrEmpty(GetString("Ecom:Product:Field.banner1title.Value.Clean"))) { <div class="thumbnail display-box hidden-xs Y-animate"> <a href="@GetString("Ecom:Product:Field.banner1link.Value.Clean")" id="banner1"> <div class="display-img img-wrapp"> <div class="img-inner"> <img src="/admin/public/getimage.ashx?Image=@GetValue("Ecom:Product:Field.banner1image.Value.Clean")&Format=jpg&Compression=90&height=157&altFmImage_path=/Files/Images/NoImageAvailable.png" class="img-responsive" alt="..."> </div> </div> <div class="caption text-center display-caption caption-wrapp"> <h3><span>@GetString("Ecom:Product:Field.banner1title.Value.Clean")</span></h3> </div> </a> </div> } </div> <div class="col-md-6"> @if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.banner2link.Value.Clean")) && !string.IsNullOrEmpty(GetString("Ecom:Product:Field.banner2title.Value.Clean"))) { <div class="thumbnail display-box hidden-xs Y-animate"> <a href="@GetString("Ecom:Product:Field.banner2link.Value.Clean")" id="banner2"> <div class="display-img img-wrapp"> <div class="img-inner"> <img src="/admin/public/getimage.ashx?Image=@GetValue("Ecom:Product:Field.banner2image.Value.Clean")&Format=jpg&Compression=90&height=157&altFmImage_path=/Files/Images/NoImageAvailable.png" class="img-responsive" alt="..."> </div> </div> <div class="caption text-center display-caption caption-wrapp"> <h3><span>@GetString("Ecom:Product:Field.banner2title.Value.Clean")</span></h3> </div> </a> </div> } </div> </div> <!-- #END blurbs --> </div> </div> <!-- #END Left Column --> <div class="col-sm-7"> <!-- Right Column --> @using Dynamicweb.eCommerce.Products; <div class="row"> <div class="col-sm-12 text-common"> <span class="small"><b>@Group.GetGroupByID(GetString("Ecom:Product.PrimaryOrFirstGroupID")).Name</b></span> <h1 class="Product-Title">@GetString("Ecom:Product.Name")</h1> <div class="lead"> @GetString("Ecom:Product.ShortDescription") </div> <div class="clearfix"> <a class="pull-left las-mer hidden-print" data-toggle="collapse" data-target="#viewdetails">L&auml;s mer <i class="fa fa-angle-right"></i></a> <div class="y-share-tools pull-right hidden-print"> <!-- AddThis Button BEGIN --> <div class="addthis_toolbox addthis_default_style"> <span class="pull-left">Dela </span> <a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http://<!--@Global:Request.Host--><!--@Global:Pageview.Url-->"><i class="fa fa-facebook"></i></a> <a href="https://twitter.com/share" data-lang="sv" data-count="none" data-dnt="true" target="_blank"><i class="fa fa-twitter"></i></a> <script>!function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https'; if (!d.getElementById(id)) { js = d.createElement(s); js.id = id; js.src = p + '://platform.twitter.com/widgets.js'; fjs.parentNode.insertBefore(js, fjs); } }(document, 'script', 'twitter-wjs');</script> <a class="y-share-mail" href="mailto:?subject=Ett länktips&amp;body= Här är en intressant länk http://<!--@Global:Request.Host--><!--@Global:Pageview.Url-->" title="Dela sidan via e-post... "><i class="fa fa-envelope"></i></a> <a href="javascript:window.print();" title="Skriv ut produktblad...">Skriv ut <i class="fa fa-print"></i></a> </div> </div> </div> <div class="intro-black-collapse print-show collapse" id="viewdetails"> </div> </div> </div> <div class="x-print"> <!-- well row --> <div id="productInfoContainer" class="row well"> <div class="col-xs-12 col-sm-7 col-md-6"> <form class="form-inline"> <div class="item-main-info"> <span class="old-price"></span> <h5 class="current-price"></h5> <span class="old-priceTotal"></span> <div style="clear: both"></div> <div class="loaderDiv"><img src="/Files/Images/loading.gif"/></div> </div> <div class="form-group inline"> <input type="number" onchange="productUpdatePriceDisplay()" tabindex="1" class="form-control inline prod-quantity" value="1" min="1" id='antal_@GetString("Ecom:Product.Number").Replace(".", "")' style="width: 60px; margin: 5px 0;"> </div> <div class="form-group inline"> <select class="form-control" id="unitId" name="UnitId" onchange="productUpdatePriceDisplay()"> @{ // get field string preselect = GetString("Ecom:Product:Field.UnitPreselect.Value.Clean"); var salesUnitsArray = GetString("Ecom:Product:Field.UnitListing.Value.Clean").Split(';').ToList(); var units = Dynamicweb.eCommerce.Products.Product.GetProductByNumber(GetString("Ecom:Product.Number")).UnitList; var otherUnits = Dynamicweb.eCommerce.Products.Product.GetProductByNumber(GetString("Ecom:Product.Number")).Units; var withVat = "0"; var withoutVat = "0"; } @foreach (LoopItem i in GetLoop("Units").OrderBy(g => g.GetString("Ecom:VariantOption.Stock")).ToList()) { var selected = ""; string perBase = null; if (i.GetValue("Ecom:VariantOption.Stock").ToString() != "1") { perBase = "(" + i.GetValue("Ecom:VariantOption.Stock") + " " + @GetString("Ecom:Product:Field.SalesUnit.Value.Clean") + ")"; } if (preselect.ToLower() == i.GetString("Ecom:VariantOption.ID").ToLower()) { selected = "selected"; withVat = i.GetString("Ecom:VariantOption.Price.PriceWithVAT").Replace(",", "").Replace(".", "").Replace(" ", ""); withoutVat = i.GetString("Ecom:VariantOption.Price.PriceWithoutVAT").Replace(",", "").Replace(".", "").Replace(" ", ""); } else { selected = ""; } if (salesUnitsArray.Contains(i.GetString("Ecom:VariantOption.ID"))) { <option value="@i.GetValue("Ecom:VariantOption.ID")" @selected rel="@i.GetValue("Ecom:VariantOption.Stock")" data-withVat="@i.GetDouble("Ecom:VariantOption.Price.PriceWithVAT")" data-withoutVat="@i.GetDouble("Ecom:VariantOption.Price.PriceWithoutVAT")" data-regularPriceWithVat="" data-regularPriceWithoutVat="" > @i.GetValue("Ecom:VariantOption.Name") @if (perBase != null) { @perBase } </option> } } </select> <span id="priceTarget"></span> </div> <div class="form-group inline"> @{ if (GetBoolean("Ecom:Product:Field.contactToBuy.Value") && Dynamicweb.Modules.UserManagement.User.GetCurrentUser() == null) { <button id="btnBuy" data-toggle="tooltip" data-original-title="Kontakta oss för köp" class="btn btn-default cart-tooltip" type="button"><i class="fa fa-shopping-cart"></i>Köp</button>} else { <button id="btnBuy" onclick="addToBasket(@GetValue("Ecom:Product:Page.ID"), '@GetValue("Ecom:Product.ID")' , '@GetValue("Ecom:Product.Number")', $('#unitId').val(), this);" class="btn btn-default" type="button"><i class="fa fa-shopping-cart"></i>Köp</button>} } </div> <div class="form-group inline"> @if (!string.IsNullOrEmpty(GetString("Ecom:Product.AddToFavorites"))) { <a href="javascript:;" onclick="addToFavorites('@GetValue("Ecom:Product.AddToFavorites")', this)" class="btn btn-default" type="button"> <i class="fa fa-star"> </i> </a> } else { <a class="btn btn-default avail-btn cart-tooltip btn-small" data-toggle="tooltip" data-placement="top" title="" data-original-title="Logga in för att spara favoriter"><i class="fa fa-star"> </i></a> } </div> </form> </div> <div style="margin-bottom: 15px;" class="visible-sm visible-xs clearfix"></div> <div class="col-sm-12 col-md-6"> <div class="item-main-info"> <div class="clearfix"> @{ double stockLevel = 0; double.TryParse(GetString("Capo:Product.NAV.Stock"), out stockLevel); if (stockLevel > 0) { <b class=""> <i class="fa fa-circle"> <span>Finns i lager</span></i> </b> } else { <b class=""> <i class="fa fa-circle not-available"> <span>Beställningsvara</span></i> </b> } } <b style="display:block;"> <i class="fa fa-file-text-o"> <span>Artikelnr: </span> <span class="productNumber">@GetValue("Ecom:Product.Number")</span> </i> </b> </div> </div> @{ int rentalprice ; int rentalPrice ; if (int.TryParse(@GetString("Ecom:Product:Field.RentalPrice.Value"), out rentalprice)) { rentalPrice = rentalprice; } else { rentalPrice = 0; } var hireOffer = GetString("Ecom:Product:Field.HireOffer.Value"); } @if(rentalPrice > 0) { <h3>Hyreserbjudande</h3> <p>@Translate("MonthlyHireIncService", "Månadshyra inklusive service") @GetValue("Ecom:Product:Field.RentalPrice.Value") kr.</p> if(!string.IsNullOrEmpty(hireOffer)) { <p>@hireOffer</p> } } @if (rentalPrice == 0 && !string.IsNullOrEmpty(hireOffer)) { <h3>Hyreserbjudande</h3> <p>@GetString("Ecom:Product:Field.HireOffer")</p> } <!-- keep formating --> @if (rentalPrice == 0 && string.IsNullOrEmpty(hireOffer)) { <h3> </h3> <p> </p> } </div> </div> <div class="row product-data"> @if (!string.IsNullOrEmpty(GetString("Ecom:Product.LongDescription"))) { <div class="data-container col-md-7"> <!-- Table --> <h3 class="data-section-header">Tekniska specifikationer</h3> <div class="detaljerad-wrapp table-responsive"> @GetValue("Ecom:Product.LongDescription") </div> @{ try { string[] docfiles = System.IO.Directory.GetFiles(System.Web.HttpContext.Current.Server.MapPath(curprodpath + "/docs")); if (docfiles.Length > 0) { <div class="dokument-div"> <h3 class="data-section-header">Dokument</h3> @for (int i = 0; i < docfiles.Length; i++) { var filename = System.IO.Path.GetFileName(docfiles[i]); string fullpath = curprodpath + "/docs/" + filename; <div> <a href="@fullpath" target="_blank"> <i class="fa fa-file-text-o"></i> @filename </a> </div> } </div> } } catch (System.Exception e) { }; } </div>} <!-- #END Table --> @if (GetLoop("ProductRelatedGroups").Count() > 0) { <div class="hidden-sm hidden-xs col-md-4 col-md-offset-1 media-list"> <!-- Prod-list --> <h3 class="data-section-header">Tillbehör och reservdelar</h3> <div class="row"> @foreach (var relatedG in GetLoop("ProductRelatedGroups")) { foreach (var related in relatedG.GetLoop("RelatedProducts")) { <div class="col-md-12 prod-list"> <a href="@related.GetString("Ecom:Product.Link.Clean")"> <div class="thumbnail"> <div class="row"> <div class="col-xs-4"> @{ var rprodnumber = related.GetValue("Ecom:Product.Number"); var rprodpath = Dynamicweb.Base.GetGs("/Globalsettings/monteriva/productimagepath") + "/" + rprodnumber; var rimg = string.Empty; if (System.IO.Directory.Exists(System.Web.HttpContext.Current.Server.MapPath(rprodpath))) { string[] imgfiles = System.IO.Directory.GetFiles(System.Web.HttpContext.Current.Server.MapPath(rprodpath), "*.jpg"); if (imgfiles.Length > 0) { var temp = imgfiles[0].Split(new[] { '\\' }); rimg = rprodpath + "/" + temp[temp.Length - 1]; } } <img class="img-responsive" src="/admin/public/getimage.ashx?Image=@rimg.ToString()&Format=jpg&Compression=90&height=50&width=50&altFmImage_path=/Files/Images/NoImageAvailable.png" alt="img"> } </div> <div class="col-xs-8"> <p><b>@related.GetString("Ecom:Product.Name")</b></p> <!-- <p> <i> @if (related.GetString("Ecom:Product.MetaDescription").Length > 156) { @related.GetString("Ecom:Product.MetaDescription").Substring(0, 156)<text>...</text> } else { @related.GetValue("Ecom:Product.MetaDescription") } </i> </p> --> </div> </div> </div> </a> </div> } } </div> <!-- <a class="link" href="#">Visa fler <i class="fa fa-angle-right"></i></a> --> </div> } <!-- #END prod-list --> </div> </div> </div> </div> </div> </section> <script type="text/javascript"> var price; $(document).ready(function () { var newPrice; var newPriceFormatted; var oldPrice; productUpdatePriceDisplay(); if (getCookie('vatsetting') === 'optionExkl') { newPrice = '@GetValue("Ecom:Product.Price.PriceWithoutVAT")'; newPriceFormatted = parseFloat(newPrice.replace(/\s+/g, '')); oldPrice = '@GetValue("Capo:Product.NAV.OrdinariePriceWithoutVAT")'.replace(',', '.'); var oldPriceVatExluded = Math.round(parseFloat(oldPrice)); if (newPriceFormatted < oldPriceVatExluded) { $('.item-main-info .old-price').html(oldPriceVatExluded + ":-"); } } else { newPrice = '@GetValue("Ecom:Product.Price.Price")'; newPriceFormatted = parseFloat(newPrice.replace(/\s+/g, '')); oldPrice = '@GetValue("Capo:Product.NAV.OrdinariePriceWithVAT")'.replace(',', '.'); var oldPriceVatIncluded = Math.round(parseFloat(oldPrice)); if (newPriceFormatted < oldPriceVatIncluded) { $('.item-main-info .old-price').html(oldPriceVatIncluded + ":-"); } } }); </script>

Menu