Vi bruger cookies for at forbedre brugeroplevelsen

Vent venligst...
Kurven er tom...
Exception in template (Designs\Dwsimple\eCom/Product/ProductDW.cshtml): System.AggregateException: One or more errors occurred. ---> System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel.
   at System.Net.HttpWebRequest.GetResponse()
   at belugi.core.WebRequestExtensions.<>c__DisplayClass4_0.b__1() in C:\Code\InetDesign\SVN\DynamicWeb\Belugi\belugi.core\belugi.core\Extensions\WebRequestExtensions.cs:line 77
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at belugi.core.WebRequestExtensions.ExecuteWebRequestInternal(String url, String key) in C:\Code\InetDesign\SVN\DynamicWeb\Belugi\belugi.core\belugi.core\Extensions\WebRequestExtensions.cs:line 111
   at belugi.core.WebRequestExtensions.<>c__DisplayClass1_0.b__0() in C:\Code\InetDesign\SVN\DynamicWeb\Belugi\belugi.core\belugi.core\Extensions\WebRequestExtensions.cs:line 24
   at System.InMemoryCache.GetOrAdd[T](String key, CachePeriod cachePeriod, Func`1 GetItemsFunc, Boolean isWeb) in C:\Code\InetDesign\SVN\DynamicWeb\Belugi\belugi.core\belugi.core\Caching\Clients\InMemoryCache.cs:line 21
   at belugi.core.WebRequestExtensions.ExecuteWebRequest(String url, String key, Boolean cache) in C:\Code\InetDesign\SVN\DynamicWeb\Belugi\belugi.core\belugi.core\Extensions\WebRequestExtensions.cs:line 23
   at CompiledRazorTemplates.Dynamic.daebcfccdff.Execute()
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context)
   at RazorEngine.Razor.Parse[T](String razorTemplate, T model, String cacheName)
   at Dynamicweb.Rendering.Template.Output()
---> (Inner Exception #0) System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel.
   at System.Net.HttpWebRequest.GetResponse()
   at belugi.core.WebRequestExtensions.<>c__DisplayClass4_0.b__1() in C:\Code\InetDesign\SVN\DynamicWeb\Belugi\belugi.core\belugi.core\Extensions\WebRequestExtensions.cs:line 77
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()<---

@helper RenderProduct(dynamic product) { var id = product.GetString("Ecom:Product.ID"); var domain = System.Web.HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority); //var Image = string.Format("/Files/Images/Ecom/Products/{0}_1.jpg", product.GetString("Ecom:Product.Number")); var Image = string.Format("https://res.cloudinary.com/belugi/t_small/{0}_1.jpg", product.GetString("Ecom:Product.Number")); var Name = product.GetString("Ecom:Product.Name"); var Description = product.GetString("Ecom:Product.ShortDescription"); var url = Pageview.Area.Item["ProductPage"] + "?ProductId=" + id; <figure class="ex"> <div class="image" style="background-image:url('@Image')"> <a href="@url"></a> </div> <div class="title"><a href="@url">@Name</a></div> </figure> } @helper RenderProductVariants(dynamic product) { var variantGroups = product.GetLoop("VariantGroups"); var variantCombinations = product.GetLoop("VariantCombinations"); var selectedVariantComboID = product.GetString("Ecom:Product.SelectedVariantComboID"); @RenderProductVariants(product.GetString("Ecom:Product.ID"), variantGroups, variantCombinations, selectedVariantComboID, isMain: false, defaultPreselect: false) } @helper RenderProductVariants() { var variantGroups = GetLoop("VariantGroups"); var variantCombinations = GetLoop("VariantCombinations"); var selectedVariantComboID = GetString("Ecom:Product.SelectedVariantComboID"); var defaultPreselect = false; if (System.Web.HttpContext.Current.Request.RawUrl.Contains("=VO")) { defaultPreselect = true; } @RenderProductVariants(GetString("Ecom:Product.ID"), variantGroups, variantCombinations, selectedVariantComboID, true, defaultPreselect) } @helper RenderProductVariants(string productID, List<LoopItem> variantGroups, List<LoopItem> variantCombinations, string variantID, bool isMain = true, bool defaultPreselect = true) { var variantsExists = false; var availableVariantCombinations = new List<string>(); foreach (LoopItem variantCombination in variantCombinations) { availableVariantCombinations.Add(variantCombination.GetString("Ecom:VariantCombination.VariantID")); } if (variantGroups.Count() > 0 && availableVariantCombinations.Any()) { //color variant if (variantGroups.Count() == 1) { var otherVariants = new List<ProductVariant>(); var variantgroup = variantGroups.First(); var variantgroupid = variantgroup.GetString("Ecom:VariantGroup.ID"); var variantgroupname = variantgroup.GetString("Ecom:VariantGroup.Name"); foreach (LoopItem variantoption in variantgroup.GetLoop("VariantOptions")) { var variantoptionid = variantoption.GetString("Ecom:VariantOption.ID"); if (!availableVariantCombinations.Contains(variantoptionid)) { continue; } var variantoptionname = variantoption.GetString("Ecom:VariantOption.Name"); var selected = false; if (defaultPreselect) { selected = variantoption.GetBoolean("Ecom:VariantOption.Selected"); } var existingVariant = otherVariants.FirstOrDefault(v => v.VariantGroupID == variantgroupid); if (existingVariant != null) { existingVariant.VariantOptions.Add(new ProductVariantOption { VariantOptionID = variantoptionid, VariantOptionName = variantoptionname, Selected = selected }); } else { otherVariants.Add(new ProductVariant { VariantGroupID = variantgroupid, VariantGroupName = variantgroupname, VariantOptions = new List<ProductVariantOption> { new ProductVariantOption { VariantOptionID = variantoptionid, VariantOptionName = variantoptionname, Selected = selected } } }); } } foreach (var otherVariant in otherVariants) { variantsExists = true; <div class="variant clearfix"> <select class="other-variant" data-main="@(isMain ? "1" : "0")" data-pageurl="/@Pageview.Area.Item["ProductPage"]&ProductID=@productID"> <option value="-1">@Translate("Choose variant", "Choose variant")</option> @foreach (var variant in otherVariant.VariantOptions) { if (otherVariant.VariantOptions.Count() == 1) { variant.Selected = true; } <option value="@variant.VariantOptionID" @(variant.Selected ? "selected" : "")>@variant.VariantOptionName</option> } </select> </div> } } //size color variant if (variantGroups.Count() == 2) { var availableSizeCombinations = new List<string>(); foreach (var availVariantOption in availableVariantCombinations) { var optionSplit = availVariantOption.Split('.'); if (!availableSizeCombinations.Contains(optionSplit[0])) { availableSizeCombinations.Add(optionSplit[0]); } } var sizeColorVariants = new List<SizeColorVariant>(); var sizeVariantGroup = variantGroups[0]; var colorVariantGroup = variantGroups[1]; foreach (LoopItem sizeVariantoption in sizeVariantGroup.GetLoop("VariantOptions")) { var sizeVariantOptionId = sizeVariantoption.GetString("Ecom:VariantOption.ID"); if (!availableSizeCombinations.Contains(sizeVariantOptionId)) { continue; } var sizeName = sizeVariantoption.GetString("Ecom:VariantOption.Name"); var sizeSelected = defaultPreselect ? sizeVariantoption.GetBoolean("Ecom:VariantOption.Selected") : false; var sizeColorVariant = new SizeColorVariant { VariantID = sizeVariantOptionId, Size = sizeName, Selected = sizeSelected, Colors = new List<ColorVariant>() }; foreach (LoopItem colorVariantoption in colorVariantGroup.GetLoop("VariantOptions")) { var colorVariantOptionId = colorVariantoption.GetString("Ecom:VariantOption.ID"); var availableColorCombinations = availableVariantCombinations.FindAll(v => v.StartsWith(sizeVariantOptionId + ".")) .Select(v => v.Split('.')[1]) .ToList(); if (!availableColorCombinations.Contains(colorVariantOptionId)) { continue; } var colorName = colorVariantoption.GetString("Ecom:VariantOption.Name"); var colorSelected = defaultPreselect ? colorVariantoption.GetBoolean("Ecom:VariantOption.Selected") : false; sizeColorVariant.Colors.Add(new ColorVariant { Color = colorName, VariantID = colorVariantOptionId, Selected = colorSelected }); } sizeColorVariants.Add(sizeColorVariant); } if (sizeColorVariants.Any()) { variantsExists = true; <div class="lingerie-container"> <div class="variant clearfix"> <select class="lingerie-size" data-main="@(isMain ? "1" : "0")" data-pageurl="/@Pageview.Area.Item["ProductPage"]&ProductID=@productID"> <option value="-1">@Translate("Choose variant", "Choose variant")</option> @for (var i = 0; i < sizeColorVariants.Count; i++) { if (sizeColorVariants.Count == 1) { sizeColorVariants[i].Selected = true; } <option data-value="@(sizeColorVariants[i].VariantID)" value="@i" @(sizeColorVariants[i].Selected ? "selected" : "")>@sizeColorVariants[i].Size</option> } </select> </div> @foreach (var sizeColor in sizeColorVariants) { <div class="variant clearfix"> <select id="lingerieColor-@sizeColorVariants.IndexOf(sizeColor)" class="lingerie-color" data-visible="@(sizeColor.Selected ? 1 : 0)" data-main="@(isMain ? "1" : "0")" data-pageurl="/@Pageview.Area.Item["ProductPage"]&ProductID=@productID"> <option value="-1">@Translate("Choose variant", "Choose variant")</option> @foreach (var color in sizeColor.Colors) { if (sizeColor.Colors.Count() == 1) { color.Selected = true; } <option value="@color.VariantID" @(color.Selected ? "selected" : "")>@color.Color</option> } </select> </div> } </div> } } } if (variantsExists) { <hr /> } } @helper RenderProductObject(Dynamicweb.eCommerce.Products.Product product) { var id = product.ID; var domain = System.Web.HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority); //var Image = string.Format("/Files/Images/Ecom/Products/{0}_1.jpg", product.Number); var Image = string.Format("https://res.cloudinary.com/belugi/t_small/{0}_1.jpg", product.Number); var Name = product.Name; var Description = product.ShortDescription; var url = Pageview.Area.Item["ProductPage"] + "?ProductId=" + id; <figure class="ex"> <div class="image" style="background-image:url('@Image')"> <a href="@url"></a> </div> <div class="title"><a href="@url">@Name</a></div> </figure> } @helper RenderProductObjectVariants(Dynamicweb.eCommerce.Products.Product product) { var variantGroups = product.VariantGroups.ToList(); var variantCombinations = product.VariantCombinations.ToList(); var selectedVariantComboID = product.VariantID; @RenderProductObjectVariants(product.ID, variantGroups, variantCombinations, selectedVariantComboID, isMain: false, defaultPreselect: false) } @helper RenderProductObjectVariants(string productID, List<Dynamicweb.eCommerce.Variants.VariantGroup> variantGroups, List<Dynamicweb.eCommerce.Variants.VariantCombination> variantCombinations, string variantID, bool isMain = true, bool defaultPreselect = true) { var variantsExists = false; var availableVariantCombinations = new List<string>(); foreach (var variantCombination in variantCombinations) { availableVariantCombinations.Add(variantCombination.VariantID); } if (variantGroups.Count > 0 && availableVariantCombinations.Any()) { //color variant if (variantGroups.Count() == 1) { var otherVariants = new List<ProductVariant>(); var variantgroup = variantGroups.First(); var variantgroupid = variantgroup.ID; var variantgroupname = variantgroup.Name; foreach (var variantoption in variantgroup.VariantOptions) { var variantoptionid = variantoption.ID; if (!availableVariantCombinations.Contains(variantoptionid)) { continue; } var variantoptionname = variantoption.Name; var selected = false; if (defaultPreselect) { selected = false; //variantoption.GetBoolean("Ecom:VariantOption.Selected"); } var existingVariant = otherVariants.FirstOrDefault(v => v.VariantGroupID == variantgroupid); if (existingVariant != null) { existingVariant.VariantOptions.Add(new ProductVariantOption { VariantOptionID = variantoptionid, VariantOptionName = variantoptionname, Selected = selected }); } else { otherVariants.Add(new ProductVariant { VariantGroupID = variantgroupid, VariantGroupName = variantgroupname, VariantOptions = new List<ProductVariantOption> { new ProductVariantOption { VariantOptionID = variantoptionid, VariantOptionName = variantoptionname, Selected = selected } } }); } } foreach (var otherVariant in otherVariants) { variantsExists = true; <div class="variant clearfix"> <select class="other-variant" data-main="@(isMain ? "1" : "0")" data-pageurl="/@Pageview.Area.Item["ProductPage"]&ProductID=@productID"> <option value="-1">@Translate("Choose variant", "Choose variant")</option> @foreach (var variant in otherVariant.VariantOptions) { if (otherVariant.VariantOptions.Count() == 1) { variant.Selected = true; } <option value="@variant.VariantOptionID" @(variant.Selected ? "selected" : "")>@variant.VariantOptionName</option> } </select> </div> } } //size color variant if (variantGroups.Count() == 2) { var availableSizeCombinations = new List<string>(); foreach (var availVariantOption in availableVariantCombinations) { var optionSplit = availVariantOption.Split('.'); if (!availableSizeCombinations.Contains(optionSplit[0])) { availableSizeCombinations.Add(optionSplit[0]); } } var sizeColorVariants = new List<SizeColorVariant>(); var sizeVariantGroup = variantGroups[0]; var colorVariantGroup = variantGroups[1]; foreach (var sizeVariantoption in sizeVariantGroup.VariantOptions) { var sizeVariantOptionId = sizeVariantoption.ID; if (!availableSizeCombinations.Contains(sizeVariantOptionId)) { continue; } var sizeName = sizeVariantoption.Name; var sizeSelected = false; if (defaultPreselect) { sizeSelected = false; //sizeVariantoption.GetBoolean("Ecom:VariantOption.Selected"); } var sizeColorVariant = new SizeColorVariant { VariantID = sizeVariantOptionId, Size = sizeName, Selected = sizeSelected, Colors = new List<ColorVariant>() }; foreach (var colorVariantoption in colorVariantGroup.VariantOptions) { var colorVariantOptionId = colorVariantoption.ID; var availableColorCombinations = availableVariantCombinations.FindAll(v => v.StartsWith(sizeVariantOptionId + ".")) .Select(v => v.Split('.')[1]) .ToList(); if (!availableColorCombinations.Contains(colorVariantOptionId)) { continue; } var colorName = colorVariantoption.Name; var colorSelected = false; if (defaultPreselect) { colorSelected = false; //sizeVariantoption.GetBoolean("Ecom:VariantOption.Selected"); } sizeColorVariant.Colors.Add(new ColorVariant { Color = colorName, VariantID = colorVariantOptionId, Selected = colorSelected }); } sizeColorVariants.Add(sizeColorVariant); } if (sizeColorVariants.Any()) { variantsExists = true; <div class="lingerie-container"> <div class="variant clearfix"> <select class="lingerie-size"> <option value="-1">@Translate("Choose variant", "Choose variant")</option> @for (var i = 0; i < sizeColorVariants.Count; i++) { if (sizeColorVariants.Count == 1) { sizeColorVariants[i].Selected = true; } <option data-value="@(sizeColorVariants[i].VariantID)" value="@i" @(sizeColorVariants[i].Selected ? "selected" : "")>@sizeColorVariants[i].Size</option> } </select> </div> @foreach (var sizeColor in sizeColorVariants) { <div class="variant clearfix"> <select id="lingerieColor-@sizeColorVariants.IndexOf(sizeColor)" class="lingerie-color" data-visible="@(sizeColor.Selected ? 1 : 0)" data-main="@(isMain ? "1" : "0")" data-pageurl="/@Pageview.Area.Item["ProductPage"]&ProductID=@productID"> <option value="-1">@Translate("Choose variant", "Choose variant")</option> @foreach (var color in sizeColor.Colors) { if (sizeColor.Colors.Count() == 1) { color.Selected = true; } <option value="@color.VariantID" @(color.Selected ? "selected" : "")>@color.Color</option> } </select> </div> } </div> } } } if (variantsExists) { <hr /> } } @using System.Web; @using System.Net; @using System.Linq; @using System.Collections.Specialized; @using belugi.core.model; @using belugi.core; @using Dynamicweb.eCommerce.Products; @using belugi.core.provider; @{ string image = GetString("Ecom:Product.ImageLarge.Default.Clean"); var grouplink = ""; string productname = ""; var pid = GetValue("Ecom:Product.ID"); var minQuantity = GetInteger("Ecom:Product:Field.antal.Value.Clean"); var productid = GetValue("Ecom:Product.ID"); var groupId = GetValue("Ecom:ProductList:Page.GroupID"); var productUrl = Pageview.Area.Item["ProductPage"]; var similarProductsUrl = Pageview.Area.Item["SimilarProductsWidgetPage"]; var customersProductsUrl = Pageview.Area.Item["CustomersProductsWidgetPage"]; var longDescription = GetString("Ecom:Product.LongDescription"); int userId = Dynamicweb.Modules.UserManagement.User.GetCurrentUserID(); var stockType = GetInteger("Ecom:Product:Field.stocktype"); //var productRelatedGroups = CacheClient.Default.GetOrAdd(string.Format("groupCache_{0}", productid), CachePeriod.ForHours(1), () => GetLoop("ProductRelatedGroups")); var canonicalUrl = HttpContext.Current.Request.RawUrl; var productCanonicalUrl = GetString("Ecom:Product.Canonical"); if (productCanonicalUrl != canonicalUrl) { productCanonicalUrl = "https://" + HttpContext.Current.Request.Url.Host + productCanonicalUrl; <!--@SnippetStart(metatags)--> <link rel="canonical" href="@productCanonicalUrl"> <!--@SnippetEnd(metatags)--> } else if (canonicalUrl.Contains("?")) { canonicalUrl = "https://" + HttpContext.Current.Request.Url.Host + canonicalUrl.Substring(0, canonicalUrl.IndexOf("?")); <!--@SnippetStart(metatags)--> <link rel="canonical" href="@canonicalUrl"> <!--@SnippetEnd(metatags)--> } string fullUrl = HttpContext.Current.Request.Url.AbsoluteUri; string widgetDomain = fullUrl.Substring(0, fullUrl.LastIndexOf('/') + 1); } <script type="text/javascript" language="javascript"> function AddBundleToCart(self) { AddToCart(null, self.attributes["data-productId"].value, 1, "", true); } function PWUpdateCart(self) { var accessoriesNo = 0; $(".accessoryitem").each(function (i, n) { if (n.checked == true) { accessoriesNo++; setTimeout(function () { AddAccesoryToCart(n.id); }, 300); } }); showLoading(); var $form = $(self).parents("form"); if (accessoriesNo > 0) { setTimeout(function () { AddToCart(null, $form.find('[name="ProductID"]').val(), 1, $form.find('[name="VariantID"]').val(), true); }, accessoriesNo * 300); } else { AddToCart(null, $form.find('[name="ProductID"]').val(), 1, $form.find('[name="VariantID"]').val(), true); } } $(function () { var hasSelectedVariant = function (el) { var $box = el.closest('.box'), $otherVariant = $box.find('.other-variant'), $lingerieSize = $box.find('.lingerie-size'); if ($otherVariant.length > 0 && $otherVariant.val() != "-1") { return true; } if ($lingerieSize.length > 0 && $lingerieSize.val() != "-1") { var $lingerieContainer = $lingerieSize.closest('.lingerie-container'), $color = $lingerieContainer.find('#lingerieColor-' + $lingerieSize.val()); if ($color.val() != "-1") { return true; } } return false; }; $('#add-to-cart-btn').click(function (e) { e.preventDefault(); // if we have variants and no variant is selected, disable buy button var el = $(this); if (el.attr('disabled') == "disabled") { return false; } if (!hasSelectedVariant(el)) { var $box = el.closest('.box'), $otherVariant = $box.find('.other-variant'), $lingerieSize = $box.find('.lingerie-size'); if ($otherVariant.length == 0 && $lingerieSize.length == 0) { PWUpdateCart(this); } else { $.magnificPopup.open({ items: { src: '#infopopup', type: 'inline' } }); } } else { PWUpdateCart(this); } }); $('#add-to-wishlist-btn').click(function (e) { e.preventDefault(); // if we have variants and no variant is selected, disable buy button var el = $(this); if (!hasSelectedVariant(el)) { var $box = el.closest('.box'), $otherVariant = $box.find('.other-variant'), $lingerieSize = $box.find('.lingerie-size'); if ($otherVariant.length == 0 && $lingerieSize.length == 0) { showLoading(); $(this).parent().submit(); } else { $.magnificPopup.open({ items: { src: '#infopopup', type: 'inline' } }); } } else { showLoading(); $(this).parent().submit(); } }); $('#add-to-wishlist-login-btn').click(function (e) { e.preventDefault(); $.magnificPopup.open({ items: { src: '#loginpopup', type: 'inline' } }); s }); }); </script> <div class="mfp-hide main-popup choose-variant-popup" id="infopopup"> @Translate("You must select a variant", "You must select a variant") </div> @{ var defname = string.Empty; if (string.IsNullOrWhiteSpace(GetString("Server:Request.username"))) { defname = GetString("Server:Request.username"); } string defpass = ""; if (string.IsNullOrWhiteSpace(GetString("Server:Request.password"))) { defpass = GetString("Server:Request.password"); } var pageid = Pageview.Area.Item["SignInPageId"]; } <div class="mfp-hide main-popup" id="loginpopup"> <div class="row"> <div class="col-sm-12"> <form action="/Default.aspx?ID=@pageid" method="post"> <input type="hidden" name="ID" value="@pageid" /> <input type="hidden" name="DWExtranetUsernameRemember" value="True" /> <input type="hidden" name="DWExtranetPasswordRemember" value="True" /> <input type="hidden" name="Redirect" value="@HttpContext.Current.Request.RawUrl" /> <div class="h3">@Translate("Whishlist.LoginTitle", "Whishlist.LoginTitle")</div> <div class="form-group"> <input type="text" id="login-username" name="username" class="form-control" placeholder="@Translate("Email", "Email")" value="@defname" /> </div> <div class="form-group"> <input type="password" id="login-password" name="password" class="form-control" placeholder="@Translate("Password", "Password")" value="@defpass" /> </div> <div class="form-group"> <button class="btn btn-big btn-black btn-block">@Translate("Login", "Login")</button> </div> <div class="form-group clearfix"> <span class="checkwrap pull-left"> <input type="checkbox" name="Autologin" id="Autologin" checked="checked" value="True" /> <label for="Autologin"> @Translate("Remember me", "Remember me") </label> </span> <span class="pull-right"> <a href="/Default.aspx?id=@pageid&LoginAction=Recovery">@Translate("Forgot your password?", "Forgot your password?")</a> </span> </div> <div class="form-group clearfix"> <div class="pull-left"> <a href="@("/" + Pageview.Area.Item["CreateUserPage"])">@Translate("Create User", "Create User")</a> </div> </div> </form> </div> </div> </div> <div style="display:none;"> @{ var groups = new List<Dynamicweb.eCommerce.Products.Group>(); foreach (var g in GetLoop("AssociatedGroups")) { var group = Dynamicweb.eCommerce.Products.Group.GetGroupByID(g.GetString("Ecom:Group.ID"), Dynamicweb.eCommerce.Common.Context.LanguageID); groups.Add(group); } var primaryGroup = groups.Find(g => g.IsTopGroup); int position = 1; var urls = new List<string>(); } @if (primaryGroup != null) { var productPageView = Dynamicweb.Frontend.PageView.Current() ?? Dynamicweb.Frontend.PageView.GetPageview(); var allPages = Dynamicweb.Content .Page .GetPages() .Where(p => p.AreaID == productPageView.AreaID && p.Active == true && p.Hidden == false && p.IsFolder == false) .OrderBy(p => p.Sort) .ToList(); var categoryTemplate = "Category.cshtml"; var categoryPages = allPages.FindAll(p => p.ParentPageID == 0 && p.LayoutTemplate == categoryTemplate) .ToList(); var primaryCategoryPage = categoryPages.Find(page => PageItemType.GetPageItemTypeInstance(int.Parse(page.ItemId)).Category == primaryGroup.ID); var primaryGroupUrl = "/" + primaryGroup.Name.NormalizeForUrl(); urls.Add(primaryGroupUrl); urls.Add(primaryGroupUrl); <ol itemscope itemtype="http://schema.org/BreadcrumbList"> <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"> <a itemscope itemtype="http://schema.org/Thing" itemprop="item" href="@string.Join("", urls)"> <span itemprop="name">@primaryGroup.Name</span> </a> <meta itemprop="position" content="@position" /> </li> @while (primaryGroup.HasChildGroups) { var allSubGroupIds = primaryGroup.Subgroups.ToList().FindAll(g => !g.IsTopGroup).Select(g => g.ID); var selectedSubgroup = groups.Find(g => allSubGroupIds.Contains(g.ID)); if (selectedSubgroup == null) { break; } var subGroupUrl = string.Format("/{0}", selectedSubgroup.Name.NormalizeForUrl()); urls.Add(subGroupUrl); primaryGroup = selectedSubgroup; position = position + 1; <text>›</text> <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"> <a itemscope itemtype="http://schema.org/Thing" itemprop="item" href="@string.Join("", urls)"> <span itemprop="name">@selectedSubgroup.Name</span> </a> <meta itemprop="position" content="@position" /> </li> } </ol> } </div> <section class="product" itemscope itemtype="http://schema.org/Product"> <div class="container"> <div class="headline"></div> <div class="product-block clearfix" style="position:relative;"> <div class="product-gallery"> <div class="product-slider royalSlider rsDefault"> @{ var slideImages = GetSlideImages(); int imagePos = 0; string imageAlt = GetString("Ecom:Product.Name"); } @foreach (var slideImage in slideImages) { if (imagePos > 0) { imageAlt = ""; } imagePos = imagePos + 1; <a class="rsImg" data-rsbigimg="@slideImage" href="@slideImage"> <img width="96" height="72" class="rsTmb" src="@slideImage" itemprop="image" alt="@imageAlt" /> </a> } </div> @{ var video1Exists = false; var video2Exists = false; var mainProductNo = productid.ToString().Replace("PROD", ""); var video1Embedcode = GetString("Ecom:Product:Field.Video1Embedcode"); var video1Text = GetString("Ecom:Product:Field.Video1Text"); var video2Embedcode = GetString("Ecom:Product:Field.Video2Embedcode"); var video2Text = GetString("Ecom:Product:Field.Video2Text"); var video1Image = ""; var video2Image = ""; if (!string.IsNullOrEmpty(video1Embedcode)) { video1Image = "https://res.cloudinary.com/belugi/t_videothumb/" + mainProductNo + "video1.jpg"; video1Exists = belugi.core.Provider.ImageProvider.ImageExists(video1Image); if (!video1Exists) { video1Image = "https://img.youtube.com/vi/" + video1Embedcode + "/0.jpg"; video1Exists = belugi.core.Provider.ImageProvider.ImageExists(video1Image); } } if (!string.IsNullOrEmpty(video2Embedcode)) { video2Image = "https://res.cloudinary.com/belugi/t_videothumb/" + mainProductNo + "video2.jpg"; video2Exists = belugi.core.Provider.ImageProvider.ImageExists(video2Image); if (!video2Exists) { video2Image = "https://img.youtube.com/vi/" + video2Embedcode + "/0.jpg"; video2Exists = belugi.core.Provider.ImageProvider.ImageExists(video2Image); } } } @if (video1Exists || video2Exists) { <div class="product-video clearfix visible-md visible-lg"> @if (video1Exists) { <a class="video-item popup-youtube" href="https://www.youtube.com/watch?v=@(video1Embedcode)"> <div class="video-image text-center" style="background-image:url(@(video1Image))"> <i class="fa fa-play"></i> <img src="@(video1Image)" alt="" /> </div> @if (!string.IsNullOrEmpty(video1Text)) { <div class="video-text"> <div class="h3 title">@Translate("Video", "Video")</div> <p>@video1Text</p> </div> } </a> } @if (video2Exists) { <a class="video-item popup-youtube" href="https://www.youtube.com/watch?v=@(video2Embedcode)"> <div class="video-image text-center" style="background-image:url(@(video2Image))"> <i class="fa fa-play"></i> <img src="@(video2Image)" alt="" /> </div> @if (!string.IsNullOrEmpty(video2Text)) { <div class="video-text"> <div class="h3 title">@Translate("Video", "Video")</div> <p>@video2Text</p> </div> } </a> } </div> } <script type="text/javascript"> $(function () { BELUGI.Layout.initProductSlider(); BELUGI.Layout.autoHeightProductInfo(); }); </script> </div> <div class="product-info"> <div class="box"> <h1 class="h3" itemprop="name">@GetString("Ecom:Product.Name")</h1> <meta itemprop="brand" content="@GetString("Ecom:Manufacturer.Name")" /> <meta itemprop="sku" content="@GetString("Ecom:Product.Number")" /> <meta itemprop="gtin12" content="@GetString("@Ecom:Product:Field.Ean")" /> <hr /> <div class="h2" itemscope itemtype="http://schema.org/Offer"> <link itemprop="itemCondition" href="http://schema.org/NewCondition" /> <meta itemprop="priceCurrency" content="@GetString("Ecom:Product.Price.Currency.Code")" /> @if (GetString("Ecom:Product.Discount.Price") != GetString("Ecom:Product.Price")) { <meta itemprop="price" content="@GetString("Ecom:Product.Discount.Price.PriceWithVAT").Replace(".", "").Replace(",", ".")" /> <del>@GetString("Ecom:Product.Price")</del> @GetValue("Ecom:Product.Discount.Price.PriceWithVATFormatted") } else { <meta itemprop="price" content="@GetString("Ecom:Product.Price.PriceWithVAT").Replace(".", "").Replace(",", ".")" /> @GetValue("Ecom:Product.Price.PriceWithVATFormatted") } @{ var deliveryText = ""; if (!string.IsNullOrEmpty(GetString("Ecom:Product:Stock.DeliveryText"))) { deliveryText = " (" + GetString("Ecom:Product:Stock.DeliveryText") + " " + Translate(GetString("Ecom:Product:Stock.DeliveryUnit"), GetString("Ecom:Product:Stock.DeliveryUnit")) + ")"; } var propStock = "InStock"; if (@GetString("Ecom:Product:Stock.Image.Clean").Contains("red")) { propStock = "OutOfStock"; } } <div style="display:none;" itemprop="availability" href="http://schema.org/@propStock"> @Translate(GetString("Ecom:Product:Stock.Text"), GetString("Ecom:Product:Stock.Text"))@deliveryText </div> </div> <hr /> <div class="h5" itemprop="description" style="white-space: pre-wrap;"> @if (!string.IsNullOrEmpty(GetString("Ecom:Product.ShortDescription"))) { @GetString("Ecom:Product.ShortDescription").TrimStart(' ') } </div> <script type="text/javascript" language="javascript"> var variantID = "@GetValue("Ecom:Product.SelectedVariantComboID")"; </script> <hr /> @RenderProductVariants() <div> <img src="@GetString("Ecom:Product:Stock.Image.Clean")" alt="@Translate(GetString("Ecom:Product:Stock.Text"), GetString("Ecom:Product:Stock.Text"))" /> @Translate(GetString("Ecom:Product:Stock.Text"), GetString("Ecom:Product:Stock.Text"))@deliveryText </div> <hr /> @*Accessory products*@ @if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.AccessoryProducts"))) { <div class="h3">@Translate("Product.AccessoryTitle", "Tilbehør")</div> var accessoryProductsSplit = GetString("Ecom:Product:Field.AccessoryProducts").Split(','); foreach (var accessoryProdId in accessoryProductsSplit) { var productObj = Dynamicweb.eCommerce.Products.Product.GetProductByID("PROD" + accessoryProdId); if (productObj == null || productObj.Stock <= 0) { continue; } var discount = ProductProvider.GetDiscountedPriceFormatted(productObj.ID, productObj.Price.Price); var price = productObj.Price.PriceFormatted; var relatedUrl = Pageview.Area.Item["ProductPage"] + "?ProductId=" + productObj.ID; <div class="check-wrap clearfix"> <input type="checkbox" class="accessoryitem" id="@productObj.ID" /> <label for="@productObj.ID"> <a href="@relatedUrl"> <span>@productObj.Name</span> @if (HttpContext.Current.Request["test"] == "test") { if (discount != price) { <del>@price</del> @discount } else { @price } } else { @price } </a> </label> </div> } <hr /> } <div class="clearfix"> </div> @{ bool addToCartIsActive = true; if (GetInteger("Ecom:Product.Stock") <= 0 && stockType == 2) { addToCartIsActive = false; } } <div class="row product-button-group"> <div class="col-sm-9"> <form method="post" action="/Default.aspx"> @GetValue("Ecom:Product.Form.Clean") <a id="add-to-cart-btn" @(GetInteger("Ecom:Product.Stock") <= 0 || !addToCartIsActive ? "disabled " : "") class="btn btn-black btn-block btn-big"> @if (addToCartIsActive) { @Translate("Add to cart", "Add to cart") <i class="fa fa-cart-plus"></i> } else { @Translate("Discountinued", "Produktet er udgået") } </a> </form> </div> <div class="col-sm-3"> @if (userId > 0) { var productInFavoritesList = false; var favoriteProducts = Dynamicweb.eCommerce.CustomerCenter.CustomerProductListProduct.GetProductsByUserId(userId); if (favoriteProducts.Any(p => p.ProductID == GetString("Ecom:Product.ID") && p.ProductVariantID == GetString("Ecom:Product.SelectedVariantComboID"))) { productInFavoritesList = true; } if (!productInFavoritesList) { <form method="post"> <input type="hidden" name="CCAddToMyLists" value="@GetValue("Ecom:Product.ID")" /> <input type="hidden" name="CCAddToListVariantID" value="@GetValue("Ecom:Product.SelectedVariantComboID")" /> <input type="hidden" name="CCAddToListLanguageID" value="@GetValue("Ecom:Product.LanguageID")" /> <a id="add-to-wishlist-btn" class="btn btn-black btn-block btn-big btn-white"> <i class="fa fa-heart"></i> </a> </form> } else { <form method="post"> <input type="hidden" name="CCRemoveFromMyLists" value="@GetValue("Ecom:Product.ID")" /> <input type="hidden" name="CCRemoveFromListVariantID" value="@GetValue("Ecom:Product.SelectedVariantComboID")" /> <input type="hidden" name="CCRemoveFromListLanguageID" value="@GetValue("Ecom:Product.LanguageID")" /> <a id="add-to-wishlist-btn" class="btn btn-black btn-block btn-big btn-white"> <i class="fa fa-minus"></i> </a> </form> } } else { <a id="add-to-wishlist-login-btn" class="btn btn-black btn-block btn-big btn-white"> <i class="fa fa-heart"></i> </a> } </div> </div> </div> </div> </div> </div> </section> <section class="product"> <div class="container"> <div class="box box-double"> <div class="row"> @if (!string.IsNullOrEmpty(longDescription)) { <div class="col-sm-6"> <div class="h2 text-uppercase">@Translate("Description", "Description")</div> <p class="long-desc">@Raw(longDescription)</p> </div> } <div class="col-sm-6"> <div class="h2 text-uppercase">@Translate("Features", "Features")</div> <div class="specs"> <p> <span><strong>@Translate("Product.Number", "Produktnr.")</strong></span> <span>@GetString("Ecom:Product.Number")</span> </p> @foreach (var productCategory in GetLoop("ProductCategories")) { foreach (var productCategoryField in productCategory.GetLoop("ProductCategoryFields")) { if (productCategoryField.GetString("Ecom:Product.CategoryField.ID") == "Batteritype") { continue; } var value = ""; var isMultiSelect = productCategoryField.GetString("Ecom:Product.CategoryField.TypeID") == "15"; if (isMultiSelect) { value = productCategoryField.GetString("Ecom:Product.CategoryField.OptionLabel"); } else { value = productCategoryField.GetString("Ecom:Product.CategoryField.Value"); } if (string.IsNullOrEmpty(value) || value == "0") { continue; } if (isMultiSelect) { <p> <span> <strong>@productCategoryField.GetString("Ecom:Product.CategoryField.Label").ToUpper()</strong> </span> @{ var splits = value.Split(','); } @if (splits.Any()) { <span> @foreach (var valueSplit in splits) { @valueSplit <br /> } </span> } </p> } else { <p> <span> <strong>@productCategoryField.GetString("Ecom:Product.CategoryField.Label").ToUpper()</strong> </span> <span>@value</span> </p> } } } </div> </div> </div> </div> </div> </section> @{ var pageView = Dynamicweb.Frontend.PageView.Current() ?? Dynamicweb.Frontend.PageView.GetPageview(); var area = Dynamicweb.Content.Area.GetAreaById(pageView.AreaID); var EcomLanguageID = area.EcomLanguageID; var bundles = belugi.core.provider.ProductProvider.GetBundles(GetValue("Ecom:Product.ID").ToString(), EcomLanguageID); foreach (var productBundle in bundles.ProductBundles) { var dw_bundleProduct = Dynamicweb.eCommerce.Products.Product.GetProductByID(productBundle.BundleProductId); double totalPrice = 0; <section class="products set"> <div class="container"> <div class="headline"> <div class="h1"> <a href="@productUrl&ProductID=@dw_bundleProduct.ID"> @productBundle.BundleName </a> </div> </div> <div class="ex"> <div class="row"> @foreach (var bundleProduct in productBundle.Products) { var dw_bundleProductItem = Dynamicweb.eCommerce.Products.Product.GetProductByID(bundleProduct.ProductId); var bid = dw_bundleProductItem.ID; //var bImage = dw_bundleProductItem.ImageSmall; var bImage = ""; var supplierSku = dw_bundleProductItem.ProductFieldValues.GetProductFieldValue("suppliersku"); if (supplierSku.HasValue) { var domain = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority); bImage = string.Format("/Files/Images/Ecom/Products/{0}_1.jpg", dw_bundleProductItem.Number); } if (bImage.IsNullOrEmpty()) { bImage = "/Files/Images/Ecom/missing_image.jpg"; } var bName = dw_bundleProductItem.Name; var bDescription = dw_bundleProductItem.ShortDescription; var bDiscount = dw_bundleProductItem.Discounts.HasDiscounts; var bPrice = dw_bundleProductItem.Price.PriceWithVATFormatted; totalPrice += dw_bundleProductItem.Price.PriceWithVAT; var burl = Pageview.Area.Item["ProductPage"] + "?ProductId=" + bid; <div class="col-md-3 col-xs-12"> <figure class="@(productBundle.Products.IndexOf(bundleProduct) == productBundle.Products.Count - 1 ? "" : "plus")"> <div class="image" style="background-image:url('@bImage')"></div> <div class="title"><a href="@burl">@bName</a></div> <div class="price"> @if (bDiscount) { <small>@dw_bundleProductItem.Discounts.Price.PriceWithVATFormatted</small> }@bPrice </div> </figure> </div> } <div class="col-md-3 col-xs-12"> <figure class="buy-all"> <div> <div> <span class="price old">@Dynamicweb.eCommerce.Common.Context.Currency.Format(totalPrice, true)</span> <span class="price">@dw_bundleProduct.Price.PriceWithVATFormatted</span> <a href="#" class="btn btn-black" id="btnsubmit-@dw_bundleProduct.ID" data-productId="@dw_bundleProduct.ID" onclick="AddBundleToCart(this);"> @Translate("Add bundle to cart", "Læg alle i kurv") <i class="fa fa-cart-plus"></i> </a> </div> </div> </figure> </div> </div> </div> </div> </section> } } @{ string requestUrl = similarProductsUrl + (string.IsNullOrWhiteSpace(productid.ToString()) ? "" : "&ProductId=" + productid.ToString()); string key = Dynamicweb.Input.FormatBoolean(GetGlobalValue("Global:Extranet.UserName")) && GetGlobalValue("Global:Extranet.Groups").Contains("364") ? "vip" : "simple"; string widget = WebRequestExtensions.ExecuteWebRequest(string.Format("{0}{1}", widgetDomain, requestUrl), key); } @Raw(widget) @{ var recentproductgroup = GetLoop("eCom:Related.YouHaveSeenTheseProducts").OrderByDescending(g => g.GetString("Ecom:Product.LoopCounter")).Take(4).ToList(); } @if (recentproductgroup.Count() > 0) { if (recentproductgroup.Count() > 4) { recentproductgroup = recentproductgroup.Take(4).ToList(); } <section class="products"> <div class="container"> <div class="headline"> <div class="h1"> @Translate("Recently viewed items", "Recently viewed items") </div> </div> <div class="owl-carousel"> @foreach (var product in recentproductgroup) { <div class="item"> @RenderProduct(product) </div> } </div> </div> </section> } @{ string cutomersPrtoductsRequestUrl = customersProductsUrl + (string.IsNullOrWhiteSpace(productid.ToString()) ? "" : "&ProductId=" + productid.ToString()); string customersProductsKey = Dynamicweb.Input.FormatBoolean(GetGlobalValue("Global:Extranet.UserName")) && GetGlobalValue("Global:Extranet.Groups").Contains("364") ? "vip" : "simple"; string customersWidget = WebRequestExtensions.ExecuteWebRequest(string.Format("{0}{1}", widgetDomain, cutomersPrtoductsRequestUrl), customersProductsKey); } @Raw(customersWidget) @functions { public List<string> GetSlideImages() { var resultImgs = new List<string>(); var domain = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority); for (int i = 1; i <= 12; i++) { var url = string.Empty; try { //url = string.Format("/Files/Images/Ecom/Products/{0}_{1}.jpg", GetValue("Ecom:Product.Number"), i.ToString()); url = string.Format("https://res.cloudinary.com/belugi/t_detail/{0}_{1}.jpg", GetValue("Ecom:Product.Number"), i.ToString()); var request = (HttpWebRequest)WebRequest.Create(url); request.Timeout = 1000; request.Method = "HEAD"; var response = (HttpWebResponse)request.GetResponse(); if (response.StatusCode != HttpStatusCode.NotFound) { resultImgs.Add(url); } response.Close(); } catch { } } if (resultImgs.Count == 0) { resultImgs.Add("/Files/Images/Ecom/Products/empty.jpg"); } return resultImgs; } }