Exception in template (Designs\Inox\eCom/Productlist/ProductList.cshtml): System.FormatException: Input string was not in a correct format.
   at System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt)
   at System.Double.Parse(String s, NumberStyles style, NumberFormatInfo info)
   at CompiledRazorTemplates.Dynamic.cdfcaeddf.<>c__DisplayClass5.b__4(TextWriter __razor_helper_writer)
   at RazorEngine.Templating.TemplateWriter.WriteTo(TextWriter writer)
   at RazorEngine.Templating.TemplateBase.WriteTo(TextWriter writer, TemplateWriter helper)
   at CompiledRazorTemplates.Dynamic.cdfcaeddf.b__7(TextWriter __razor_helper_writer)
   at RazorEngine.Templating.TemplateWriter.WriteTo(TextWriter writer)
   at RazorEngine.Templating.TemplateBase.Write(TemplateWriter helper)
   at CompiledRazorTemplates.Dynamic.cdfcaeddf.Execute()
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context)
   at RazorEngine.Templating.TemplateService.Run(ITemplate template, DynamicViewBag viewBag)
   at RazorEngine.Templating.TemplateService.Parse(String razorTemplate, Object model, DynamicViewBag viewBag, String cacheName)
   at RazorEngine.Razor.Parse[T](String razorTemplate, T model, String cacheName)
   at Dynamicweb.Rendering.Template.Output()
@inherits RazorTemplateBase<RazorTemplateModel<Template>> @using Dynamicweb; @using Dynamicweb.Rendering; @using Inox.Logic.Helpers; @using Dynamicweb.Admin.dk.dynamicweb.templates @helper Filters() { if (GetLoop("Subgroups").Count == 0) { <div class="sidebar"> <div class="filters-toggler btn btn--icon-left"> <svg role="img"><use xlink:href="/Files/Templates/Designs/Inox/static/dist/icons.svg#filter"></use></svg> Filter <div class="close"> <svg role="img"><use xlink:href="/Files/Templates/Designs/Inox/static/dist/icons.svg#close"></use></svg> </div> </div> <div class="filters-wrapper"> <div class="small-headline hidden-xs hidden-sm"> @Translate("Filters", "Filter") </div> <form name="filters" id="filters" action="" method="get"> @foreach (var facetGroup in GetLoop("FacetGroups")) { foreach (var facet in facetGroup.GetLoop("Facets")) { if (facet.GetInteger("Facet.OptionWithResultCount") > 0) { string translateFilterString = "facetName_" + @GetString("Ecom:Group.ID")+ "_" + @facet.GetString("Facet.Name").Replace(" ", "_"); <select name="@facet.GetString("Facet.QueryParameter")" class="selector" multiple data-title="@Translate(translateFilterString,facet.GetString("Facet.Name"))" data-trigger-icon='<svg role="img"><use xlink:href="/Files/Templates/Designs/Inox/static/dist/icons.svg#arrow-down"></use></svg>' data-remove-icon='<svg role="img"><use xlink:href="/Files/Templates/Designs/Inox/static/dist/icons.svg#close"></use></svg>'> <optgroup disabled></optgroup> @foreach (var facetOption in facet.GetLoop("FacetOptions")) { string facetOptionCount = facetOption.GetString("FacetOption.Count"); string facetOptionCountDisabled = facetOption.GetInteger("FacetOption.Count") == 0 ? "disabled" : string.Empty; string facetOptionName = facetOption.GetString("FacetOption.Name"); string facetOptionSelected = facetOption.GetBoolean("FacetOption.Selected") ? "selected" : string.Empty; string facetOptionNameFormatted = facetOptionName.Replace("_", "/").Replace("£", "\""); <option @facetOptionCountDisabled value="@facetOptionName" @facetOptionSelected> @facetOptionNameFormatted (@facetOptionCount) </option> } </select> } } } <div class="filters-reset">@Translate("Reset", "Nulstil")</div> </form> </div> </div> } } @helper FacetNameTranslate(string facetName) { string value = facetName; if (Pageview.Area.ID == 2) { switch (facetName) { case "Kvalitet": value = "Grade"; break; case "Profil": value = "Profile"; break; case "Udførsel 1": value = "Execution 1"; break; case "Udførsel 2": value = "Execution 2"; break; case "Norm": value = "Standard"; break; default: break; } } @value } @inherits RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Template>> @using Dynamicweb.Rendering @inherits RazorTemplateBase<RazorTemplateModel<Template>> @using Dynamicweb.eCommerce.Products @using Dynamicweb.Rendering @using Firstweb.OrderTemplate @helper RenderProduct(LoopItem product) { string userName = GetGlobalValue("Global:Extranet.UserName"); string message = Translate("ThisDemandsALogIn", "Dette kræver at du logger ind"); string customerProductNumber = Inox.Website.CustomCode.FrontendHelpers.CustomerProductNumber.GetCustomerProductNumber(product.GetString("Ecom:Product.ID")); string productId = product.GetString("Ecom:Product.ID"); string defaultUnit = (product.GetString("Ecom:Product.DefaultUnitID") == product.GetString("Ecom:Product:Field.ProductUnitConvertFromUnit.Value") ? "from" : "to"); double convertFactor = double.Parse(Pageview.AreaID != 1 ? product.GetString("Ecom:Product:Field.ProductUnitConvertFactor.Value").Replace(",", ".") : product.GetString("Ecom:Product:Field.ProductUnitConvertFactor.Value")); var stockLevel = product.GetInteger("Ecom:Product.Stock"); bool showUnitOptions = product.GetString("Ecom:Product:Field.ProductLevel1.Value") != "F" && product.GetString("Ecom:Product:Field.ProductLevel2.Value") != "R_SV" && product.GetString("Ecom:Product:Field.ProductLevel2.Value") != "R_ME" && product.GetString("Ecom:Product:Field.ProductLevel2.Value") != "R_SM" && product.GetString("Ecom:Product:Field.ProductLevel2.Value") != "R_DE" && product.GetString("Ecom:Product:Field.ProductLevel2.Value") != "R_OVERSKUD" && product.GetString("Ecom:Product:Field.ProductLevel2.Value") != "RP"; string otid = Dynamicweb.Base.Request("otid"); bool hasOtid = otid != null; string hasOtidClass = hasOtid ? "products-list--ot" : ""; string ecomProductLoopCounter = product.GetString( "Ecom:Product.LoopCounter" ); string productLoopCounter = "ProductLoopCounter" + ecomProductLoopCounter; string productIdCounter = "ProductID" + ecomProductLoopCounter; string quantityCounter = "Quantity" + ecomProductLoopCounter; <input type="hidden" name="@productLoopCounter" id="@productLoopCounter" value="@ecomProductLoopCounter" /> <input type="hidden" name="@productIdCounter" id="@productIdCounter" value="@product.GetString("Ecom:Product.ID")" /> <ul class="products-list__table__row products-list__product @hasOtidClass" id="line-@productId" data-productid="@productId" itemscope itemtype="http://schema.org/Product"> <li class="products-list__table__cell number" itemprop="mpn"> <a href="@product.GetString("Ecom:Product.LinkGroup.Clean")" itemprop="mpn"> <strong> @product.GetString("Ecom:Product.Number") @if (product.GetString("Ecom:Product.Price.Price") != "0,00") // GetDouble("Ecom:Product.Price.Price") returnerer ingen pris nÃ¥r pris>=1000!!! MÃ¥ske pga. space i prisen: "1 387,95" { string currencyCode = product.GetString("Ecom:Product.Price.Currency.Code"); string unitId = product.GetString("Ecom:Product.DefaultUnitID").ToLower(); string price = String.Format(new System.Globalization.CultureInfo("da-DK"), "{0:#,##0.00}", product.GetDouble("Ecom:Product.Price.PricePIP") / 100); <div> <strong>@price</strong> @currencyCode/@Translate(unitId, unitId).ToUpper() </div> } </strong> </a> </li> <li class="products-list__table__cell description" id="product-description-@productId" itemprop="description"> <a href="@product.GetString("Ecom:Product.LinkGroup.Clean")" itemprop="description"> @product.GetString("Ecom:Product.ShortDescription") @if (stockLevel <= 0 && !string.IsNullOrEmpty(userName)) { <div class="stock-message color-primary"> @product.GetString("Ecom:Product:Field.StockStatusText.Value") </div> } @if (!string.IsNullOrEmpty(userName)) { if (customerProductNumber.Any()) { <a href="#" data-productid="@productId" data-customerproductnumber="@customerProductNumber" class="products-list__customer-number js-customer-product-number"><i class="bi bi-pencil-square me-1"></i> @customerProductNumber</a> } else { <a href="#" data-productid="@productId" class="products-list__customer-number js-customer-product-number"><i class="bi bi-plus-square me-1"></i> @Translate("CustomerProductNumber.AddOwnNumber", "Add own number")</a> } } </a> </li> @if (hasOtid) { double otQty = OrderTemplates.Instance().GetTemplateLineQuantity(otid, productId); if (!showUnitOptions) { // Displaying an empty cell, to make sure the tables align <div class="products-list__table__cell"></div> } <div class="products-list__buy__amount"> <div class="products-list__buy__amount__unit"> @(showUnitOptions ? product.GetString("Ecom:Product:Field.ProductUnitConvertFromUnit.Value") : product.GetString("Ecom:Product.DefaultUnitID")) </div> <input name="@quantityCounter" id="quantity_@product.GetValue("Ecom:Product.ID")" type="number" value="@otQty" required min="1" step="any"> </div> if (showUnitOptions) { <div class="products-list__buy__converted"> <div class="products-list__buy__converted__unit"> @product.GetString("Ecom:Product:Field.ProductUnitConvertToUnit.Value") </div> <input id="quantity_@product.GetValue("Ecom:Product.ID")-convert" type="number" min="0" step="any" step="1" data-convert-factor="@convertFactor"> </div> } } <li class="products-list__table__cell favorite"> @if (hasOtid) { <a href="#" data-productid="@productId" class="js-remove-from-favorite"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-trash text-danger" viewBox="0 0 16 16"> <path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z"/> <path fill-rule="evenodd" d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z"/> </svg> </a> } else { <a href="#" data-productid="@productId" data-tooltip="@message" class="js-add-to-favorite"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-star" viewBox="0 0 16 16"> <path d="M2.866 14.85c-.078.444.36.791.746.593l4.39-2.256 4.389 2.256c.386.198.824-.149.746-.592l-.83-4.73 3.522-3.356c.33-.314.16-.888-.282-.95l-4.898-.696L8.465.792a.513.513 0 0 0-.927 0L5.354 5.12l-4.898.696c-.441.062-.612.636-.283.95l3.523 3.356-.83 4.73zm4.905-2.767-3.686 1.894.694-3.957a.565.565 0 0 0-.163-.505L1.71 6.745l4.052-.576a.525.525 0 0 0 .393-.288L8 2.223l1.847 3.658a.525.525 0 0 0 .393.288l4.052.575-2.906 2.77a.565.565 0 0 0-.163.506l.694 3.957-3.686-1.894a.503.503 0 0 0-.461 0z"/> </svg> </a> } </li> <li class="products-list__table__cell buy"> <a href="#" data-tooltip="@message"> <svg role="img"><use xlink:href="/Files/Templates/Designs/Inox/static/dist/icons.svg#basket"></use></svg> </a> <div class="products-list__buy @(showUnitOptions ? "products-list__buy--convertible" : "")"> @if (!hasOtid) { <div class="products-list__buy__amount"> <div class="products-list__buy__amount__unit"> @(showUnitOptions ? product.GetString("Ecom:Product:Field.ProductUnitConvertFromUnit.Value") : product.GetString("Ecom:Product.DefaultUnitID")) </div> <input name="quantity" id="quantity_@product.GetValue("Ecom:Product.ID")" type="number" value="@(showUnitOptions ? Math.Round(convertFactor) : 1)" required min="1" step="any"> </div> if (showUnitOptions) { <div class="products-list__buy__converted"> <div class="products-list__buy__converted__unit"> @product.GetString("Ecom:Product:Field.ProductUnitConvertToUnit.Value") </div> <input id="quantity_@product.GetValue("Ecom:Product.ID")-convert" type="number" min="0" step="any" step="1" data-convert-factor="@convertFactor"> </div> } } <div class="products-list__buy__button"> <div class="btn btn--big btn--secondary-color btn--icon-right" onclick="AddToCart(event, '@product.GetValue("Ecom:Product.ID")', '@product.GetValue("Ecom:Product.VariantID")', '', '@product.GetString("Ecom:Product.LanguageID")');"> <span> @Translate("AddToBasket", "LÆG I KURV") </span> <svg role="img"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/Files/Templates/Designs/Inox/static/dist/icons.svg#basket"></use></svg> </div> </div> </div> </li> <!-- Only print "true"-class on element below if product is in stock --> <li class="products-list__table__cell stock @(stockLevel > 0 ? "true" : "")" itemprop="offers" itemscope itemtype="http://schema.org/Offer"> @if (stockLevel > 0) { <link itemprop="availability" href="http://schema.org/InStock"/> <!-- only print this if product is in stock --> <svg role="img"><use xlink:href="/Files/Templates/Designs/Inox/static/dist/icons.svg#check"></use></svg> } </li> @*<li class="products-list__table__cell button"> <a href="@product.GetString("Ecom:Product.LinkGroup.Clean")" itemprop="url"><svg role="img"><use xlink:href="/Files/Templates/Designs/Inox/static/dist/icons.svg#arrow-right"></use></svg></a> </li>*@ </ul> } @helper ProductList() { string otid = Dynamicweb.Base.Request("otid"); bool hasOtid = otid != null; if (GetLoop("Subgroups").Count == 0 && GetLoop("Products").Any()) { <div class="products-list"> <div class="products-list__table"> <ul class="products-list__table__row products-list__table__header small-headline"> <li class="products-list__table__cell number" itemprop="mpn">@Translate("No", "Nr")</li> <li class="products-list__table__cell description" itemprop="description">@Translate("Description", "Beskrivelse")</li> @if (hasOtid) { <li class="products-list__table__cell"></li> <li class="products-list__table__cell"></li> } <li class="products-list__table__cell favorite"></li> <li class="products-list__table__cell buy"></li> <li class="products-list__table__cell stock">@Translate("Stock", "Lager")</li> </ul> <div class="products-list__table__body"> @foreach (LoopItem product in GetLoop("Products")) { @RenderProduct(product) } </div> </div> <div class="products-list__more"> @{ string productListNextPage = GetString("Ecom:ProductList.NextPage.Clean"); string productListPrevPage = GetString("Ecom:ProductList.PrevPage.Clean"); } @if (productListPrevPage != string.Empty) { <a href="@productListPrevPage" class="btn btn--icon-left"> <svg role="img"><use xlink:href="/Files/Templates/Designs/Inox/static/dist/icons.svg#arrow-left"></use></svg> @Translate("Previous", "Forrige") </a> } @foreach (LoopItem page in GetLoop("Ecom:ProductList.Pages")) { string productListPageNumber = page.GetString("Ecom:ProductList.Pages.Page.Number"); string productListPageUrl = page.GetString("Ecom:ProductList.Pages.Page.Url"); if (page.GetBoolean("Ecom:ProductList.Pages.Page.IsCurrent")) { <span class="products-list__more__page products-list__more__page--active"> @productListPageNumber </span> } else { <a class="products-list__more__page" href="@productListPageUrl"> @productListPageNumber </a> } } @if (productListNextPage != string.Empty) { <a href="@productListNextPage" class="btn btn--icon-right"> @Translate("Next", "Næste") <svg role="img"><use xlink:href="/Files/Templates/Designs/Inox/static/dist/icons.svg#arrow-right"></use></svg> </a> } </div> </div> } else { @Translate("OrderTemplate:NoProductInOrderTemplate", "Der er ingen produkter i den valgte favoritliste") } } <input type="hidden" id="groupid" value="@GetString("Ecom:Group.ID")" /> <!--<section class="text-row"> <div class="wrap wrap-padding"> <div class="text-row__background"> <img src="data:image/svg+xml;base64,PHN2ZyBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pbiIgdmlld0JveD0iMCAwIDgyMCA1NDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGc+PHBhdGggZD0iTSA0NTEuOTA0MyA1Mi4yMTEyIEwgNDkwLjU2NDEgLTAuOTIyOSBMIDQwOS44NzI5IC0wLjI3NyBMIDQ1MS45MDQzIDUyLjIxMTIgWiIgZmlsbD0iIzMzMzMzMyIvPjxwYXRoIGQ9Ik0gLTEwLjAzMTcgNjgyLjA2NzQgTCA0MDkuODcyOSAxMTAuMDI5OCBMIDgyMS43Nzk4IDY4Mi4wNjc0IEwgODc5LjU5OTEgNjQyLjcwMTMgTCA0NTEuOTA0MyA1Mi4yMTEyIEwgNDA5Ljg3MjkgLTAuMjc3IEwgMzI4Ljg1MDggLTEuMDQ1NSBMIDM2Ny44NDE0IDUyLjIxMTIgTCAtNjIuNTE5NSA2NDIuNzAxMyBMIC0xMC4wMzE3IDY4Mi4wNjc0IFoiIGZpbGw9InJnYmEoMCwwLDAsLjEpIi8+PC9nPjwvc3ZnPg==" alt=""> </div> <div class="text-row__content"> <h1>@GetString("Ecom:Group.Name")</h1> @GetString("Ecom:Group.Description") </div> </div> </section>--> <section class="content-wrapper"> <div class="wrap wrap-padding"> @RenderSnippet("sidebarparents") <h1 class="hidden-md hidden-lg">@GetString("Ecom:Group.Name")</h1> </div> </section> <div class="content-wrapper products-list-wrapper"> <div class="wrap wrap-padding"> <div class="row"> <div class="col-md-3"> @Filters() </div> <div class="col-md-9"> <div class="content"> @ProductList() </div> </div> </div> </div> </div>