Egenproduktion af genbrugsplastEgenproduktion af genbrugsplast
Bestil før kl. 14.00 - så sender vi i dagBestil før kl. 14.00 - så sender vi i dag
Lagerførende på varer til akutopgaverLagerførende på varer til akutopgaver
Gratis beregning og dimensioneringGratis beregning og dimensionering
Error executing template "Designs/Rapido/eCom/Product/NZProductView.cshtml"
System.ArgumentException: Illegal characters in path.
   at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
   at System.IO.Path.GetFileName(String path)
   at System.IO.FileInfo.Init(String fileName, Boolean checkHost)
   at S_DW_Lauridsen.CustomCode.DocumentInfo.FileInformation(String docCol)
   at CompiledRazorTemplates.Dynamic.RazorEngine_88d0cb936cb14cefa5e9bacefbbef756.Execute() in G:\Solutions\DYNAMICWEB\S_DW_Lauridsen\Lauridsen-staging\Files\Templates\Designs\Rapido\eCom\Product\NZProductView.cshtml:line 37
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   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 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @using Dynamicweb.Extensibility @using Dynamicweb.Content @using System; @using System.Globalization; @using System.Linq @using System.IO @using Dynamicweb.Core @using System.Web @using Dynamicweb.Ecommerce @using Dynamicweb.Ecommerce.Discounts @using Dynamicweb.Ecommerce.Orders.Discounts @using Dynamicweb.Ecommerce.Products @using Dynamicweb.Ecommerce.Prices @using NLog; @using S_DW_Lauridsen.CustomCode @using Dynamicweb.Security.UserManagement @using NuGet.Versioning @{ string favoritPage = String.Format("/Default.aspx?ID={0}&CC20=CreateFormList", GetPageIdByNavigationTag("CustomerFavorites").ToString()); string pageId = GetGlobalValue("Global:Page.ID").ToString(); string productId = GetString("Ecom:Product.ID"); string uniqueId = GetString("Ecom:Product.ID") + GetString("Ecom:Product.VariantID"); // Stock status int stockAmount = GetInteger("Ecom:Product.AvailableAmount"); string currentPrice = GetString("Ecom:Product.Discount.Price.PriceFormatted") == GetString("Ecom:Product.Price.PriceFormatted") ? GetString("Ecom:Product.Price.PriceFormatted") : GetString("Ecom:Product.Discount.Price.PriceFormatted"); string hideHelpText = ""; string requestQuery = GetGlobalValue("Global:Request.Query"); string variantId = HttpContext.Current.Request.QueryString.Get("variantId"); string feedId = pageId + "&ProductID=" + productId + "&VariantID=" + variantId + "&Feed=True&redirect=false"; //CFP bool bool cfp = GetBoolean("Ecom:Product:Field.CFP"); // Documents string documentValue = GetString("Ecom:Product:Field.PDF_Path"); var results = DocumentInfo.FileInformation(documentValue); string externalLink = GetValue("Ecom:Product:Field.ExternalLinks.Value").ToString(); var testList = externalLink.Split(new string[] { "</p>" }, StringSplitOptions.RemoveEmptyEntries).ToList(); int featuresCount = 0; string brand = GetString("Ecom:Product:Field.brand"); bool onlyPreviewForAnonymousUsers = Pageview.AreaSettings.GetBoolean("OnlyPreviewForAnonymous"); bool onlyPreview = onlyPreviewForAnonymousUsers ? Pageview.User == null : false; foreach (LoopItem customField in GetLoop("CustomFieldValues")) { if (!String.IsNullOrEmpty(customField.GetString("Product.CustomField.Value.Clean")) && customField.GetString("Product.CustomField.Name") != "CustomSticker") { featuresCount++; } } foreach (LoopItem customField in GetLoop("ProductCategories")) { foreach (LoopItem field in customField.GetLoop("ProductCategoryFields")) { if (!String.IsNullOrEmpty(field.GetString("Ecom:Product.CategoryField.Value"))) { featuresCount++; } } } foreach (LoopItem variantgroup in GetLoop("VariantGroups")) { foreach (LoopItem variantoption in variantgroup.GetLoop("VariantAvailableOptions")) { if (variantoption.GetBoolean("Ecom:VariantOption.Selected")) { hideHelpText = "u-hidden"; } } } int relatedProductsPageSize = 4; int relatedProductsColumnWidth = 3; if (Pageview.Device.ToString() == "Mobile") { relatedProductsPageSize = 1; relatedProductsColumnWidth = 12; } if (Pageview.Device.ToString() == "Tablet") { relatedProductsPageSize = 3; relatedProductsColumnWidth = 4; } string pageNavTag = GetPageIdByNavigationTag("ProductsPage").ToString(); string feedFullUrl = String.Format("/Default.aspx?ID={0}&PageSize={1}&ProdID={2}&feed=true", pageNavTag, relatedProductsPageSize, productId); string relatedProductsFeed = String.Format("/Default.aspx?ID={0}&PageSize={1}&ProdID={2}&feed=true&RelateredeProdukter=", pageNavTag, relatedProductsPageSize, productId); string productContainerId = "Product" + productId; string video = GetString("Ecom:Product:Field.video"); string siteURL = Dynamicweb.Context.Current.Request.Url.Scheme + "://" + Dynamicweb.Context.Current.Request.Url.Host; Dynamicweb.Ecommerce.Products.Product currentProduct = Dynamicweb.Ecommerce.Services.Products.GetProductById(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID"), GetString("Ecom:Product.LanguageID")); var imagePathValue = Dynamicweb.Ecommerce.Services.Products.GetProductFieldValue(currentProduct, "ImagePath"); string imagePath = !string.IsNullOrWhiteSpace(imagePathValue.ToString()) ? "/Files/Images/Ecom/LHI_Products/Images/" + imagePathValue + ".jpg" : ""; string productImage = !string.IsNullOrWhiteSpace(imagePath) ? imagePath : GetString("Ecom:Product.ImageLarge.Default.Clean"); string canonicalURL = GetString("Ecom:Product.Canonical"); string vismaUnitName = !string.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.Enhed")) ? GetString("Ecom:Product:Field.Enhed")?.ToLower() : Translate("UnitPriceTextStk"); //gallery int imagesCount = 1; List<string> galleryImages = new List<string>(); galleryImages.Add(productImage); if (!string.IsNullOrWhiteSpace(video)) { foreach (var image in video.Split('|')) { string videoThumb = String.Format("https://img.youtube.com/vi/{0}/0.jpg", image); galleryImages.Add(videoThumb); imagesCount++; } } foreach (LoopItem alternativeImage in GetLoop("Ecom:Product.AlternativeImages")) { if (!String.IsNullOrEmpty(alternativeImage.GetString("Ecom:Product.AlternativeImages.Image"))) { string fullImage = "/Admin/Public/GetImage.ashx?width=550&amp;height=550&amp;crop=5&FillCanvas=True&DoNotUpscale=true&amp;Compression=75&amp;image=" + alternativeImage.GetString("Ecom:Product.AlternativeImages.Image"); galleryImages.Add(fullImage); imagesCount++; } } foreach (LoopItem detail in GetLoop("Details")) { string fullImage = "/Admin/Public/GetImage.ashx?width=550&amp;height=550&amp;crop=5&FillCanvas=True&DoNotUpscale=true&amp;Compression=75&amp;image=" + detail.GetString("Ecom:Product:Detail.Image.Clean"); if (!String.IsNullOrEmpty(fullImage)) { galleryImages.Add(fullImage); imagesCount++; } } string firstImage = galleryImages.FirstOrDefault(); string galleryImagesArray = string.Join(", ", galleryImages); } @* Set product canonical URL *@ @SnippetStart("canonical") @{ string host = GetGlobalValue("Global:Request.Host"); string url = GetGlobalValue("Global:Pageview.Url"); int queryIndex = url.IndexOf("?", StringComparison.Ordinal); if (queryIndex > -1) { url = url.Substring(0, queryIndex); } } <link rel="canonical" href="https://@host@url"> @SnippetEnd("canonical") <!-- Trigger for the gallery modal --> <input type="checkbox" id="GalleryModalTrigger" class="modal-trigger" /> <!-- Gallery modal --> <div class="modal-container"> <label for="GalleryModalTrigger" id="GalleryModalOverlay" class="modal-overlay"></label> <div class="modal modal--lg modal--full modal-no-bg" id="GalleryModal"> <div class="modal__body"> <div class="gallery-slider js-gallery-slider" data-total-images="@imagesCount" data-images="@galleryImagesArray"> <div class="gallery-slider__image" data-icon-nz="play"> <img id="FullImage" src="@firstImage" class="w-100 js-video-button js-gallery-image" /> </div> <div class="gallery-slider__image-counter" id="FullImage_counter"> </div> <label class="gallery-slider__close-btn" for="GalleryModalTrigger"></label> @if (imagesCount > 1) { <button class="gallery-slider__previous-btn" id="FullImage_prev" onclick="Gallery.prevImage('FullImage')"></button> <button class="gallery-slider__next-btn" id="FullImage_next" onclick="Gallery.nextImage('FullImage')"></button> } </div> </div> </div> </div> <div class="paragraph-container__grid--bleed-x paragraph-container__grid--bleed-y product-view"> <div class="grid product js-product" id="productGrid"> @* Image block with optional thumbs *@ @if (!String.IsNullOrEmpty(productImage)) { <div class="grid__col-md-6 grid__col-sm-6"> <div class="grid grid--bleed product-slider"> @{ int thumbCounter = 0; } <div class="grid__col-2 product-slider__thumbnails dw-mod "> <div class="carousel js-carousel-container u-max-h500px dw-mod"> <div class="thumb-list carousel__container dw-mod m-0"> <div class="carousel__container__slide carousel__container__slide--vertical product-slider__inner dw-mod"> @*Main image thumb*@ <div class="carousel__container__slide product-slider__slide dw-mod"> <div class="thumb-list__item thumb-list__item--active dw-mod js-thumb js-thumb-btn js-gallery" onmouseover="Gallery.openImage(this)" data-number="@thumbCounter" data-for="Image_@productId" data-image="/Admin/Public/GetImage.ashx?width=550&amp;height=550&amp;crop=5&DoNotUpscale=true&amp;Compression=75&amp;image=@productImage"> <label for="GalleryModalTrigger"> <img src="/Admin/Public/GetImage.ashx?width=100&amp;height=100&amp;crop=5&amp;DoNotUpscale=true&amp;Compression=75&amp;image=@productImage" class="js-gallery" alt="@GetString("Ecom:Product.Name")" data-for="FullImage" data-number="@thumbCounter" onclick="Gallery.openImage(this)" data-image="/Admin/Public/GetImage.ashx?width=550&amp;height=550&amp;crop=5&DoNotUpscale=true&amp;Compression=75&amp;image=@productImage"> </label> </div> </div> @{ thumbCounter++; } @foreach (LoopItem alternativeImage in GetLoop("Ecom:Product.AlternativeImages")) { if (!String.IsNullOrEmpty(alternativeImage.GetString("Ecom:Product.AlternativeImages.Image"))) { string image = "/Admin/Public/GetImage.ashx?width=550&amp;height=550&amp;crop=5&FillCanvas=True&DoNotUpscale=true&amp;Compression=75&amp;image=" + alternativeImage.GetString("Ecom:Product.AlternativeImages.Image"); string thumb = "/Admin/Public/GetImage.ashx?width=100&amp;height=100&amp;crop=5&FillCanvas=True&DoNotUpscale=true&amp;Compression=75&amp;image=" + alternativeImage.GetString("Ecom:Product.AlternativeImages.Image"); <div class="carousel__container__slide product-slider__slide dw-mod"> <div class="thumb-list__item dw-mod js-thumb-btn js-thumb js-gallery" onmouseover="Gallery.openImage(this)" data-number="@thumbCounter" data-for="Image_@productId" data-image="@image"> <label for="GalleryModalTrigger"> <img src="@thumb" class="js-gallery" alt="@GetString("Ecom:Product.Name")" data-for="FullImage" data-number="@thumbCounter" onclick="Gallery.openImage(this)" data-image="@image" data-src="@image"> </label> </div> </div> thumbCounter++; } } @foreach (var youtubeLink in video.Split('|')) { if (!String.IsNullOrEmpty(youtubeLink)) { string image = String.Format("https://img.youtube.com/vi/{0}/0.jpg", youtubeLink.Split('?')); string thumb = String.Format("https://img.youtube.com/vi/{0}/0.jpg", youtubeLink.Split('?')); <div class="carousel__container__slide product-slider__slide dw-mod"> <a class="d-block thumb-list__item has-video dw-mod js-thumb js-thumb-btn js-video-button js-gallery" data-icon-nz="play" onmouseover="Gallery.openImage(this)" data-number="@thumbCounter" data-for="Image_@productId" data-image="@image" href="@youtubeLink" data-type="youtube" data-toggle="modal"> <label for="GalleryModalTrigger"> <img src="@thumb" class="js-gallery" alt="@GetString("Ecom:Product.Name")" data-for="FullImage" data-number="@thumbCounter" onclick="Gallery.openImage(this)" data-image="@image" data-src="@image" data-cookieconsent="ignore"> </label> </a> </div> thumbCounter++; } } @foreach (LoopItem detail in GetLoop("Details")) { if (!String.IsNullOrEmpty(detail.GetString("Ecom:Product:Detail.Image.Clean"))) { string image = "/Admin/Public/GetImage.ashx?width=550&amp;height=550&amp;crop=5&FillCanvas=True&DoNotUpscale=true&amp;Compression=75&amp;image=" + detail.GetString("Ecom:Product:Detail.Image.Clean"); string thumb = "/Admin/Public/GetImage.ashx?width=100&amp;height=100&amp;crop=5&FillCanvas=True&DoNotUpscale=true&amp;Compression=75&amp;image=" + detail.GetString("Ecom:Product:Detail.Image.Clean"); <div class="carousel__container__slide product-slider__slide dw-mod"> <div class="thumb-list__item dw-mod js-thumb-btn js-thumb js-gallery" onmouseover="Gallery.openImage(this)" data-number="@thumbCounter" data-for="Image_@productId" data-image="@image"> <label for="GalleryModalTrigger"> <img src="@thumb" class="js-gallery" alt="@GetString("Ecom:Product.Name")" data-for="FullImage" data-number="@thumbCounter" onclick="Gallery.openImage(this)" data-image="@image" data-src="@image"> </label> </div> </div> thumbCounter++; } } </div> </div> <div class="js-carousel-data" data-total-slides="@(imagesCount + 1)" data-carousel-slide-time="0" data-current-slide="0" data-direction="vertical" data-sliding-type="items" slides-in-view="6"> <div class="carousel-prev-btn carousel-prev-btn--vertical dw-mod" onclick="Carousel.GetPreviousSlide(this)"></div> <div class="carousel-next-btn carousel-next-btn--vertical dw-mod" onclick="Carousel.GetNextSlide(this)"></div> </div> </div> </div> <div class="grid__col-10 product-slider__large-image"> <div class="stickers-container dw-mod"> @{ if (Converter.ToBoolean(Pageview.Area.Item["EnableSaleTags"])) { string contentType = Pageview.Area.Item["EcommerceSaleTagContentType"].ToString(); string text = ""; var currency = Dynamicweb.Ecommerce.Services.Currencies.GetDefaultCurrency(); switch (contentType) { case "Name": foreach (LoopItem discount in GetLoop("ProductDiscounts")) { text = discount.GetString("Ecom:Product.Discount.Name"); <div class="stickers-container__tag stickers-container__tag--sale dw-mod">@text</div> } break; case "Amount": if (GetLoop("ProductDiscounts").Count > 0) { text = Dynamicweb.Ecommerce.Services.Currencies.Format(currency, GetDouble("Ecom:Product.Discount.Price.Price") - GetDouble("Ecom:Product.Price.Price")); <div class="stickers-container__tag stickers-container__tag--sale dw-mod">@text</div> } break; case "Percents": double percents = 0; foreach (LoopItem discount in GetLoop("ProductDiscounts")) { if (discount.GetDouble("Ecom:Product.Discount.ProductQuantity").Equals(1)) { percents = discount.GetDouble("Ecom:Product.Discount.PercentWithoutVAT"); } } if (percents > 0) { text = Math.Round(percents, 0) + "%"; <div class="stickers-container__tag stickers-container__tag--sale dw-mod">@text</div> } break; case "Amount and percents": double amount = 0; double percent = 0; foreach (LoopItem discount in GetLoop("ProductDiscounts")) { if (discount.GetString("Ecom:Product.Discount.Type") == "PERCENT") { percent += discount.GetDouble("Ecom:Product.Discount.PercentWithoutVAT"); } else if (discount.GetString("Ecom:Product.Discount.Type") == "AMOUNT") { amount += discount.GetDouble("Ecom:Product.Discount.AmountWithVAT"); } } if (percent > 0) { text = percent + "%"; <div class="stickers-container__tag stickers-container__tag--sale dw-mod">@text</div> } if (amount > 0) { text = Dynamicweb.Ecommerce.Services.Currencies.Format(currency, amount); <div class="stickers-container__tag stickers-container__tag--sale dw-mod">@text</div> } break; default: if (GetLoop("ProductDiscounts").Count > 0) { text = Translate("Sale!"); <div class="stickers-container__tag stickers-container__tag--sale dw-mod">@text</div> } break; } } if (Converter.ToBoolean(Pageview.Area.Item["NewStickersEnable"]) && GetDate("Ecom:Product.Created").AddDays(Converter.ToDouble(Pageview.Area.Item["NewStickersExpiration"])) > DateTime.Now) { <div class="stickers-container__tag stickers-container__tag--new dw-mod">@Translate("New!")</div> } if (!String.IsNullOrEmpty(GetString("Ecom:Product:Field.CustomSticker.Value"))) { <div class="stickers-container__tag stickers-container__tag--custom dw-mod">@GetString("Ecom:Product:Field.CustomSticker.Value")</div> } } </div> <label for="GalleryModalTrigger" class="product__image-container"> <img class="thumb-image-view product__image-container__image js-gallery-slider js-video-button dw-mod" src="/Admin/Public/GetImage.ashx?crop=5&width=550&height=550&Compression=75&image=@productImage" data-current-image="0" data-total-images="@imagesCount" data-images="@galleryImagesArray" data-src="/Admin/Public/GetImage.ashx?crop=5&width=550&height=550&Compression=75&image=@productImage" alt="@GetString("Ecom:Product.Name")" id="Image_@productId" data-for="FullImage" data-number="0" onclick="Gallery.openImageByNum(this)" /> </label> </div> </div> </div> } @* Primary product informations *@ <div class="grid__col-12 grid__col-md-6 product__info dw-mod"> <div> <h1 class="product__title u-no-margin">@GetString("Ecom:Product.Name") @GetString("Ecom:Product.SelectedVariantComboName")</h1> <small class="x-small text-gray-light font-weight-light">@(!string.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.Brand")) ? String.Format("{0}: {1}", Translate("Manufacturer"), GetString("Ecom:Product:Field.Brand")) : "") @Translate("product number"): @GetString("Ecom:Product.Number") @(!string.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.VVSNumber")) ? String.Format("{0}: {1}", Translate("VVS nr."), GetString("Ecom:Product:Field.VVSNumber")) : "") @(!string.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.DBN")) ? String.Format("{0}: {1}", Translate("DB nr."), GetString("Ecom:Product:Field.DBN")) : "") </small> <div> @* Delivery + stock information *@ @if (onlyPreview) { <div> <h5 class="mb-2">@Translate("LoginText", "Login")</h5> <label for="SignInModalTrigger" class="btn btn--primary u-no-margin sign-in-modal-trigger-button dw-mod" onclick="setTimeout(function() { document.getElementById('LoginUsername').focus() }, 10)">@Translate("Sign in")</label> </div> } @* Variants *@ @*@if (GetLoop("VariantGroups").Count > 0) { string containerId = "Variants" + productId; <div> <div id="@containerId" data-product-id="@productId"> @foreach (LoopItem variantGoup in GetLoop("VariantGroups")) { <div> <div class="u-bold">@variantGoup.GetString("Ecom:VariantGroup.Name")</div> <div> @foreach (LoopItem variantOption in variantGoup.GetLoop("VariantAvailableOptions")) { string selected = variantOption.GetBoolean("Ecom:VariantOption.Selected") ? "checked" : ""; if (!string.IsNullOrEmpty(variantOption.GetString("Ecom:VariantOption.ImgSmall.Clean"))) { <img src="/Admin/Public/GetImage.ashx?width=100&amp;height=50&amp;crop=5&amp;Compression=75&amp;image=/Images/@variantOption.GetString("Ecom:VariantOption.ImgSmall.Clean")" title="@variantOption.GetString("Ecom:VariantOption.Name")" id="@productId@variantOption.GetString("Ecom:VariantOption.ID")" data-variant-id="@variantOption.GetString("Ecom:VariantOption.ID")" data-product-id="@productId" onclick="Variants.UpdateVariants(this, false, true)" class="btn btn--tag @selected" data-check="@selected" /> } else { <button type="button" data-id="@GetString("Ecom:Product.ID")" id="@productId@variantOption.GetString("Ecom:VariantOption.ID")" data-variant-id="@variantOption.GetString("Ecom:VariantOption.ID")" data-product-id="@productId" onclick="Variants.UpdateVariants(this, false, true)" class="btn btn--tag @selected" data-check="@selected">@variantOption.GetString("Ecom:VariantOption.Name")</button> } } </div> </div> } </div> <small id="helpText_@productId" class="help-text @hideHelpText">@Translate("Please select variant!")</small> </div> }*@ @if (GetLoop("VariantGroups").Count > 0) { var variantCombinationsObject = new List<Array>(); foreach (LoopItem variantcomb in GetLoop("VariantStockCombinations")) { string[] combinations = variantcomb.GetString("Ecom:VariantStockCombination.VariantID").Split('.'); variantCombinationsObject.Add(combinations); } string combinationsJson = Newtonsoft.Json.JsonConvert.SerializeObject(variantCombinationsObject).Replace("\"", "\'"); var variantGroupsObject = new List<List<String>>(); var selectedItem = new Dictionary<string, string>(); string variantSelection = !String.IsNullOrEmpty(HttpContext.Current.Request.QueryString.Get("variantId")) ? HttpContext.Current.Request.QueryString.Get("variantId").Replace(".", ",") : ""; var selectedText = Translate("Select variant"); foreach (LoopItem variantGroup in GetLoop("VariantGroups")) { var variantsObject = new List<String>(); foreach (LoopItem variantOption in variantGroup.GetLoop("VariantAvailableOptions")) { variantsObject.Add(variantOption.GetString("Ecom:VariantOption.ID")); if (variantOption.GetBoolean("Ecom:VariantOption.Selected")) { selectedItem.Add(variantGroup.GetString("Ecom:VariantGroup.ID"), variantOption.GetString("Ecom:VariantOption.Name")); } } variantGroupsObject.Add(variantsObject); } string variantsJson = Newtonsoft.Json.JsonConvert.SerializeObject(variantGroupsObject).Replace("\"", "\'"); string productGroupId = HttpContext.Current.Request["GroupId"]; int variantCounter = 0; <div class="variants-container"> <div class="js-variants" data-total-variant-groups="@GetLoop("VariantGroups").Count" data-combinations="@combinationsJson" data-variants="@variantsJson" data-selection-complete="UpdatePage" data-page-id="@pageId" data-product-id="@productId" data-group-id="@productGroupId"> @foreach (LoopItem variantGroup in GetLoop("VariantGroups")) { string groupId = variantGroup.GetString("Ecom:VariantGroup.ID"); variantCounter++; <div class="dropdown-container u-margin-bottom--lg"> <div class="product__variant-group-name u-margin-bottom-5px dw-mod">@variantGroup.GetString("Ecom:VariantGroup.Name")</div> <div class="display-value" id="displayValue-@variantCounter" onclick="toggleOptions('selectContainer-@variantCounter')"> <span class="value-text" id="valueText-@variantCounter">@(selectedItem.ContainsKey(variantGroup.GetString("Ecom:VariantGroup.ID")) ? selectedItem[variantGroup.GetString("Ecom:VariantGroup.ID")] : selectedText)</span> <span class="arrow arrow-down" id="arrowControl"></span> </div> <ul tabindex="0" class="select-container" id="selectContainer-@variantCounter" onblur="toggleOptions('selectContainer-@variantCounter')"> @foreach (LoopItem variantOption in variantGroup.GetLoop("VariantAvailableOptions")) { string selected = variantOption.GetBoolean("Ecom:VariantOption.Selected") ? "checked" : ""; <li value="@variantOption.GetString("Ecom:VariantOption.ID")" type="button" data-variant-id="@variantOption.GetString("Ecom:VariantOption.ID")" onclick="MatchVariants.SelectThis(event), selected('@variantOption.GetString("Ecom:VariantOption.Name")','valueText-@variantCounter', 'selectContainer-@variantCounter')" data-variant-group="@groupId" class="btn btn--tag @selected js-variant-option select-option" data-check="@selected">@variantOption.GetString("Ecom:VariantOption.Name")</li> } </ul> </div> } </div> </div> } @* BOMProducts *@ @if (GetLoop("BOMProducts").Count > 0) { <h2 class="section-title">@Translate("Including products")</h2> foreach (LoopItem BOMProductItem in GetLoop("BOMProducts")) { string link = "/" + BOMProductItem.GetString("Ecom:Product.LinkGroup.Clean") + (!String.IsNullOrEmpty(BOMProductItem.GetString("Ecom:Product.VariantID")) ? "&VariantID=" + BOMProductItem.GetString("Ecom:Product.VariantID") : ""); <div class="grid__col--border grid"> <div class="grid__cell grid__cell--align-middle-left"> <a href="@link" class="u-pull--left u-margin-right"> <img src="/Admin/Public/GetImage.ashx?width=50&image=@BOMProductItem.GetString("Ecom:Product.ImageSmall.Default.Clean")&Compression=99" /> </a> <a href="@link">@BOMProductItem.GetString("Ecom:Product.Name")</a> </div> </div> } } </div> </div> @* Buy block *@ <div class="w-100 mt-5"> <div class="js-handlebars-root dw-mod" id="PriceAndActions" data-template="PricesAndActionsTemplate" data-json-feed="/Default.aspx?ID=@feedId"></div> <input type="hidden" value="@GetString("Ecom:Product.VariantID.Extented")" name="Variant" id="Variant_@GetString("Ecom:Product.ID")" /> </div> <div class="mt-4">@GetString("Ecom:Product:Field.LongDescription")</div> <div class="product-page__specs">@ProductPropertiesMainArea()</div> </div> </div> <section class="product-page__product-info"> <div class="grid__col-12 grid__col-lg-9 m-auto"> <div class="nav nav-pills nav-justified"> <a class="nav-item nav-link js-toggle-class js-toggle-retrigger is-active" data-target-retrigger="target-retrigger" data-target=".product-page__content--description">@Translate("Product information")</a> <a class="nav-item nav-link js-toggle-class js-toggle-retrigger" data-target-retrigger="target-retrigger" data-target=".product-page__content--video">@Translate("Documents/Video")</a> <a class="nav-item nav-link js-toggle-class js-toggle-retrigger" data-target-retrigger="target-retrigger" data-target=".product-page__content--accessories">@Translate("Accessories")</a> </div> </div> <div class="grid__col-12 grid__col-lg-10 m-auto grid__col--bleed-x"> <div class="grid product-page__content product-page__content--description js-toggle-retrigger is-active"> @* Features lists *@ <div class="grid__col-12 grid__col-md-6 product__features dw-mod"> <h1 class="h3 section-title">@Translate("Product information")</h1> @GetString("Ecom:Product.LongDescription") @GetString("Ecom:Product:Field.description") </div> <div class="grid__col-12 grid__col-md-6 product__features dw-mod"> <h1 class="h3 section-title">@Translate("Product specs")</h1> <div class="product-page__specs">@ProductProperties()</div> </div> </div> <div class="grid product-page__content product-page__content--video js-toggle-retrigger justify-content-center"> <div class="grid__col-12 grid__col-md-8 p-0 p-md-4"> <h1 class="h3 section-title">@Translate("Documents/Video")</h1> <div class="table-responsive small order-list"> <table class="table table-striped product-page-table"> <thead> <tr> <th class="font-weight-bold border-bottom-0" scope="col">@Translate("Name")</th> <th class="font-weight-bold border-bottom-0" scope="col">@Translate("Type")</th> <th class="font-weight-bold border-bottom-0" scope="col">@Translate("Size")</th> </tr> </thead> <tbody> @foreach (var documentPath in results) { <tr> <td scope="row"> <a href="@documentPath.FilePath" target="_blank"> <img src="/Files/Images/Lauridsen/icons/icon-pdf.svg" class="product-page-table__icon d-inline-block align-middle mr-3" alt="@documentPath.FileName" /> <span class="d-inline-block align-middle u-underline">@documentPath.FileName</span> </a> </td> <td>@documentPath.FileType.Replace(".pdf", "PDF")</td> <td>@documentPath.FileSize.ToSize(ByteExtension.SizeUnits.KB) KB</td> </tr> } @foreach (var youtubeLink in video.Split('|')) { if (!String.IsNullOrEmpty(youtubeLink)) { int thumbCounter = 0; string image = String.Format("https://img.youtube.com/vi/{0}/0.jpg", youtubeLink); string thumb = String.Format("https://img.youtube.com/vi/{0}/0.jpg", youtubeLink); <tr> <td> <div class="carousel__container__slide dw-mod"> <a class="d-block dw-mod js-thumb-btn js-video-button" onmouseover="Gallery.openImage(this)" data-number="@thumbCounter" data-for="Image_@productId" href="@youtubeLink" data-type="youtube" data-toggle="modal"> <label for="GalleryModalTrigger"> <img src="/Files/Images/Lauridsen/icons/icon-video.svg" class="product-page-table__icon d-inline-block align-middle mr-4" alt="@GetString("Ecom:Product:Field.video")" /> <span class="d-inline-block align-middle u-underline">@GetString("Ecom:Product:Field.video")</span> </label> </a> </div> </td> <td>@GetString("Ecom:Product:Field.video.Name")</td> <td>-</td> </tr> thumbCounter++; } } @foreach (var value in testList) { if (externalLink.IsNotNullOrEmpty() && !string.IsNullOrWhiteSpace(value)) { <tr> <td scope="row"> <i class="product-page-table__icon d-inline-block align-middle mr-3 fa fa-link fa-2x"></i> <span class="d-inline-block align-middle u-underline product-external-link">@value</span> </td> <td>@Translate("Link")</td> <td>-</td> </tr> } } </tbody> </table> </div> </div> </div> <div class="grid product-page__content product-page__content--accessories js-toggle-retrigger"> <h1 class="h3 section-title">@Translate("Accessories")</h1> <div class="grid accessories-list dw-mod"> <form name="multiForm" id="multiForm" class="accessories-list__form js-load-more-container" data-initial-load="5" method="post"> <input type="hidden" name="CartCmd" id="CartCmd" value="addMulti" /> @foreach (LoopItem relatedGroup in GetLoop("ProductRelatedGroups").Where(group => group.GetString("Ecom:Product:RelatedGroup.Name") == "Tilbehør" || group.GetString("Ecom:Product:RelatedGroup.Name") == "Reservedele")) { foreach (LoopItem relatedProduct in relatedGroup.GetLoop("RelatedProducts")) { Dynamicweb.Ecommerce.Products.Product currentRelatedProduct = Dynamicweb.Ecommerce.Services.Products.GetProductById(relatedProduct.GetString("Ecom:Product.ID"), relatedProduct.GetString("Ecom:Product.VariantID"), relatedProduct.GetString("Ecom:Product.LanguageID")); var relatedProductImagePathValue = Dynamicweb.Ecommerce.Services.Products.GetProductFieldValue(currentRelatedProduct, "ImagePath"); string imgUrl = "/Files/Images/missing_image.jpg"; string relatedProductImagePath = !string.IsNullOrWhiteSpace(relatedProductImagePathValue.ToString()) ? "/Files/Images/Ecom/LHI_Products/Images/" + relatedProductImagePathValue + ".jpg" : ""; string relatedProductImage = !string.IsNullOrWhiteSpace(relatedProductImagePath) ? relatedProductImagePath : relatedProduct.GetString("Ecom:Product.ImageLarge.Default.Clean"); if (!string.IsNullOrWhiteSpace(relatedProductImage)) { imgUrl = relatedProductImage; } string name = relatedProduct.GetString("Ecom:Product.Name"); string number = relatedProduct.GetString("Ecom:Product.Number"); string price = relatedProduct.GetString("Ecom:Product.Price"); string groupId = relatedProduct.GetString("Ecom:Product.PrimaryGroupID"); string id = relatedProduct.GetString("Ecom:Product.ID"); var stock = relatedProduct.GetInteger("Ecom:Product.Stock"); string stockText = relatedProduct.GetString("Ecom:Product:Stock.Text"); string shortDescription = relatedProduct.GetString("Ecom:Product.ShortDescription"); string link = "Default.aspx?" + "ID=" + GetInteger("Ecom:Product.PrimaryOrCurrentPageID") + "&GroupID=" + relatedProduct.GetString("Ecom:Product.PrimaryOrFirstGroupID") + "&ProductID=" + id; List<Dynamicweb.Security.UserManagement.Group> userGroups = new List<Dynamicweb.Security.UserManagement.Group>(); bool userisLoggedIn = Dynamicweb.Security.UserManagement.User.IsExtranetUserLoggedIn(); bool isEmpty = !userGroups.Any(); if (isEmpty && Dynamicweb.Security.UserManagement.User.IsExtranetUserLoggedIn()) { userGroups = Dynamicweb.Security.UserManagement.User.GetCurrentExtranetUser().Groups.ToList(); } <div class="accessories-list__item accessorie grid__col-12 grid__col--bleed-x js-load-more-item is-hidden"> <div class="grid"> <figure class="grid__col-sm-2 grid__col-12 accessorie__figure"> <div class="stickers-container dw-mod"> @if (Converter.ToBoolean(Pageview.Area.Item["EnableSaleTags"])) { string contentType = Pageview.Area.Item["EcommerceSaleTagContentType"].ToString(); string text = ""; var currency = Dynamicweb.Ecommerce.Services.Currencies.GetDefaultCurrency(); switch (contentType) { case "Name": foreach (LoopItem relatedDiscounts in GetLoop("ProductDiscounts")) { text = relatedDiscounts.GetString("Ecom:Product.Discount.Name"); <div class="stickers-container__tag stickers-container__tag--sale dw-mod">@text</div> } break; case "Amount": if (GetLoop("ProductDiscounts").Count > 0) { text = Dynamicweb.Ecommerce.Services.Currencies.Format(currency, GetDouble("Ecom:Product.Discount.Price.Price") - GetDouble("Ecom:Product.Price.Price")); <div class="stickers-container__tag stickers-container__tag--sale dw-mod">@text</div> } break; case "Percents": double percents = 0; if (relatedProduct.GetLoop("ProductDiscounts").Count > 0) { foreach (LoopItem discount in relatedProduct.GetLoop("ProductDiscounts")) { if (discount.GetDouble("Ecom:Product.Discount.ProductQuantity") == 1) { percents = discount.GetDouble("Ecom:Product.Discount.PercentWithoutVAT"); } } if (percents > 0) { text = Math.Round(percents, 0) + "%"; <div class="stickers-container__tag stickers-container__tag--sale dw-mod">@text</div> } } break; case "Amount and percents": double amount = 0; double percent = 0; foreach (LoopItem relatedDiscounts in GetLoop("ProductDiscounts")) { if (relatedDiscounts.GetString("Ecom:Product.Discount.Type") == "PERCENT") { percent += relatedDiscounts.GetDouble("Ecom:Product.Discount.PercentWithoutVAT"); } else if (relatedDiscounts.GetString("Ecom:Product.Discount.Type") == "AMOUNT") { amount += relatedDiscounts.GetDouble("Ecom:Product.Discount.AmountWithVAT"); } } if (percent > 0) { text = percent + "%"; <div class="stickers-container__tag stickers-container__tag--sale dw-mod">@text</div> } if (amount > 0) { text = Dynamicweb.Ecommerce.Services.Currencies.Format(currency, amount); <div class="stickers-container__tag stickers-container__tag--sale dw-mod">@text</div> } break; default: if (GetLoop("ProductDiscounts").Count > 0) { text = Translate("Sale!"); <div class="stickers-container__tag stickers-container__tag--sale dw-mod">@text</div> } break; } if (Converter.ToBoolean(Pageview.Area.Item["NewStickersEnable"]) && GetDate("Ecom:Product.Created").AddDays(Converter.ToDouble(Pageview.Area.Item["NewStickersExpiration"])) > DateTime.Now) { <div class="stickers-container__tag stickers-container__tag--new dw-mod">@Translate("New!")</div> } if (!String.IsNullOrEmpty(GetString("Ecom:Product:Field.CustomSticker.Value"))) { <div class="stickers-container__tag stickers-container__tag--custom dw-mod">@GetString("Ecom:Product:Field.CustomSticker.Value")</div> } } </div> <div class="grid__cell"> <a href="@link" onclick="Scroll.SavePosition(event)" title="@name"> <img class="grid__cell-img accessorie__image" src="/Admin/Public/GetImage.ashx?width=350&amp;height=350&amp;crop=5&amp;Compression=75&amp;DoNotUpscale=true&amp;image=@imgUrl" alt="@name" /> </a> </div> </figure> <div class="grid__col-12 grid__col-sm-4 accessorie__description"> <a class="" href="@link" onclick="Scroll.SavePosition(event)" title="@name"> <div class="accessorie__number"><b>Vare nr.</b> @number</div> <h3 class="accessorie__name">@name</h3> <div class="accessorie__text">@shortDescription</div> <div class="product-list-item__stock"> <div class="stock-icon ml-0 @(stock > 0 ? "stock-icon--in" : "stock-icon--not")"></div> <span>@stockText</span> </div> <span class="product-card__quantity-alert js-product-quantity-error-@id ">@Translate("Max stock level is reached")</span> </a> </div> @if (!onlyPreview) { List<Price> priceCollectionList = new List<Price>(); List<Price> getLowestPriceList = new List<Price>(); List<Price> orderedPriceList = new List<Price>(); List<Price> getPriceCollection = new List<Price>(); if (userisLoggedIn) { if (currentProduct.Prices.ToList().Any()) { priceCollectionList = currentProduct.Prices.ToList(); } string userPriceGroups = string.Empty; if (userGroups.Any()) { <div class=" grid__col-12 grid__col-sm-3 accessorie__details" style="text-align: center"> @foreach (Price priceItem in priceCollectionList.Where(priceItem => priceItem.ProductId.Equals(uniqueId))) { if (Int32.TryParse(priceItem.UserGroupId, out int priceUserGroupId)) { foreach (Dynamicweb.Security.UserManagement.Group userGroupItem in userGroups.Where(userGroup => userGroup.ID.Equals(priceUserGroupId))) { userPriceGroups = userGroupItem.ID.ToString(); if (userPriceGroups != null && priceCollectionList != null) { Price getLowest = priceCollectionList.Where(priceGroup => priceGroup.UserGroupId.Contains(userPriceGroups)).OrderBy(sortQuantity => sortQuantity.Quantity).ThenBy(sortOrder => sortOrder.Amount).ToList().FirstOrDefault(); getLowestPriceList.Add(getLowest); getPriceCollection = priceCollectionList.Where(priceGroup => priceGroup.UserGroupId.Contains(userPriceGroups)).ToList(); if (getPriceCollection.Exists(check => check.Quantity > 2) && getPriceCollection != null) { orderedPriceList.Add(getPriceCollection.FirstOrDefault()); } } } } } @if (userPriceGroups != null && getLowestPriceList.Any()) { string priceWithDiscount = relatedProduct.GetString("Ecom:Product.Discount.Price.PriceFormatted"); Price getLowestPrice = getLowestPriceList.OrderBy(lowerPrice => lowerPrice.Amount).ToList().FirstOrDefault(); if (getLowestPrice.Quantity < 2) { <div class="accessorie__price price">@priceWithDiscount</div> <div class=""> @Translate("UnitPriceText") @getLowestPrice.Quantity @vismaUnitName </div> } List<LoopItem> priceLoop = relatedProduct.GetLoop("Product.Prices"); if (priceLoop.Any(x => x.GetDouble("Ecom:Product.Prices.Quantity") > 1)) { <div class="js-popup"> <a class="js-popup-trigger">@Translate("DiscountText")</a> <div class="js-popup-modal popup_productrelatedview"> <div class="js-popout-close nz-icon icon-nz-close-circled"></div> <ul class="grid__col-12 pt-5 p-0 d-flex flex-row flex-wrap"> @foreach (LoopItem priceItem in priceLoop.Where(x => x.GetDouble("Ecom:Product.Prices.Quantity") > 1)) { string relatedVismaUnitName = !string.IsNullOrWhiteSpace(priceItem.GetString("Ecom:Product:Field.Enhed")) ? priceItem.GetString("Ecom:Product:Field.Enhed")?.ToLower() : Translate("UnitPriceTextStk"); <li class="grid__col-lg-6 p-0 mb-0 grid__col-12 align-items-center align-items-xl-start">@Translate("UnitPriceText") @priceItem.GetDouble("Ecom:Product.Prices.Quantity") @relatedVismaUnitName</li> <li class="grid__col-lg-6 p-0 pb-3 grid__col-12 align-items-center align-items-xl-end">@priceItem.GetString("Ecom:Product.Prices.AmountFormatted")</li> } </ul> </div> </div> } } </div> if (getLowestPriceList.Any()) { if (relatedProduct.GetLoop("VariantGroups").Count > 0) { <div class="grid__col-12 grid__col-sm-3 accessorie__controls"> <div class="accessorie__controls-inner"> <a href="@link" class="btn btn-secondary dw-mod js-scroll-btn d-inline-block px-5">@Translate("Select variant")</a> </div> </div> } else { <div class="grid__col-12 grid__col-sm-3 accessorie__controls"> <div class="accessorie__controls-inner"> <div class="accessorie__button-container d-inline-block"> <button type="button" id="CartButton_@id" class="btn btn--primary accessorie__cart" name="submit" onclick="Cart.AddToCart(event, '@id', document.getElementById('Quantity_@id').value, 'Unit_@id', 'Variant_@id');"> <i class="fa fa-shopping-cart"></i> <span class="u-hidden-xs u-hidden-xxs"> @Translate("Add to cart")</span> </button> </div> <div class="product-card__quantity--condenced product-card__quantity accessorie__quantity"> <input id="Quantity_@id" class="product-card__quantity-input pointer-events js-quantity-input" name="Quantity@accessoriesProduct.Id" data-id="@id" type="number" min="1" max="@stock" value="1"> <span class="product-card__quantity-add js-product-quantity-add" data-icon-nz="chevron-up"></span> <span class="product-card__quantity-subtract js-product-quantity-subtract" data-icon-nz="chevron-down"></span> </div> </div> </div> } } else { <div class="grid__col-12 grid__col-sm-3 accessorie__controls"> <div class="accessorie__controls-inner"> <div class="accessorie__button-container d-inline-block"> <button type="button" id="CartButton_@id" class="btn btn-primary dw-mod js-scroll-btn d-inline-block px-5" class="btn btn-primary dw-mod js-scroll-btn d-inline-block px-5" name="submit" data-target=".js-target"> <span class="u-hidden-xs u-hidden-xxs"> @Translate("CallForPrice")</span> </button> </div> </div> </div> } } else { <div class=" grid__col-12 grid__col-sm-3 accessorie__details" style="text-align: center"> <div class="accessorie__price price"></div> <div class="accessorie__before-price before-price "></div> <div class=""> </div> <div class="js-popup"> <div class="js-popup-modal popup_productrelatedview"> <div class="js-popout-close nz-icon icon-nz-close-circled"></div> </div> </div> </div> if (getLowestPriceList.Any()) { <div class="grid__col-12 grid__col-sm-3 accessorie__controls"> <div class="accessorie__controls-inner"> <div class="accessorie__button-container d-inline-block"> <button type="button" id="CartButton_@id" class="btn btn--primary accessorie__cart" name="submit" onclick="Cart.AddToCart(event, '@id', document.getElementById('Quantity_@id').value, 'Unit_@id', 'Variant_@id');"> <i class="fa fa-shopping-cart"></i> <span class="u-hidden-xs u-hidden-xxs"> @Translate("Add to cart")</span> </button> </div> <div class="product-card__quantity--condenced product-card__quantity accessorie__quantity"> <input id="Quantity_@id" class="product-card__quantity-input pointer-events js-quantity-input" name="Quantity@accessoriesProduct.Id" data-id="@id" type="number" min="1" max="@stock" value="1"> <span class="product-card__quantity-add js-product-quantity-add" data-icon-nz="chevron-up"></span> <span class="product-card__quantity-subtract js-product-quantity-subtract" data-icon-nz="chevron-down"></span> </div> </div> </div> } else { <div class="grid__col-12 grid__col-sm-3 accessorie__controls"> <div class="accessorie__controls-inner"> <div class="accessorie__button-container d-inline-block"> <button type="button" id="CartButton_@id" class="btn btn-primary dw-mod js-scroll-btn d-inline-block px-5" class="btn btn-primary dw-mod js-scroll-btn d-inline-block px-5" name="submit" data-target=".js-target"> <span class="u-hidden-xs u-hidden-xxs"> @Translate("CallForPrice")</span> </button> </div> </div> </div> } } } } else { <div class="grid__col-12 grid__col-sm-6 align-items-center align-items-lg-end"> <div class="grid__cell"> <div class="grid__col-12 pb-0"> <h5>@Translate("LoginText")</h5> </div> <div class="grid__col-12 pb-0"> <label for="SignInModalTrigger" class="btn btn--primary u-no-margin sign-in-modal-trigger-button dw-mod" onclick="setTimeout(function() { document.getElementById('LoginUsername').focus() }, 10)">@Translate("Sign in")</label> </div> </div> </div> } </div> </div> } } <div class="grid__col--bleed-y mb-6"> <a class="btn btn-teritary btn--load-more js-load-more-trigger dw-mod">@Translate("Load more")</a> </div> </form> </div> </div> </div> </section> @if (GetLoop("ProductRelatedGroups").Any()) { <section class="related-products"> <div class="grid related-products__inner-container"> <div class="grid__col-xs-12 related-products__headline-container"> <h2 class="related-products__headline h2 section-title section-title--condensed">@Translate("Related products")</h2> </div> <div class="grid__col-12 grid__col-md-10 grid__col--bleed m-auto"> <div class="grid"> @foreach (LoopItem relatedGroup in GetLoop("ProductRelatedGroups").Where(group => group.GetString("Ecom:Product:RelatedGroup.Name") == "Relaterede produkter")) { foreach (LoopItem related in relatedGroup.GetLoop("RelatedProducts")) { Dynamicweb.Ecommerce.Products.Product currentRelatedProduct = Dynamicweb.Ecommerce.Services.Products.GetProductById(related.GetString("Ecom:Product.ID"), related.GetString("Ecom:Product.VariantID"), related.GetString("Ecom:Product.LanguageID")); var relatedProductImagePathValue = Dynamicweb.Ecommerce.Services.Products.GetProductFieldValue(currentRelatedProduct, "ImagePath"); string imgUrl = "/Files/Images/missing_image.jpg"; string relatedProductImagePath = !string.IsNullOrWhiteSpace(relatedProductImagePathValue.ToString()) ? "/Files/Images/Ecom/LHI_Products/Images/" + relatedProductImagePathValue + ".jpg" : ""; string relatedProductImage = !string.IsNullOrWhiteSpace(relatedProductImagePath) ? relatedProductImagePath : related.GetString("Ecom:Product.ImageLarge.Default.Clean"); if (!string.IsNullOrWhiteSpace(relatedProductImage)) { imgUrl = relatedProductImage; } string name = related.GetString("Ecom:Product.Name"); string number = related.GetString("Ecom:Product.Number"); string price = related.GetString("Ecom:Product.Price"); string groupId = related.GetString("Ecom:Product.PrimaryGroupID"); string id = related.GetString("Ecom:Product.ID"); var stock = related.GetInteger("Ecom:Product.Stock"); string stockText = related.GetString("Ecom:Product:Stock.Text"); <div class="grid__col-12 grid__col-sm-6 grid__col-lg-3"> <div class="related-products__product related-product"> <a href="@related.GetString("Ecom:Product.Link.Clean")"> <div class="stickers-container dw-mod"> @if (Converter.ToBoolean(Pageview.Area.Item["EnableSaleTags"])) { string contentType = Pageview.Area.Item["EcommerceSaleTagContentType"].ToString(); string text = ""; var currency = Dynamicweb.Ecommerce.Services.Currencies.GetDefaultCurrency(); switch (contentType) { case "Name": foreach (LoopItem relatedDiscounts in GetLoop("ProductDiscounts")) { text = relatedDiscounts.GetString("Ecom:Product.Discount.Name"); <div class="stickers-container__tag stickers-container__tag--sale dw-mod">@text</div> } break; case "Amount": if (GetLoop("ProductDiscounts").Count > 0) { text = Dynamicweb.Ecommerce.Services.Currencies.Format(currency, GetDouble("Ecom:Product.Discount.Price.Price") - GetDouble("Ecom:Product.Price.Price")); <div class="stickers-container__tag stickers-container__tag--sale dw-mod">@text</div> } break; case "Percents": double percents = 0; if (related.GetLoop("ProductDiscounts").Count > 0) { foreach (LoopItem discount in related.GetLoop("ProductDiscounts")) { if (discount.GetDouble("Ecom:Product.Discount.ProductQuantity") == 1) { percents = discount.GetDouble("Ecom:Product.Discount.PercentWithoutVAT"); } } if (percents > 0) { text = Math.Round(percents, 0) + "%"; <div class="stickers-container__tag stickers-container__tag--sale dw-mod">@text</div> } } break; case "Amount and percents": double amount = 0; double percent = 0; foreach (LoopItem relatedDiscounts in GetLoop("ProductDiscounts")) { if (relatedDiscounts.GetString("Ecom:Product.Discount.Type") == "PERCENT") { percent += relatedDiscounts.GetDouble("Ecom:Product.Discount.PercentWithoutVAT"); } else if (relatedDiscounts.GetString("Ecom:Product.Discount.Type") == "AMOUNT") { amount += relatedDiscounts.GetDouble("Ecom:Product.Discount.AmountWithVAT"); } } if (percent > 0) { text = percent + "%"; <div class="stickers-container__tag stickers-container__tag--sale dw-mod">@text</div> } if (amount > 0) { text = Dynamicweb.Ecommerce.Services.Currencies.Format(currency, amount); <div class="stickers-container__tag stickers-container__tag--sale dw-mod">@text</div> } break; default: if (GetLoop("ProductDiscounts").Count > 0) { text = Translate("Sale!"); <div class="stickers-container__tag stickers-container__tag--sale dw-mod">@text</div> } break; } if (Converter.ToBoolean(Pageview.Area.Item["NewStickersEnable"]) && GetDate("Ecom:Product.Created").AddDays(Converter.ToDouble(Pageview.Area.Item["NewStickersExpiration"])) > DateTime.Now) { <div class="stickers-container__tag stickers-container__tag--new dw-mod">@Translate("New!")</div> } if (!String.IsNullOrEmpty(GetString("Ecom:Product:Field.CustomSticker.Value"))) { <div class="stickers-container__tag stickers-container__tag--custom dw-mod">@GetString("Ecom:Product:Field.CustomSticker.Value")</div> } } </div> <img class="related-product__image b-lazy" src="/Files/Images/placeholder.gif" data-src="/Admin/Public/GetImage.ashx?width=350&amp;height=350&amp;crop=5&amp;Compression=75&amp;DoNotUpscale=true&amp;image=@imgUrl" alt="@name" /> <h4 class="related-product__name">@name</h4> <div class="related-product__number">@Translate("product number") @number</div> <div class="product-list-item__stock"> <div class="stock-icon ml-0 @(stock > 0 ? "stock-icon--in" : "stock-icon--not")"></div> <span>@stockText</span> </div> <span class="product-card__quantity-alert js-product-quantity-error-@id ">@Translate("Max stock level is reached")</span> </a> @if (!onlyPreview) { string priceWithDiscount = related.GetString("Ecom:Product.Discount.Price.Price"); string currencySymbol = related.GetString("Ecom:Product.Currency.Symbol"); string priceWithOutDiscount = related.GetString("Ecom:Product.Price.Price"); bool productHasDiscount = GetBoolean("Ecom:Product.HaveDiscount"); <div class="related-product__button-container d-inline-block"> @if (priceWithDiscount != "0,00" || priceWithOutDiscount != "0,00") { if (GetString("Ecom:Product.Discount.TotalAmount") != "DKK 0,00") { <div class="related-product__price withdiscount">@currencySymbol @priceWithDiscount</div> } else { <div class="related-product__price withoutdiscount">@currencySymbol @priceWithOutDiscount</div> } List<LoopItem> priceLoop = related.GetLoop("Product.Prices"); if (priceLoop.Any(x => x.GetDouble("Ecom:Product.Prices.Quantity") > 1)) { <div class="js-popup"> <a class="js-popup-trigger">@Translate("DiscountText")</a> <div class="js-popup-modal popup_productrelatedview"> <div class="js-popout-close nz-icon icon-nz-close-circled"></div> <ul class="grid__col-12 pt-5 p-0 d-flex flex-row flex-wrap"> @foreach (LoopItem priceItem in priceLoop.Where(x => x.GetDouble("Ecom:Product.Prices.Quantity") > 1)) { <li class="grid__col-lg-6 p-0 mb-0 grid__col-12 align-items-center align-items-xl-start">@Translate("UnitPriceText") @priceItem.GetDouble("Ecom:Product.Prices.Quantity") @Translate("UnitPriceTextStk")</li> <li class="grid__col-lg-6 p-0 pb-3 grid__col-12 align-items-center align-items-xl-end">@priceItem.GetString("Ecom:Product.Prices.AmountFormatted")</li> } </ul> </div> </div> } if (related.GetLoop("VariantGroups").Count > 0) { <div class="related-product__controls"> <a href="@related.GetString("Ecom:Product.Link.Clean")" class="btn btn-secondary dw-mod js-scroll-btn d-inline-block px-5">@Translate("Select variant")</a> </div> } else { <div class="related-product__controls"> <div class="product-card__quantity--condenced product-card__quantity related-product__quantity"> <input id="Quantity_@id" class="product-card__quantity-input pointer-events js-quantity-input" name="Quantity@id" data-id="@id" type="number" min="1" max="@stock" value="1"> <span class="product-card__quantity-add js-product-quantity-add" data-icon-nz="chevron-up"></span> <span class="product-card__quantity-subtract js-product-quantity-subtract" data-icon-nz="chevron-down"></span> </div> <button type="button" id="CartButton_@id" class="btn btn--primary related-product__cart" name="submit" onclick="Cart.AddToCart(event, '@id', document.getElementById('Quantity_@id').value, 'Unit_@id', 'Variant_@id');"> <i class="fa fa-shopping-cart"></i> <span class="u-hidden-xs u-hidden-xxs"> @Translate("Add to cart")</span> </button> </div> } } else { <button type="button" id="CartButton_@id" class="btn btn-primary dw-mod js-scroll-btn d-inline-block px-5" name="submit" data-target=".js-target"> <span class="u-hidden-xs u-hidden-xxs"> @Translate("CallForPrice")</span> </button> } </div> } else { <div class="related-product__login-label">@Translate("LoginText")</div> <label for="SignInModalTrigger" class="btn btn--primary u-no-margin sign-in-modal-trigger-button dw-mod related-product__login" onclick="setTimeout(function () { document.getElementById('LoginUsername').focus() }, 10)">@Translate("Sign in")</label> } </div> </div> } } </div> </div> </div> </section> } </div> @* @if(GetLoop("eCom:Related.CustomersWhoSawThisAlsoSaw").Any()) { foreach (LoopItem item in GetLoop("eCom:Related.CustomersWhoSawThisAlsoSaw")) { relatedProductsFeed += item.GetString("Ecom:Product.ID"); relatedProductsFeed += ""; } <div class="grid"> <div class="grid__col-12"> <div class="bg-gray bg-gray-full-width"> <h2 class="h1 section-title section-title--condensed">@Translate("ecom-related-products-3", "Related products")</h2> <div class="js-handlebars-root" id="ProductList_@productId" data-template="ProductContainer" data-pre-render-template="ProductPreRenderContainer" data-json-feed="@relatedProductsFeed" data-preloader="overlay"></div> </div> </div> </div> } *@ @helper ProductPropertiesMainArea() { if (GetLoop("CustomFieldValues").Count > 0) { var visibleCount = 0; <div class="specs-list specs-list--5"> <dl class="table table--clean table--compact product-page__specs-list"> @foreach (LoopItem customField in GetLoop("CustomFieldValues").Where(customField => customField.GetString("Product.CustomField.System") != "description").Where(customField => customField.GetString("Product.CustomField.System") != "LongDescription").Where(customField => customField.GetString("Product.CustomField.System") != "ShortDescription")) { string fieldValue = customField.GetString("Product.CustomField.Value.Clean"); if (customField.GetLoop("Product.CustomField.Options").Count > 0) { fieldValue = ""; int count = 0; foreach (LoopItem customFieldOptions in customField.GetLoop("Product.CustomField.Options").Where(customFieldOptions => !string.IsNullOrWhiteSpace(customFieldOptions.GetString("Product.CustomField.Option.Name")))) { if (customFieldOptions.GetBoolean("Product.CustomField.Option.IsSelected")) { if (count != 0) { fieldValue += ", "; } fieldValue += customFieldOptions.GetString("Product.CustomField.Option.Name"); count++; } } } if (fieldValue == "False") { fieldValue = Translate("No"); } if (fieldValue == "True") { fieldValue = Translate("Yes"); } if (!String.IsNullOrEmpty(customField.GetString("Product.CustomField.Name")) && !String.IsNullOrWhiteSpace(fieldValue) && customField.GetString("Product.CustomField.Name") != "Custom sticker" && customField.GetString("Product.CustomField.Name").Contains("Produkt tekst") == true) { if (!String.IsNullOrEmpty(customField.GetString("Document.FullPath"))) { visibleCount++; <dd class="product-page__specs-value"><a href="@customField.GetString("Document.FullPath")" download title="@Translate("Download")" class="product__document"><span property="identifier">@getIconForFile(fieldValue) @Path.GetFileName(fieldValue)</span></a></dd> } else { visibleCount++; <dd class="product-page__specs-value"><span property="identifier">@fieldValue</span></dd> } } } </dl> @if (visibleCount > 5) { <div class="js-load-more-specs specs-list__trigger"> <span class="specs-list__load-more">@Translate("Show more")</span> <span class="specs-list__load-less">@Translate("Show less")</span> </div> } </div> } } @helper ProductProperties() { if (GetLoop("CustomFieldValues").Count > 0) { var visibleCount = 0; <div class="specs-list specs-list--10"> <dl class="table table--clean table--compact product-page__specs-list"> @foreach (LoopItem customField in GetLoop("CustomFieldValues").Where(customField => customField.GetString("Product.CustomField.System") != "description").Where(customField => customField.GetString("Product.CustomField.System") != "LongDescription").Where(customField => customField.GetString("Product.CustomField.System") != "ShortDescription")) { string fieldValue = customField.GetString("Product.CustomField.Value.Clean"); if (customField.GetLoop("Product.CustomField.Options").Count > 0) { fieldValue = ""; int count = 0; foreach (LoopItem customFieldOptions in customField.GetLoop("Product.CustomField.Options").Where(customFieldOptions => !string.IsNullOrWhiteSpace(customFieldOptions.GetString("Product.CustomField.Option.Name")))) { if (customFieldOptions.GetBoolean("Product.CustomField.Option.IsSelected")) { if (count != 0) { fieldValue += ", "; } fieldValue += customFieldOptions.GetString("Product.CustomField.Option.Name"); count++; } } } if (fieldValue == "False") { fieldValue = Translate("No"); } if (fieldValue == "True") { fieldValue = Translate("Yes"); } if (!String.IsNullOrEmpty(customField.GetString("Product.CustomField.Name")) && !String.IsNullOrWhiteSpace(fieldValue) && customField.GetString("Product.CustomField.Name") != "Custom sticker" && !customField.GetString("Product.CustomField.Name").Contains("Produktions ansvarlig") && !customField.GetString("Product.CustomField.Name").Contains("Video") && !customField.GetString("Product.CustomField.Name").Contains("PDF") && !customField.GetString("Product.CustomField.Name").Contains("Lokation") && !customField.GetString("Product.CustomField.Name").Contains("Status") && !customField.GetString("Product.CustomField.Name").Contains("Produktgr. (CO)") && !customField.GetString("Product.CustomField.Name").Contains("Produktprisgr. 1 (rabatgruppe)") && !customField.GetString("Product.CustomField.Name").Contains("Prisliste") && !customField.GetString("Product.CustomField.Name").Contains("Godkendelse") && !customField.GetString("Product.CustomField.Name").Contains("Salgsstatistik") && !customField.GetString("Product.CustomField.Name").Contains("ABC") && !customField.GetString("Product.CustomField.Name").Contains("Billedefilnr (LFR)") && !customField.GetString("Product.CustomField.Name").Contains("Rabat gruppe 2") && !customField.GetString("Product.CustomField.Name").Contains("Visma changed by user") && !customField.GetString("Product.CustomField.Name").Contains("Visma changed date") && customField.GetString("Product.CustomField.Value") != "0" && customField.GetString("Product.CustomField.Value") != "" && customField.GetString("Product.CustomField.Name").Contains("Produkt tekst") != true) { <dt class="product-page__specs-display" width="160">@Translate(customField.GetString("Product.CustomField.Name")): </dt> if (!String.IsNullOrEmpty(customField.GetString("Document.FullPath"))) { visibleCount++; <dd class="text-right product-page__specs-value"><a href="@customField.GetString("Document.FullPath")" download title="@Translate("Download")" class="product__document"><span property="identifier">@getIconForFile(fieldValue) @Path.GetFileName(fieldValue)</span></a></dd> } else { visibleCount++; <dd class="text-right product-page__specs-value"><span property="identifier">@fieldValue</span></dd> } } } </dl> @if (visibleCount > 10) { <div class="js-load-more-specs specs-list__trigger"> <span class="specs-list__load-more">@Translate("Show more")</span> <span class="specs-list__load-less">@Translate("Show less")</span> </div> } </div> } if (GetLoop("ProductCategories").Count > 0) { <dl class="product-page__specs-list"> @foreach (LoopItem categoryGroup in GetLoop("ProductCategories")) { int fieldsCount = 0; foreach (LoopItem categoryField in categoryGroup.GetLoop("ProductCategoryFields")) { if (!String.IsNullOrEmpty(categoryField.GetString("Ecom:Product.CategoryField.Value"))) { fieldsCount++; } } if (fieldsCount > 0) { <dd class="product-page__specs-display">@categoryGroup.GetString("Ecom:Product.Category.Name")</dd> foreach (LoopItem categoryField in categoryGroup.GetLoop("ProductCategoryFields")) { string fieldValue = categoryField.GetString("Ecom:Product.CategoryField.Value"); if (fieldValue == "False") { fieldValue = Translate("No"); } if (fieldValue == "True") { fieldValue = Translate("Yes"); } if (!String.IsNullOrEmpty(categoryField.GetString("Ecom:Product.CategoryField.Label")) && !String.IsNullOrEmpty(fieldValue)) { <dt class="product-page__specs-display">@categoryField.GetString("Ecom:Product.CategoryField.Label"):</dt> <dd class="text-right product-page__specs-value"><span property="identifier">@fieldValue</span></dd> } } } } </dl> } } <script id="PricesAndActionsTemplate" type="text/x-template"> {{#.}} @if (!onlyPreview) { if (cfp == false) { <text> {{#ifCond hasVariants "!==" "disabled"}} @if (GetInteger("Ecom:Product.Discount.TotalAmount") > 0) { <small class="text-gray font-weight-light">@Translate("NettoPrice")</small> <div class="text-gray font-weight-light product__price--discount {{onSale}}">{{#Discount}}{{#if @@first}}{{this.discountCurrency}} {{this.discount}}{{/if}}{{/Discount}}</div> <br /> <small class="text-gray font-weight-light">@Translate("ProductDiscount")</small> <div class="text-gray font-weight-light product__price--discount {{onSale}}">{{#Discount}}{{#if @@first}}{{this.discountCurrency}} {{this.subtractPriceWithoutDecimals}}{{/if}}{{/Discount}}</div> <br /> <small class="text-gray font-weight-light">@Translate("PriceWithDiscount")</small> } else { <small class="text-gray font-weight-light">@Translate("PriceWithoutDiscount")</small> } @if (GetLoop("ProductDiscounts").Any()) { <div class="h1 my-3 text-gray font-weight-light">{{price}}</div> } else { <div class="h1 my-3 text-gray font-weight-light">{{price}}</div> } {{/ifCond}} </text> } if (!String.IsNullOrEmpty(GetString("Ecom:Product:Stock.Text")) || !String.IsNullOrEmpty(GetString("Ecom:Product:Stock.DeliveryText"))) { if (GetLoop("Product.Prices").Count >= 1) { var priceLoop = GetLoop("Product.Prices"); var excludedIds = "1"; var priceQuantity = priceLoop.Where(i => !excludedIds.Contains(i.GetString("Ecom:Product.Prices.Quantity"))); if (GetLoop("Product.Prices").Count > 1 && priceQuantity.Any()) { <div class="js-popup"> <a class="js-popup-trigger">@Translate("DiscountText")</a> <div class="js-popup-modal popup_productview"> <div class="js-popout-close nz-icon icon-nz-close-circled"></div> <ul class="grid__col-12 pt-5 p-0 d-flex flex-row flex-wrap"> @* FOREACH DISCOUNT LOOP FROM JSON FEED *@ {{#each Discount}} {{#unless @@first}} <li class="grid__col-lg-6 p-0 mb-0 grid__col-12 align-items-center align-items-xl-start">@Translate("UnitPriceText") {{this.discountQuantity}} {{this.vismaUnitName}}</li> <li class="grid__col-lg-6 p-0 pb-3 grid__col-12 align-items-center align-items-xl-end">{{this.discountCurrency}} {{this.discount}}</li> {{/unless}} {{/each}} </ul> </div> </div> } } <br> if (!String.IsNullOrEmpty(GetString("Ecom:Product:Stock.Text")) || !String.IsNullOrEmpty(GetString("Ecom:Product:Stock.DeliveryText"))) { string stockIcon = GetInteger("Ecom:Product.Stock") > 0 ? "product__stock-icon--in" : "product__stock-icon--not"; if (cfp == false) { <table class="table table--clean delivery-and-stock-info dw-mod"> <tr> <td class="u-no-padding"> <div class="stock-icon ml-0 @stockIcon"></div> <span class="font-weight-bold">@GetString("Ecom:Product:Stock.Text")</span> </td> </tr> <tr> @* @if (!String.IsNullOrEmpty(GetString("Ecom:Product:Stock.DeliveryText"))) { <td class="u-no-padding">@Translate("Shipping") @GetString("Ecom:Product:Stock.DeliveryText") @GetString("Ecom:Product:Stock.DeliveryUnit")</td> } *@ </tr> </table> } } <div class="buttons-collection product__price-actions__actions dw-mod d-inline-block d-lg-flex mt-5 w-100"> @if (GetBoolean("Ecom:Product:Field.CFP")) { <div class="cfp-btn-container pt-4 pt-lg-0"> <button type="button" id="CartButton_{{id}}" class="btn btn-primary dw-mod js-scroll-btn d-inline-block px-5" name="submit" data-target=".js-target">@Translate("CallForPrice")</button> </div> } else { var disabledClass = String.IsNullOrWhiteSpace(variantId) && GetLoop("VariantGroups").Count > 0 ? "disabled" : ""; @* Product quantity *@ <div class="product-card__quantity product-card__quantity--condenced"> <input id="Quantity_{{id}}" class="product-card__quantity-input pointer-events js-quantity-input" data-id="{{id}}" name="Quantity" type="number" min="1" max="@stockAmount" value="1"> <span class="product-card__quantity-add js-product-quantity-add" data-icon-nz="chevron-up"></span> <span class="product-card__quantity-subtract js-product-quantity-subtract" data-icon-nz="chevron-down"></span> </div> <div class="product-btn-buy-container pt-4 pt-lg-0 pl-lg-3"> {{#ifCond hasVariants "==" "disabled"}} <a href="{{link}}" class="btn btn-secondary dw-mod js-scroll-btn d-inline-block px-5 @disabledClass">@Translate("Select variant")</a> {{else}} <button type="button" id="CartButton_{{id}}" class="btn btn-primary dw-mod d-inline-block px-5 @disabledClass" name="submit" onclick="Cart.AddToCart(event, '{{productId}}', document.getElementById('Quantity_{{id}}').value, 'Unit_{{id}}', 'Variant_{{productId}}');">@Translate("Add to cart")</button> {{/ifCond}} </div> } @if (Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))) { string favoriteId = "Favorite" + GetString("Ecom:Product.ID"); <div id="@favoriteId" class="favorites fav-product-container favorites--md d-inline-block dw-mod p-0 pl-lg-3"> <label for="FavoriteTrigger" class="btn mb-0 btn-secondary"><span class="pr-2 product__add-to-favorites"></span><small class="x-small">@Translate("Add to list")</small></label> <input type="checkbox" id="FavoriteTrigger" class="dropdown-trigger"> <div class="dropdown"> <div class="dropdown__content dropdown__content--show-left dropdown__content--padding u-w220px dw-mod"> @if (GetLoop("CustomerCenter.ListTypes").Any()) { <ul class="list list--clean dw-mod"> @foreach (LoopItem listType in GetLoop("CustomerCenter.ListTypes")) { foreach (LoopItem list in listType.GetLoop("CustomerCenter.ProductLists")) { <li> @{string favLinkType = list.GetString("Ecom:Product.List.IsProductInThisList") == "True" ? list.GetString("Ecom:Product.RemoveFromThisList") : list.GetString("Ecom:Product.AddToThisListAction");} @{string isInListIcon = list.GetString("Ecom:Product.List.IsProductInThisList") == "True" ? "fa fa-star" : "fa fa-star-o";} <a href="@favLinkType" class="list__link dw-mod"><i class="@isInListIcon"></i> @list.GetValue("Ecom:CustomerCenter.List.Name")</a> </li> } } </ul> } else { <p>@Translate("CreateFavoritList")</p><a class="btn-sm btn-primary d-block text-center" href="@favoritPage">@Translate("CreateFavoritListButton")</a> } </div> <label class="dropdown-trigger-off" for="FavoriteTrigger"></label> </div> </div> } </div> <span class="product-card__quantity-alert js-product-quantity-error-{{id}}">@Translate("Max stock level is reached")</span> } } else { <button type="button" id="CartButton_{{id}}" class="u-hidden"></button> } {{/.}} </script> <script id="Units" type="text/x-template"> <div class="dropdown__item dw-mod" onclick="HandlebarsBolt.UpdateContent('PriceAndActions', '/Default.aspx?ID=@feedId&UnitID={{value}}')">{{name}}</div> </script> @* Script templates for related products *@ <script id="ProductPreRenderContainer" type="text/x-template"> <div class="u-h600px u-full-width"> <div class="grid"> <div class="grid__col-12"> <div class="pre-render-element pre-render-element--md"></div> </div> </div> </div> </script> <script id="ProductContainer" type="text/x-template"> {{#.}} <div class="u-min-h400px u-full-width"> <div class="grid"> <div class="grid__col-45px grid__col--bleed-x"> <div class="grid__cell grid__cell--align-middle-left"> <button class="btn btn--condensed btn--clean {{prevdisabled}} dw-mod" onclick="HandlebarsBolt.UpdateContent('ProductList_{{groupName}}', '{{prevPage}}')" {{prevdisabled}}><i class="fa fa-chevron-left fa-2x"></i></button> </div> </div> <div class="grid__col-auto grid__col--bleed-x"> <div id="ProductsContainer" class="grid product-list dw-mod"> {{#ProductsContainer}} <div id="Product{{productId}}" class="grid__col-@relatedProductsColumnWidth product-list__list-item dw-mod"> <div class="product-list__inner"> {{#Product}} <div class="grid__cell product-list__grid-item__image dw-mod {{noImage}}"> <div class="stickers-container dw-mod"> {{#Stickers}} {{>Sticker}} {{/Stickers}} </div> <a href="{{link}}" onclick="Scroll.SavePosition(event)"><img class="grid__cell-img grid__cell-img--centered b-lazy" src="/Files/Images/placeholder.gif" data-src="/Admin/Public/GetImage.ashx?width=300&amp;height=300&amp;crop=5&amp;Compression=75&amp;image={{image}}" alt="{{name}}" /></a> </div> <div class="grid__cell product-list__grid-item__price-info {{shortGridInfo}} dw-mod"> <a href="{{link}}" onclick="Scroll.SavePosition(event)" title="{{name}}"><h6 class="u-condensed-text">{{name}}</h6></a> <div class="item-number dw-mod">{{number}}</div> @if (!onlyPreview && cfp == true) { <div class="price dw-mod">{{price}}</div> <div class="before-price {{onSale}} dw-mod">{{discount}}</div> } </div> <div class="product-list__grid-item__footer dw-mod"> <div class="u-ta-center"> @if (!onlyPreview && cfp == true) { <a href="{{link}}" id="CartButton_{{id}}" class="btn btn--secondary text-uppercase u-no-margin dw-mod">@Translate("View")</a> } else { <h5 class="mb-2">@Translate("LoginText", "Login")</h5> <label for="SignInModalTrigger" class="btn btn--primary u-no-margin sign-in-modal-trigger-button dw-mod" onclick="setTimeout(function () { document.getElementById('LoginUsername').focus() }, 10)">@Translate("Sign in")</label> } </div> </div> {{/Product}} </div> </div> {{/ProductsContainer}} </div> </div> <div class="grid__col-45px grid__col--bleed-x"> <div class="grid__cell grid__cell--align-middle-right"> <button class="btn btn--condensed btn--clean {{nextdisabled}} dw-mod" onclick="HandlebarsBolt.UpdateContent('ProductList_{{groupName}}', '{{nextPage}}')" {{nextdisabled}}><i class="fa fa-chevron-right fa-2x"></i></button> </div> </div> </div> </div> {{/.}} </script> <script id="Sticker" type="text/x-template"> <div class="stickers-container__tag {{className}} dw-mod">{{text}}</div> </script> @* Units templates *@ <script id="UnitOption" type="text/x-template"> <div class="dropdown__item dw-mod" onclick="HandlebarsBolt.UpdateContent('PriceAndActions', '{{link}}&feed=true&UnitID={{value}}&rid={{id}}')">{{name}}</div> </script> @*Variants data generation*@ <script> document.addEventListener("DOMContentLoaded", function (event) { var variants = []; document.getElementById("productGrid").addEventListener('contentLoaded', function (e) { if (e.srcElement.classList.contains("js-variants-wrap")) { Variants.SetVariantOptionStatesForProductList(e.srcElement); } }, false); @foreach (LoopItem variantgroup in GetLoop("VariantGroups")) { <text>var optionsArray = [];</text> foreach (LoopItem variantoption in variantgroup.GetLoop("VariantAvailableOptions")) { string variantSelection = variantoption.GetBoolean("Ecom:VariantOption.Selected") ? "checked" : ""; <text> var option = new Variants.VariantOption("@uniqueId", "@GetString("Ecom:Product.ID")", "@variantoption.GetValue("Ecom:VariantOption.ID")", "@variantoption.GetString("Ecom:VariantOption.Name")", "@variantSelection", "", "@variantoption.GetString("Ecom:VariantOption.Color")", "@variantoption.GetString("Ecom:VariantOption.ImgSmall.Clean")"); optionsArray.push(option); </text> } <text> var group = new Variants.VariantGroup("@GetString("Ecom:Product.ID")_@variantgroup.GetValue("Ecom:VariantGroup.ID")", "@variantgroup.GetValue("Ecom:VariantGroup.Name")", optionsArray); variants.push(group); </text> } var combinations = []; @foreach (LoopItem variantcomb in GetLoop("VariantStockCombinations")) { <text> combinations.push(new Variants.CombinationItem("@variantcomb.GetValue("Ecom:VariantStockCombination.VariantID")")); </text> } variants = variants.sort(function (a, b) { var firstVariantId = a.VariantOptions[0].variantId; for (var i = 0; i < combinations.length; i++) { var combinationIndex = combinations[i].id.indexOf(firstVariantId); if (combinationIndex != -1) { return combinationIndex; } } //should never happen return 0; }); Variants.SetProductFeedId('@feedId'); Variants.SetProductUrl('/@GetString("Ecom:Product.VariantLinkGroup.Clean")'); HandlebarsBolt.SetDataInCache(("Variants" + "@productId"), variants); HandlebarsBolt.SetDataInCache(("Combinations" + "@productId"), combinations); document.getElementById("PriceAndActions").addEventListener('contentLoaded', function (e) { Variants.InitVariants(variants, combinations, "@productId", "@uniqueId"); }, false); Handlebars.registerHelper('compare', function (lvalue, operator, rvalue, options) { var operators, result; if (arguments.length < 3) { throw new Error("Handlerbars Helper 'compare' needs 2 parameters"); } if (options === undefined) { options = rvalue; rvalue = operator; operator = "==="; } operators = { '==': function (l, r) { return l == r; }, '===': function (l, r) { return l === r; }, '!=': function (l, r) { return l != r; }, '!==': function (l, r) { return l !== r; }, '<': function (l, r) { return l < r; }, '>': function (l, r) { return l > r; }, '<=': function (l, r) { return l <= r; }, '>=': function (l, r) { return l >= r; }, 'typeof': function (l, r) { return typeof l == r; } }; if (!operators[operator]) { throw new Error("Handlerbars Helper 'compare' doesn't know the operator " + operator); } result = operators[operator](lvalue, rvalue); if (result) { return options.fn(this); } else { return options.inverse(this); } }); }); </script> @functions { string getIconForFile(string fileName) { string ext = Path.GetExtension(fileName); string icon = ""; switch (ext.ToLower()) { case ".xls": case ".xlsx": icon = "fa-file-excel-o"; break; case ".ppt": case ".pptx": icon = "fa-file-powerpoint-o"; break; case ".doc": case ".docx": icon = "fa-file-word-o"; break; case ".jpg": case ".jpeg": case ".png": case ".gif": case ".pdf": return "<img class='product__document-icon b-lazy' src='/Files/Images/placeholder.gif' data-src='/Admin/Public/GetImage.ashx?crop=5&height=70&width=120&Compression=75&DoNotUpscale=true&image=" + fileName + "' />"; default: icon = "fa-file-o"; break; } return "<i class='fa " + icon + "'></i> "; } public static string ToPascalCase(string str) { return CultureInfo.InvariantCulture.TextInfo .ToTitleCase(str.ToLowerInvariant()) .Replace("-", "") .Replace("_", "") .Replace(" ", ""); } } <script type="application/ld+json"> { "@@context": "http://schema.org/", "@@type": "Product", "name": "@GetString("Ecom:Product.Name")", @if (!string.IsNullOrEmpty(GetString("Ecom:Product.ImageLarge.Default.Clean"))) { <text>"image": [ "@siteURL/Admin/Public/GetImage.ashx?width=400&height=400&crop=0&Compression=75&DoNotUpscale=true&image=@productImage", "@siteURL/Admin/Public/GetImage.ashx?width=400&height=300&crop=0&Compression=75&DoNotUpscale=true&image=@productImage", "@siteURL/Admin/Public/GetImage.ashx?width=448&height=225&crop=0&Compression=75&DoNotUpscale=true&image=@productImage" ],</text> } "description": "@GetString("Ecom: Product.ShortDescription")", "mpn": "925872", @if (!string.IsNullOrEmpty(brand)) { <text>"brand": { "@@type": "Thing", "name": "@brand" },</text> } "offers": { "@@type": "Offer", "priceCurrency": "@GetString("Ecom:Product.Price.Currency.Code")", "price": "@GetString("Ecom:Product.Price.Price")", "availability": "@(GetInteger("Ecom:Product.Stock") > 0 ? "InStock" : "OutOfStock")" } } </script> <script> document.addEventListener("DOMContentLoaded", function () { if (document.getElementById("PriceAndActions")) { document.getElementById("PriceAndActions").addEventListener("contentLoaded", function (event) { if (document.querySelector(".js-variants") != null) { MatchVariants.Update(document.querySelector(".js-variants"), "DoNothing"); } }); } }); //Custom dropdown var isOpen = false; function toggleOptions(id) { isOpen = !isOpen; if (isOpen) { document.getElementById(id).style.visibility = 'visible'; document.getElementById(id).classList.add("active"); document.getElementById(id).focus(); } else { document.getElementById(id).blur(); document.getElementById(id).classList.remove("active"); document.getElementById(id).style.visibility = 'hidden'; } } function selected(val, id, blurId) { document.getElementById(id).innerHTML = val; toggleOptions(blurId); var variantContainer = $(".js-variants"); variantContainer.find('.dropdown-container').each(function () { var $this = $(this); var disabledItem = $this.find('.disabled'); if (disabledItem) { var displayValueItem = $this.find('.value-text'); if (displayValueItem.html() == disabledItem.html()) { displayValueItem.html("@Translate("Select variant")"); } } }); } </script>

Tilmelding til kursus

Tilmeld dig et af vore kurser og få den nyeste viden inden for sikker håndtering af spildevand.

Kontakt os

Har du spørgsmål til vores produkter, løsninger eller services? Eller søger du hjælp til beregninger og dimensioneringer? Vi står klar til at hjælpe. Udfyld formularen herunder, og vi kontakter dig hurtigst muligt.