träffar.

Inga träffar. Prova ett annat sökord.
Exception in template (Designs\CapoStarter\eCom/Product/M_Product.cshtml): System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at Capo.CustomCode.SimilarProducts.GetSimilarProducts(String groupId, String productId)
   at CompiledRazorTemplates.Dynamic.febfccbdca.Execute()
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context)
   at RazorEngine.Templating.TemplateService.Run(ITemplate template, DynamicViewBag viewBag)
   at RazorEngine.Templating.TemplateService.Parse(String razorTemplate, Object model, DynamicViewBag viewBag, String cacheName)
   at RazorEngine.Razor.Parse[T](String razorTemplate, T model, String cacheName)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()
@inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @using System; @using System.IO; @using System.Globalization @using Dynamicweb.Admin @using Dynamicweb.Extensibility @using Dynamicweb.Content @using Dynamicweb.Ecommerce.Notifications @* If the user is loged in we want to get and display the quantity discounts data *@ @if (Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))) { var itemId = GetValue("Ecom:Product.Number"); <script type="text/javascript"> function getStackedPrices() { var baseUrl = window.location.protocol + "//" + window.location.host + "/"; $.ajax({ dataType: "json", url: baseUrl + "handlers/stackedPricesHandler.ashx?item=@itemId", headers: { 'If-Modified-Since': 'Mon, 26 Jul 1997 05:00:00 GMT', 'Cache-Control': 'no-cache', 'Pragma': 'no-cache' }, success: function(data) { //$(".bracket-price").append(data).find(".fa-spin").fadeOut().remove(); $(".fa-spin").fadeOut().remove(); $(".bracket-price").slideToggle(500, function() { $(".bracket-price").append(data); }); }, error: function() { console.log('null'); $(".fa-spin").fadeOut().remove(); $(".bracket-price").fadeOut().remove(); } }); } $(document).ready(function() { getStackedPrices(); $('.disabled #btnBuy').text('').html('<p class="outOfstockBtnText">@Translate("productButtonTempOutOfStock", "Tillfälligt slut")</p>'); }); </script> } <script type="text/javascript"> $(document).ready(function () { //Append product to breadcrumb $('.breadcrumb').find(".active-link").attr("class", $('.breadcrumb').find(".active-link").attr("class").replace("active-link", "")); $('.breadcrumb').append('<li><a style="text-decoration: none;" class="active-link" href="@GetValue("Ecom:Product.LinkGroup.Clean")">@GetString("Ecom:Product.Name").Replace("\n","")</a></li>'); }); </script> <section class="content productpage"> <div class="div-max1170-centered"> <div class="productcard"> <div class="row"> <div class="go-back-button"> <button class="btn" onclick="goBack()">@Translate("productBackButton", "Tillbaka")</button> </div> </div> <div class="row"> <div class="col-sm-5 col-sm-offset-1"> <!-- Left Column --> <div class="productimages-area"> <div class="productimages-wrapp"> @{ bool imgControl = false; bool imgFunctions = false; string disabledState = ""; } <div class="carousel slide" id="carousel-productimages"> <!-- Wrapper for slides --> <div class="carousel-inner"> @{ var counter = 0; string prodnumber = GetString("Ecom:Product.Number").Replace("/", "-"); var curprodpath = Dynamicweb.Configuration.SystemConfiguration.Instance.GetValue("/Globalsettings/sundqvist/productimagepath") + "/" + prodnumber; var imglist = new List<string>(); string[] imgfiles = new string[0]; var relatedImages1 = GetString("Ecom:Product:Field.relatedImages1.FullPath"); var relatedImages2 = GetString("Ecom:Product:Field.relatedImages2.FullPath"); var relatedImages3 = GetString("Ecom:Product:Field.relatedImages3.FullPath"); var relatedImages4 = GetString("Ecom:Product:Field.relatedImages4.FullPath"); var relatedImages5 = GetString("Ecom:Product:Field.relatedImages5.FullPath"); try { imgfiles = System.IO.Directory.GetFiles(System.Web.HttpContext.Current.Server.MapPath(curprodpath)); } catch { <div class="item active"> <img src="/Files/Images/NoImageAvailable.png" alt="" class="img-responsive" /> </div> } string[] fieldRelatedImages = { @relatedImages1, @relatedImages2, @relatedImages3, @relatedImages4, @relatedImages5 }; //Check that first found image has list-image pattern productnumber_1.jpg if (!imgfiles.Any(x => x.Contains(prodnumber + "_1.jpg"))) { <div class="item active"> <img src="/Files/Images/NoImageAvailable.png" alt="" class="img-responsive" /> </div> } else { for (int i = 0; i < imgfiles.Length; i++) { 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=85&width=1900&height=1200&Crop=5&altFmImage_path=/Files/Images/NoImageAvailable.png"> <img src="/admin/public/getimage.ashx?Image=@fullpath&Format=jpg&Compression=85&width=400&height=400&Crop=5&altFmImage_path=/Files/Images/NoImageAvailable.png" alt="" title="@imgname" class="img-responsive panzoom-elements" data-original="@fullpath" /> </div> counter = counter + 1; } foreach (var url in fieldRelatedImages) { if (!string.IsNullOrEmpty(url)) { <div data-slide-number="@counter" class="item " data-hires="/admin/public/getimage.ashx?Image=@url&Format=jpg&Compression=85&width=1900&height=1200&Crop=5&altFmImage_path=/Files/Images/NoImageAvailable.png"> <img src="/admin/public/getimage.ashx?Image=@url&Format=jpg&Compression=85&width=400&height=400&Crop=5&altFmImage_path=/Files/Images/NoImageAvailable.png" alt="" title="@url" class="img-responsive panzoom-elements" data-original="@url" /> </div> counter = counter + 1; } } // Only show image functions if there is at least one image if (counter > 0) { imgFunctions = true; } // Only show image controls if there is at least two images if (counter > 1) { imgControl = true; } } } </div> @if (imgControl) { <!-- Controls --> <a class="left carousel-control" href="#carousel-productimages" data-slide="prev"> <i class="fa fa-angle-left"></i> </a> <a class="right carousel-control" href="#carousel-productimages" data-slide="next"> <i class="fa fa-angle-right"></i> </a> } </div> @if (imgFunctions) { <div class="img-controls text-right hidden-xs"> <a href="javascript:;" id="download" title="@Translate("productImageDownloadLinkText", "Ladda ner högupplöst...")"><i class="fa fa-download"></i></a> <a href="javascript:;" id="y-zoom" title="@Translate("productImageEnlargeLinkText", "Förstora...")"><i class="fa fa-search-plus"></i></a> </div> } @if (imgControl) { var counterThumbs = 0; foreach (var src in imglist) { <div class="carousel-item col-sm-4 hidden-xs"> <a id="carousel-selector-@counterThumbs"> <img class="img-responsive" src="/admin/public/getimage.ashx?Image=@src&Format=jpg&Compression=80&width=100&height=70&crop=5&altFmImage_path=/Files/Images/NoImageAvailable.png"> </a> </div> counterThumbs = counterThumbs + 1; } <!--Start RelatedImages thumbs --> foreach (var val in fieldRelatedImages) { var url = val; if (!string.IsNullOrEmpty(url)) { <div class="carousel-item col-sm-4 hidden-xs"> <a id="carousel-selector-@counterThumbs"> <img class="img-responsive" src="/admin/public/getimage.ashx?Image=@url&Format=jpg&Compression=80&width=100&height=70&crop=5&altFmImage_path=/Files/Images/NoImageAvailable.png"> </a> </div> } counterThumbs = counterThumbs + 1; } <!--End RelatedImages thumbs --> } </div> <!-- #END carousel area --> <!-- YouTube banner--> @{ string youtubeVId = string.Empty; // string.Empty; if (GetString("Ecom:Product:Field.YouTypeLink").Contains("?v=")) { var tempArr = GetString("Ecom:Product:Field.YouTypeLink").Split('='); youtubeVId = tempArr[1]; } } @if (!string.IsNullOrEmpty(youtubeVId)) { var videoThumb = "http://img.youtube.com/vi/" + youtubeVId + "/0.jpg"; <div class="col-sm-6 col-md-4 youtube-vid hidden-xs"> <div class="thumbnail display-box"> <a class="y-video" data-video="@GetValue("Ecom:Product:Field.YouTypeLink")" data-toggle="modal" data-target="#videoModal"> <div class="display-img img-wrapp"> <div class="img-inner youtube product"> <img src="@videoThumb" class="img-responsive" alt="..."> </div> </div> </a> </div> </div> } </div> </div> <!-- #END Left Column --> <div class="product-right col-sm-4 col-sm-offset-1"> <!-- Right Column --> <div class="row"> <div class="col-sm-12 text-common"> <!--Start show brand logo--> @{ @*<style> .logo-container { min-height: 7em; margin-left: 0px; margin-bottom: 17px; background: left top no-repeat; display: block; } .dropdown-info .display-name .name-info { display: table; } </style>*@ var myListId = (int)Pageview.Area.Item["BrandList"]; var itemList = Dynamicweb.Content.Items.ItemList.GetItemListById(myListId); int count = 0; var loop = itemList.Relations.Cast<Dynamicweb.Content.Items.Item>(); string Link = string.Empty; foreach (var c in loop) { string nameId = ""; string LogoPath = String.Empty; string LogoSmallPath = String.Empty; string LogoUrl = String.Empty; string Match = GetString("Ecom:Product:Field.productTrademark").ToLower(); Link = c["Link"].ToString(); if (c["NameID"] != null) { nameId = c["NameID"].ToString().ToLower(); } if (c["Image"] != null) { LogoPath = c["Image"].ToString(); } if (c["ImageSmall"] != null) { LogoSmallPath = c["ImageSmall"].ToString(); } if (!string.IsNullOrEmpty(LogoSmallPath)) { LogoUrl = LogoSmallPath; } else if (!string.IsNullOrEmpty(LogoPath)) { LogoUrl = LogoPath; } if (nameId == Match && !string.IsNullOrEmpty(LogoUrl)) { <a href="@Link" target="_self" class="logo-container" style="background-image: url('/admin/public/getimage.ashx?Image=@LogoUrl&amp;Format=jpg&amp;Compression=90&amp;height=140&amp;crop=0&amp;altFmImage_path=/Files/Images/NoImageAvailable.png'); background-position-y: bottom; " title="@nameId"></a> count++; } if (nameId == Match && count == 0) { <a href="@Link" target="_self"> <div class="itemBrand" style="height: 30px;padding-top: 12px">@GetString("Ecom:Product:Field.productTrademark")</div> </a> break; } } } <!--End show brand logo --> <h1 class="Product-Title">@GetString("Ecom:Product.Name")</h1> <span class="art-nr">Art. Nr: @GetValue("Ecom:Product.Number")</span> @{ var descr = GetString("Ecom:Product.LongDescription"); <div class="lead"> @descr </div> } <div class="intro-black-collapse print-show collapse" id="viewdetails"> </div> <a class="pull-left las-mer hidden-print" data-toggle="collapse" data-target="#viewdetails">@Translate("productLongDescriptionReadMore", "Läs mer")<i class="fa fa-angle-right"></i></a> </div> </div> <div class="x-print"> <!-- well row --> <div class="row well"> <div class="col-md-12 no-padding"> @if (Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))) { decimal ConsumerPrice = Convert.ToDecimal(!string.IsNullOrEmpty(GetString("Ecom:Product:Field.ConsumerPrice")) ? GetString("Ecom:Product:Field.ConsumerPrice") : "0"); string ConsumerPriceFormatted = ConsumerPrice.ToString("00", new CultureInfo(GetGlobalValue("Global:Area.Culture.Name"))) + GetGlobalValue("Global:eCommerce.Currency.Symbol"); // Triggers getPrices call to ERP system decimal CustomerPrice = Convert.ToDecimal(!string.IsNullOrEmpty(GetString("Ecom:Product.Price.PriceWithoutVAT")) ? GetString("Ecom:Product.Price.PriceWithoutVAT") : "0"); string CustomerPriceFormatted = CustomerPrice.ToString("n", new CultureInfo(GetGlobalValue("Global:Area.Culture.Name"))) + GetGlobalValue("Global:eCommerce.Currency.Symbol"); //Campaign Price decimal ConsumerDiscountPrice = Convert.ToDecimal(!string.IsNullOrEmpty(GetString("Ecom:Product:Field.ConsumerDiscountPrice")) ? GetString("Ecom:Product:Field.ConsumerDiscountPrice") : "0"); string ConsumerDiscountPriceFormatted = ConsumerDiscountPrice.ToString("00", new CultureInfo(GetGlobalValue("Global:Area.Culture.Name"))) + GetGlobalValue("Global:eCommerce.Currency.Symbol"); <div class="item-main-info"> <div class="clearfix"> @{ var stock = 0; int.TryParse(GetString("Ecom:Product.Stock"), out stock); var stockstatusClass = GetString("Ecom:Product:Stock.DeliveryUnit"); if (stock <= 0) { disabledState = "disabled"; } <p class="@stockstatusClass"> Lagerstatus: <span>@GetValue("Ecom:Product:Stock.Text")</span> </p> } </div> </div> <form class="form-inline"> <div class="item-main-info"> <h5> @Translate("priceCustomerLabel", "Ditt pris"): @CustomerPriceFormatted </h5> @if (GetBoolean("Ecom:Product:Field.productCampaign") && ConsumerDiscountPrice > 0) { <div class="inline-price"><h6>@Translate("priceConsumerLabel", "Rek. Konsumentpris (inkl moms)"): </h6></div> <div class="inline-price"> <h6 class="campaign-price">@ConsumerDiscountPriceFormatted</h6> &nbsp; <h6 class="old-price">@ConsumerPriceFormatted</h6> </div> } else { <div class="inline-price"> <h6>@Translate("priceConsumerLabel", "Rek. Konsumentpris (inkl moms)"):</h6> </div> <div class="inline-price"> <h6>@ConsumerPriceFormatted</h6> </div> } </div> <div class="spinner-load"><i class="fa fa-refresh fa-spin"></i></div> <div class="bracket-price" style="display: none; height:80px"> <span style="padding-top:10px">@Translate("discontPricingTable", "Vid köp av minst: ")</span><br> </div> <div class="quantity @disabledState"> <input type="number" tabindex="1" class="form-control inline" min="0" value="1" id="antal"> <input type="hidden" class="antal-hidden" id="" /> </div> <div class="form-group inline @disabledState"> <button id="btnBuy" onclick="addToBasket(@GetValue("Ecom:Product:Page.ID"), '@GetValue("Ecom:Product.ID")', '@GetValue("Ecom:Product.Number")', this);gtag('event', 'ÅF - Köp');" class="btn btn-default" type="button"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"> <polygon class="st0" points="152.8 42.3 57.1 42.3 36.6 -40.7 18.7 -40.7 18.7 -54.7 47.6 -54.7 68 28.3 143 28.3 160.7 -20.7 64.6 -19.9 64.5 -33.9 180.7 -34.9 " /> <path class="st0" d="M77.1 80.6c-11.9 0-21.6-9.7-21.6-21.6 0-11.9 9.7-21.6 21.6-21.6 11.9 0 21.6 9.7 21.6 21.6C98.7 70.9 89 80.6 77.1 80.6zM77.1 51.5c-4.2 0-7.6 3.4-7.6 7.6 0 4.2 3.4 7.6 7.6 7.6 4.2 0 7.6-3.4 7.6-7.6C84.7 54.9 81.3 51.5 77.1 51.5z" /> <path class="st0" d="M137.4 80.6c-11.9 0-21.6-9.7-21.6-21.6 0-11.9 9.7-21.6 21.6-21.6S159 47.1 159 59C159 70.9 149.3 80.6 137.4 80.6zM137.4 51.5c-4.2 0-7.6 3.4-7.6 7.6 0 4.2 3.4 7.6 7.6 7.6s7.6-3.4 7.6-7.6C145 54.9 141.6 51.5 137.4 51.5z" /> <polygon class="st0" points="124.6 -22.6 97.6 -50.9 75.4 -24.5 64.6 -33.5 96.9 -71.9 134.7 -32.3 " /> <polygon class="st0" points="172.6 -23.6 133.4 -52.5 117 -36.8 107.3 -46.9 132.3 -70.7 180.9 -34.8 " /> <path d="M19 5.8L19 5.8l-5.4-4 -2 1.9 -1.9-2L6.1 5.9h0l0 1.5 10.7-0.1 -2 5.5H6.5L4.2 3.6H1v1.6h2l2.3 9.2H6c-0.5 0.4-0.9 1.1-0.9 1.9 0 1.3 1.1 2.4 2.4 2.4s2.4-1.1 2.4-2.4c0-0.8-0.3-1.4-0.9-1.9h3.7c-0.5 0.4-0.9 1.1-0.9 1.9 0 1.3 1.1 2.4 2.4 2.4s2.4-1.1 2.4-2.4c0-0.8-0.4-1.4-0.9-1.9h0.2L19 5.8zM8.2 5.9L9.8 4l1.8 1.8L8.2 5.9zM13.7 5.8l-1-1 1-1 2.7 2L13.7 5.8zM7.5 17c-0.5 0-0.8-0.4-0.8-0.8 0-0.5 0.4-0.8 0.8-0.8 0.5 0 0.8 0.4 0.8 0.8C8.3 16.7 7.9 17 7.5 17zM14.2 17c-0.5 0-0.8-0.4-0.8-0.8 0-0.5 0.4-0.8 0.8-0.8 0.5 0 0.8 0.4 0.8 0.8C15 16.7 14.6 17 14.2 17z" /> <polygon points="19 5.8 19 5.8 19 5.8 " /> </svg>@Translate("productBuyButtonText", "Köp") <i class="fa fa-refresh"></i> </button> </div> <div class="form-group inline"> @if (!string.IsNullOrEmpty(GetString("Ecom:Product.AddToFavorites"))) { string favorite = GetBoolean("Ecom:Product.IsProductInFavoriteList") ? "favorite checked" : "favorite "; <a href="javascript:;" onclick="addToFavorites('?CCAddToMyLists=@GetString("Ecom:Product.ID")&CCAddToListVariantID=&CCAddToListLanguageID=LANG2', this)" class="btn btn-default @favorite " type="button"></a> } </div> </form> if (stock <= 0) { <div id="priceDetails" class=""> <p class="outOfstocInfoText">@Translate("productButtonOutOfStockContactUS", "Varan är slut på lager - vänligen kontakta oss för mer information")</p></div> } } else { decimal ConsumerPrice = Convert.ToDecimal(!string.IsNullOrEmpty(GetString("Ecom:Product:Field.ConsumerPrice")) ? GetString("Ecom:Product:Field.ConsumerPrice") : "0"); string ConsumerPriceFormatted = ConsumerPrice.ToString("00", new CultureInfo(GetGlobalValue("Global:Area.Culture.Name"))) + GetGlobalValue("Global:eCommerce.Currency.Symbol"); //Campaign Price decimal ConsumerDiscountPrice = Convert.ToDecimal(!string.IsNullOrEmpty(GetString("Ecom:Product:Field.ConsumerDiscountPrice")) ? GetString("Ecom:Product:Field.ConsumerDiscountPrice") : "0"); string ConsumerDiscountPriceFormatted = ConsumerDiscountPrice.ToString("00", new CultureInfo(GetGlobalValue("Global:Area.Culture.Name"))) + GetGlobalValue("Global:eCommerce.Currency.Symbol"); if (GetBoolean("Ecom:Product:Field.productCampaign") && ConsumerDiscountPrice > 0) { <div class="item-main-info inline-price campaign-price "> <h5>@Translate("priceConsumerLabelForConsumer", "Rek. pris"): <b>@ConsumerDiscountPriceFormatted</b> <b class="old-price">@ConsumerPriceFormatted</b> </h5> </div> } else if (ConsumerPrice > 0) { <div class="item-main-info inline-price"> <h5>@Translate("priceConsumerLabelForConsumer", "Rek. pris"): <b>@ConsumerPriceFormatted</b> </h5> </div> } <div class="form-group inline"> <button class="btn btn-buy-simple" data-toggle="modal" data-target="#findStore" type="button" onclick="gtag('event', 'Konsument - Köp här');"> @Translate("productFindStoreButton", "KÖP HÄR") </button> </div> } </div> <div style="margin-bottom: 15px;" class="visible-sm visible-xs clearfix"></div> </div> </div> <div class="clearfix"> <div class="y-share-tools hidden-print"> <!-- AddThis Button BEGIN --> <div class="addthis_toolbox addthis_default_style"> <span class="pull-left">@Translate("productShareLinksLabel", "DELA:")</span> <a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http://<!--@Global:Request.Host--><!--@Global:Pageview.Url-->"></a> <a href="https://twitter.com/share" data-lang="sv" data-count="none" data-dnt="true" target="_blank"></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> </div> </div> </div> </div> </div> <div class="row"> <div class="col-md-10 col-md-offset-1 tab-list"> <ul class="nav nav-pills"> <li class="active"><a data-toggle="tab" href="#product-description">@Translate("productTabHeaderDescription", "Beskrivning")</a></li> <li><a data-toggle="tab" href="#product-tecnical">@Translate("productTabHeaderTechInfo", "Teknisk info")</a></li> @if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.guaranteeText"))) { <li><a data-toggle="tab" href="#product-warranty">@Translate("productTabHeaderWarrenty", "Garanti")</a></li> } @if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.CareInstructions1")) || !string.IsNullOrEmpty(GetString("Ecom:Product:Field.CareInstructions2")) || !string.IsNullOrEmpty(GetString("Ecom:Product:Field.CareInstructions3"))) { <li><a data-toggle="tab" href="#product-care">@Translate("productTabHeaderCare", "Skötsel")</a></li> } @{ try { string[] docfiles = System.IO.Directory.GetFiles(System.Web.HttpContext.Current.Server.MapPath(curprodpath + "/docs")); if (docfiles.Length > 0) { <li><a data-toggle="tab" href="#product-documents">@Translate("productTabHeaderDocs", "Dokument")</a></li> } else { foreach (LoopItem i in GetLoop("Details")) { if (!string.IsNullOrEmpty(@i.GetString("Ecom:Product:Detail.Image.Clean"))) { <li><a data-toggle="tab" href="#product-documents">@Translate("productTabHeaderDocs", "Dokument")</a></li> break; } } } } catch { foreach (LoopItem i in GetLoop("Details")) { if (!string.IsNullOrEmpty(@i.GetString("Ecom:Product:Detail.Image.Clean"))) { <li><a data-toggle="tab" href="#product-documents">@Translate("productTabHeaderDocs", "Dokument")</a></li> break; } } } } </ul> <div class="tab-content"> <div id="product-description" class="tab-pane fade in active"> @GetValue("Ecom:Product:Field.DescriptionLong") </div> <div id="product-tecnical" class="tab-pane fade"> @if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.TechInfo"))) { @GetValue("Ecom:Product:Field.TechInfo") } <div class="product-tecnical"> @{ if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.productTrademark.Value.Clean"))) { <div class="left"><label>Varumärke</label></div> <div class="right"><span class="tech-details-value">@GetString("Ecom:Product:Field.productTrademark.Value.Clean")</span></div> } if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.productSeries.Value.Clean"))) { <div class="left"><label>Serie</label></div> <div class="right"><span class="tech-details-value">@GetString("Ecom:Product:Field.productSeries.Value.Clean")</span></div> } if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.ProductColor.Value.Clean"))) { <div class="left"><label>Färg</label></div> <div class="right"><span class="tech-details-value">@GetString("Ecom:Product:Field.ProductColor.Value.Clean")</span></div> } if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.productMaterial.Value.Clean"))) { <div class="left"><label>Material</label></div> <div class="right"><span class="tech-details-value">@GetString("Ecom:Product:Field.productMaterial.Value.Clean")</span></div> } if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.productSize.Value.Clean"))) { <div class="left"><label>Storlek</label></div> <div class="right"><span class="tech-details-value">@GetString("Ecom:Product:Field.productSize.Value.Clean")</span></div> } if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.productsVolume.Value.Clean"))) { <div class="left"><label>Volym</label></div> <div class="right"><span class="tech-details-value">@GetString("Ecom:Product:Field.productsVolume.Value.Clean") &nbsp;m&sup3;</span></div> } if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.produktEAN.Value.Clean"))) { <div class="left"><label>EAN</label></div> <div class="right"><span class="tech-details-value">@GetString("Ecom:Product:Field.produktEAN.Value.Clean")</span></div> } } </div> </div> <div id="product-warranty" class="tab-pane fade"> @{ string pageId; int id; var path = GetString("Ecom:Product:Field.guaranteeText"); if (!string.IsNullOrEmpty(path)) { pageId = path.Substring(path.IndexOf('=') + 1); if (int.TryParse(pageId, out id)) { // Function that renders either pageItem "General_TextEditor" content OR all content from a regular page @GetPageContent(id) } } } </div> <div id="product-care" class="tab-pane fade"> @{ string[] fields = { "Ecom:Product:Field.CareInstructions1", "Ecom:Product:Field.CareInstructions2", "Ecom:Product:Field.CareInstructions3" }; foreach (var fieldName in fields) { path = GetString(fieldName); if (!string.IsNullOrEmpty(path)) { pageId = path.Substring(path.IndexOf('=') + 1); id = Int32.Parse(pageId); // Function that renders either pageItem "General_TextEditor" content OR all content from a regular page @GetPageContent(id) } } } </div> <div id="product-documents" class="tab-pane fade"> <div class="dokument-div"> <ul> @{ //Documents try { string[] docfiles = System.IO.Directory.GetFiles(System.Web.HttpContext.Current.Server.MapPath(curprodpath + "/docs")); if (docfiles.Length > 0) { for (int i = 0; i < docfiles.Length; i++) { var filename = System.IO.Path.GetFileName(docfiles[i]); string fullpath = curprodpath + "/docs/" + filename; <li> <a href="@fullpath" target="_blank"> <i class="fa fa-file-text-o"></i> @filename </a> </li> } } } catch (System.Exception e) { } foreach (LoopItem i in GetLoop("Details")) { // You can get the details text fields using "Ecom:Product:Detail.Text" if (!string.IsNullOrEmpty(i.GetString("Ecom:Product:Detail.Image.Clean"))) { string fullpath = i.GetString("Ecom:Product:Detail.Image.Clean"); var filename = fullpath.Split('/').Last(); <li> <a href="@fullpath" target="_blank"> <i class="fa fa-file-text-o"></i> @filename </a> </li> } } } </ul> </div> </div> </div> <!-- #END Table --> <!-- #END prod-list --> </div> </div> @* MODAL CODE HAS BEEN MOVED TO \Files\Templates\Designs\CapoStarter\PageProduct.cshtml *@ </div> <div class="row"> <div class="div-max1170-centered no-padding"> @if (GetLoop("ProductRelatedGroups").Count() > 0) { <div class="col-md-12 prod-list"> <!-- Prod-list --> <h2 class="data-section-header">@Translate("productHeaderSimilarProducts", "Liknande produkter:")</h2> <div class="row"> @foreach (var relatedG in GetLoop("ProductRelatedGroups")) { foreach (var related in relatedG.GetLoop("RelatedProducts")) { <a href="@related.GetString("Ecom:Product.Link.Clean")"> <div class="col-xs-12 col-sm-6 col-md-3"> <div class="thumbnail dropdown-info"> @{ var imgsrc = "/admin/public/getimage.ashx?Image=/Files/Images/productImages/" + related.GetValue("Ecom:Product.Number") + "/" + related.GetValue("Ecom:Product.Number") + "_1.jpg&width=330&height=330&compression=85&Crop=5&Format=jpg&altFmImage_path=/Files/Images/NoImageAvailable.png"; <div class="display-img"> <img alt="@related.GetValue("Ecom:Product.Name")" src="@imgsrc" data-original="@imgsrc" class="img-responsive lazy"> </div> } @if (related.GetString("Ecom:Product.MetaDescription").Length > 156) { @related.GetString("Ecom:Product.MetaDescription").Substring(0, 156)<text>...</text> } else { @related.GetValue("Ecom:Product.MetaDescription") } <div class="display-name"> <div class="name-info"> <div class="itemBrand">@GetValue("Ecom:Product:Field.productTrademark")</div> <div class="itemName">@related.GetString("Ecom:Product.Name")</div> <div class="itemNumber">Art. nr: @related.GetValue("Ecom:Product.Number")</div> <div class="itemPrice" id='id_@related.GetValue("Ecom:Product.Number")'> <b> </b> @if (@related.GetValue("Ecom:Product.Price.Clean") != @related.GetValue("Ecom:Product.ActualPrice.Clean")) { <span>(@related.GetValue("Ecom:Product.ActualPrice"))</span> } </div> </div> </div> </div> </div> </a> } } </div> </div> } </div> </div> <!--Start Related catagory --> <div class="row related-catagories-hide-if-empty"> <div class="div-max1170-centered no-padding"> <div class="col-md-12 related-categories"> <h2>@Translate("productHeaderRelatedCategories", "Relaterade kategorier:")</h2> <div class="form-group inline"> @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @{ var shopID = "SHOP1"; var langID = "LANG2"; var shop = new Dynamicweb.Ecommerce.Shops.Shop(shopID); foreach (var group in shop.get_TopLevelGroups(langID)) { @GroupTemplate(group, 0, "", "") } } @helper GroupTemplate(Dynamicweb.Ecommerce.Products.Group group, int level, string SubID, string Name) { var subID = SubID; var name = Name; foreach (LoopItem item in GetLoop("CustomGroupFields")) { if (!string.IsNullOrEmpty(item.GetString("related_Product_Catagories"))) { string[] listOfCats = item.GetString("related_Product_Catagories").Split(','); for (int i = 0; i < listOfCats.Length; i++) { var groupId = listOfCats[i]; groupId = groupId + "-at-SHOP1"; if (subID == groupId) { <a href="Default.aspx?ID=2&GroupID=@groupId" class="btn btn-categories">@name</a> } } <script> $('.related-catagories-hide-if-empty').removeClass('related-catagories-hide-if-empty');</script> } } if (group.Subgroups.Count > 0) { foreach (var subgroup in group.Subgroups) { @GroupTemplate(subgroup, level + 1, subgroup.Id, subgroup.Name) } } } </div> </div> </div> </div> <!--End Related catagory --> <!--Start Similar products --> <div class="row similar-Products-hide-if-empty"> <div class="div-max1170-centered no-padding"> <div class="similar-products"> <h2>@Translate("productHeaderSimilarProducts", "Liknande produkter:")</h2> <div class="form-group inline"> @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @using System.Activities.Statements @using Dynamicweb.Ecommerce.Products @using System.Globalization @using System.Security.Cryptography @using Capo.CustomCode @*Liknande produkter yta - speciell urvalslogik Dessa ska sökas fram enligt följande logik: Produkter i samma kategori Ta 2 som ligger närmast i pris uppåt Ta 2 som ligger närmast i pris nedåt*@ @{ // Get and set values var groupID = GetString("Ecom:Group.ID"); var productID = GetString("Ecom:Product.ID"); var similarProducts = new SimilarProducts().GetSimilarProducts(groupID, productID); if (similarProducts != null) { <div class="fixed-height-boxes"> @foreach (var i in similarProducts) { <div class="col-md-3"> @{ string productNumberClean = i.Number.Replace("/", "-"); var imgsrc = "/admin/public/getimage.ashx?Image=/Files/Images/ProductImages/" + productNumberClean + "/" + productNumberClean + "_1.jpg&width=250&height=250&compression=85&Crop=5&Format=jpg&altFmImage_path=/Files/Images/NoImageAvailable.png"; var isCampaigne = (Boolean)i.GetProductFieldValue("productCampaign"); var isnews = (Boolean)i.GetProductFieldValue("productNews"); if (isCampaigne && isnews) { <div class="labels"> <button class="btn btn-small btn-danger product-flag campaign">@Translate("product_Campaign_tag", "Campaign")</button> <button class="btn btn-small btn-default product-flag news">@Translate("product_News_tag", "News")</button> </div> } else if (isnews) { <button class="btn btn-small btn-default product-flag news alone">@Translate("product_News_tag", "News")</button> } else if (isCampaigne) { <button class="btn btn-small btn-danger product-flag campaign alone">@Translate("product_Campaign_tag", "Campaign")</button> } } <div class="thumbnail dropdown-info"> @*<a href="@i.GetValue("Ecom:Product.LinkGroup.Clean")">*@ <a href="/Default.aspx?ID=2&GroupID=@groupID&ProductID=@i.IdUrlEncoded"> <div class="display-img"> <img alt="@i.Name" src="@imgsrc" data-original="@imgsrc" class="img-responsive lazy"> </div> <div class="display-name"> <div class="name-info"> <div class="itemBrand">@i.GetProductFieldValue("productTrademark")</div> <div class="itemName">@i.Name</div> @if (!string.IsNullOrEmpty(i.GetProductFieldValue("productSeries").ToString())) { <div class="itemBrand">@Translate("productListSeriesLabel", "Serie:") @i.GetProductFieldValue("productSeries")</div> } <div class="itemNumber">@Translate("productListArticleNrLabel", "Art. nr:") @i.Number</div> <div class="itemPrice" id='id_@i.Number'> @if (Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))) { decimal ConsumerPrice = Convert.ToDecimal(!string.IsNullOrEmpty(i.GetProductFieldValue("ConsumerPrice").ToString()) ? i.GetProductFieldValue("ConsumerPrice") : "0"); string ConsumerPriceFormatted = ConsumerPrice.ToString("n", new CultureInfo(GetGlobalValue("Global:Area.Culture.Name"))) + GetGlobalValue("Global:eCommerce.Currency.Symbol"); decimal CustomerPrice = Convert.ToDecimal(!string.IsNullOrEmpty(i.Price.PriceWithoutVAT.ToString()) ? i.Price.PriceWithoutVAT.ToString() : "0"); string CustomerPriceFormatted = CustomerPrice.ToString("n", new CultureInfo(GetGlobalValue("Global:Area.Culture.Name"))) + GetGlobalValue("Global:eCommerce.Currency.Symbol"); @* Röd färg på pris enbart vid kampanjflagg=1 *@ @*if (isCampaigne) { <span class="campaign-price">@CustomerPriceFormatted</span> } else { <span>@CustomerPriceFormatted</span> }*@ <span>@CustomerPriceFormatted</span> } else { decimal ConsumerPrice = Convert.ToDecimal(!string.IsNullOrEmpty(i.GetProductFieldValue("ConsumerPrice").ToString()) ? i.GetProductFieldValue("ConsumerPrice") : "0"); string ConsumerPriceFormatted = ConsumerPrice.ToString("00", new CultureInfo(GetGlobalValue("Global:Area.Culture.Name"))) + GetGlobalValue("Global:eCommerce.Currency.Symbol"); //Campaign Price decimal ConsumerDiscountPrice = Convert.ToDecimal(!string.IsNullOrEmpty(i.GetProductFieldValue("ConsumerDiscountPrice").ToString()) ? i.GetProductFieldValue("ConsumerDiscountPrice") : "0"); string ConsumerDiscountPriceFormatted = ConsumerDiscountPrice.ToString("00", new CultureInfo(GetGlobalValue("Global:Area.Culture.Name"))) + GetGlobalValue("Global:eCommerce.Currency.Symbol"); if (isCampaigne && ConsumerDiscountPrice > 0) { <div class="item-main-info campaign-price"> <span class="old-price">@ConsumerPriceFormatted</span> <span>@ConsumerDiscountPriceFormatted</span> </div> } else { if (ConsumerPrice > 0) { <div class="item-main-info"> <span>@ConsumerPriceFormatted</span> </div> } } } </div> </div> </div> </a> </div> </div> // Show the div <script>$('.similar-Products-hide-if-empty').removeClass('similar-Products-hide-if-empty');</script> } </div> } } </div> </div> </div> </div> <!--End Similar products --> </div> </section> @if (imgFunctions) { <div class="modal fade y-modalCarousel" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog"> <button class="close" type="button" data-dismiss="modal"> <i class="fa fa-close"></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"> <i class="fa fa-angle-left"></i> </a> <a class="right carousel-control" href="#modalCarousel" data-slide="next"> <i class="fa fa-angle-right"></i> </a> } <span class="cl-area" data-dismiss="modal"></span> </div> </div> </div> } @functions { string GetPageContent(int pageId) { try { string output = null; var page = ServiceLocator.Current.GetPageService().GetPage(pageId); if (!string.IsNullOrEmpty(page.ItemType) && !string.IsNullOrEmpty(page.ItemId)) { var item = Dynamicweb.Content.Items.Item.GetItemById(page.ItemType, page.ItemId); output = "<div>" + item["General_TextEditor"] + "</div>"; } else { var contentPageView = Dynamicweb.Frontend.PageView.GetPageviewByPageID(pageId); output = contentPageView.Output(); // Remove everything but the actual page content var startTag = "<!--PageContentStart-->"; var endTag = "<!--PageContentEnd-->"; int startIndex = output.IndexOf(startTag) + startTag.Length; int endIndex = output.IndexOf(endTag, startIndex); output = output.Substring(startIndex, endIndex - startIndex); } return output; } catch { } return null; } } <!-- Modals --> @using Dynamicweb.Rendering.Translation @using System; @{ var LinkText = Translate("retail_search_webshop_button", "Webshop"); var EAN = GetString("Ecom:Product:Field.produktEAN"); } <script type="text/javascript"> function getPrisJaktList() { var baseUrl = window.location.protocol + "//" + window.location.host + "/"; var url = baseUrl + "/Handlers/PrisJaktHandler.ashx?productEAN=" + @EAN; //test //var url = baseUrl + "/Handlers/PrisJaktHandler.ashx?productEAN=" + "55555"; $.ajax({ dataType: "json", url: url, headers: { 'If-Modified-Since': 'Mon, 26 Jul 1997 05:00:00 GMT', 'Cache-Control': 'no-cache', 'Pragma': 'no-cache' }, success: function (data) { $(".links ul li").remove(); $(data).each(function (i, item) { var link = ""; var shop = ""; $.each(item.Value, function (key, value) { if (key === "Link") { link = value; } else if (key === "Shop") { shop = value; } }); $(".links ul").append(' <li>' + shop + '<a href="' + link + '" target="_blank" title="linkText" class="button"> @LinkText </a></li>'); console.log("adding" + shop); }); $(".fa-spin").fadeOut().remove(); $(".links ul").fadeIn(); }, error: function() { console.log(url); $(".fa-spin").fadeOut().remove(); $(".links ul").fadeIn(); } }); } $(document).ready(function() { $('.btn.btn-buy-simple').click(function () { getPrisJaktList(); }); }); </script> <div class="modal fade" id="findStore" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="spinner-load"><i class="fa fa-refresh fa-spin"></i></div> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <h1 class="modal-title" id="myModalLabel">@Translate("ProductlistBuy", "Buy")</h1> </div> <div class="modal-body col-sm-12"> <div class="col-lg-6 col-md-12 modal-search-form"> <form class="search-form"> <div class="row"> <button type="submit" class="button-primary"><i class="fa fa-search"></i></button> <input type="text" class="u-full-width search-field" autofocus placeholder="@Translate("reseller_post_number", "Enter postal number")" value=""> </div> <div class="row address"> <small class="formatted-address"></small> </div> </form> <ul class="search-filter"> @{ var BrandlistListId = (int) Pageview.Area.Item["BrandList"]; var BrandlistItemList = Dynamicweb.Content.Items.ItemList.GetItemListById(BrandlistListId); var Brandlsloop = BrandlistItemList.Relations.Cast<Dynamicweb.Content.Items.Item>(); foreach (var i in Brandlsloop) { string brand = ""; try { string nameId = i["NameID"].ToString(); if (!String.IsNullOrEmpty(nameId)) { brand = nameId; <li><label for="@brand"><input type="checkbox" id="@brand"><icon class="check"></icon>@brand</label></li> } } catch (Exception ex) { Console.WriteLine(ex.ToString()); } } } </ul> <div class="stores-list"></div> </div> <div class="col-lg-6 col-md-12 webshops"> <h2>@Translate("retail_search_webshop", "Online shops")</h2> <div class="links"> <ul style="display: none"> @{ var ResellersListId = (int) Pageview.Area.Item["Resellers_List"]; var ResellersItemList = Dynamicweb.Content.Items.ItemList.GetItemListById(ResellersListId); var Resellersloop = ResellersItemList.Relations.Cast<Dynamicweb.Content.Items.Item>(); string curentBrand = GetString("Ecom:Product:Field.productTrademark"); foreach (var c in Resellersloop) { string linkText = c["LinkText"].ToString(); string landinpageLink = String.Empty; try { landinpageLink = c[curentBrand].ToString(); //landinpageLink = c["Chasseur"].ToString(); if (!String.IsNullOrEmpty(landinpageLink)) { <li> @linkText <a href="@landinpageLink" target="_blank" title="@linkText" class="button">@Translate("retail_search_webshop_button", "Webshop")</a> </li> } } catch (Exception ex) { Console.WriteLine(ex.ToString()); } } } </ul> </div> </div> </div> </div> </div> </div>

Meny

Cookies på sidan

Denna webbplats använder cookies (kakor) för statistik, anpassat innehåll och annonser.

Du kan alltid ta bort sparade kakor genom de avancerade inställningarna i din webbläsare.

Acceptera Acceptera inte