Handlekurv
Henter ordrelinjer...
Tomt billede
Varenummer: Antall: 1 Pris: 1.050.00 DKK NOK
NOK
Pris ekskl. moms 1.239,20 DKK NOK Pris i alt NOK
Error executing template "Designs/IBH/eCom/Product/PDP.cshtml"
System.Exception: URL index rebuild timed out. It took more than 10 s to build the index.
   at Dynamicweb.Frontend.UrlHandling.UrlIndex.AwaitIndexBuild()
   at Dynamicweb.Frontend.SearchEngineFriendlyURLs.ResolveQueryString(String fullQueryString, Int32 pageid, String alternatekey)
   at Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(Int32 pageID, String alternatekey)
   at NORRIQ.Common8.Context.PageNavigationTag.GetUrlFromNavigationTag(String navigationTag)
   at NORRIQ.Common8.Razor.Navigation.GetUrlByNavigationTag(String navigationTag)
   at CompiledRazorTemplates.Dynamic.RazorEngine_04b5241e149f419d8b44ebe22a3bbed7.Execute() in E:\Solutions\IBH\Web\Live\Files\Templates\Designs\IBH\eCom\Product\PDP.cshtml:line 919
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @using System.Globalization 2 @using NORRIQ.Common8.Razor; 3 @using System.Linq 4 @using Dynamicweb.Core 5 @using Dynamicweb.Ecommerce.Discounts 6 @using Dynamicweb.Ecommerce.Products 7 @using NORRIQ.Common8.Factory 8 @using NLWI.Platforms.Dynamicweb9.Specs; 9 @using StandardWebshop.CustomCode.Razor; 10 @using StandardWebshop.CustomCode.CustomLogin.Branding.Service; 11 @using StandardWebshop.CustomCode.Ecom.Stock 12 @using NORRIQ.Common8.Caching 13 @using NORRIQ.PcSysConnector.StockUpdate 14 @using Discount = Dynamicweb.Ecommerce.Orders.Discounts.Discount 15 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 16 @{ 17 // The following line will prepare specs for both WhatAboutTheeseProducts and current product combining 5 sql to 1 18 ObjectFactory.GetInstance<NLWI.Platforms.Dynamicweb9.Specs.Services.IProductSpecificationService>().GetProductSpecifications(new HashSet<long>( 19 GetLoop("eCom:Related.WhatAboutTheseProducts").Take(4).Select(a => a.GetLong("NIQ:ProductAutoId")).Concat(new[] { GetLong("NIQ:ProductAutoId") }) 20 )); 21 22 var specs = this.GetProductSpecifications(); 23 var images = specs.GetAllByKey("Billeder"); 24 var imageAlt = specs.GetByKey("ProductName").Value + ", " + specs.GetByKey("Brand").Value + ", " + specs.GetByKey("Designer").Value; 25 var priceForContent = GetString("NIQ:PriceForGoogle"); 26 27 var currency = GetString("Ecom:Product.Price.Currency.Code"); 28 // Soldout / Limited supply 29 // The point here is to provide IBH with a way of quickly managing the state of a product 30 // without doing a full import from XPI. The stockNumber, soldOut and limitedSupply variables are used as follows: 31 // 1) If stockNumber is less and 1, or the soldOut flag is true, the product cannot be bought. 32 // 2) If the limitedSupply flag is set, the user will be notified of a limited supply, but the product can still be bought. 33 // These 3 variables are all reset when doing a full import from XPI (Done via NLWI sync activities). 34 35 var deliveryTimeValue = specs.GetByKey("LeveringsTid").GetReferenceSpecification().GetByKey("Id").Value; 36 var isOrderingProduct = deliveryTimeValue.IndexOf("bestil", StringComparison.CurrentCultureIgnoreCase) > -1; 37 38 var stockState = this.GetStockState(); 39 var soldOut = (this.IsSoldOut() || stockState == StockState.OutOfStock || stockState == StockState.NoStockLocation); 40 41 //var soldOut = (string.Equals(GetString("Ecom:Product:Field.Soldout.Value"), "true", StringComparison.OrdinalIgnoreCase) || stockNumber < 1) && !isOrderingProduct; 42 var limitedSupply = this.IsLimitedSupply() || stockState == StockState.FewInStock; 43 44 // CAS-25416-T2M8Z7: Projekt: Lagerstyring IBH online 45 // NAV has the ability to override the stocklevel from XPI. As such, if the custom field "" on a product contains 46 // data, that data should be displayed, and stock messages from XPI should be hidden. 47 var stockFromNav = string.Equals(GetString("Ecom:Product:Field.StockPhase"), "L", StringComparison.OrdinalIgnoreCase); 48 var stockPhaseDescription = GetString("Ecom:Product:Field.StockPhaseDesc"); 49 var doNotIncludeSpecsList = new List<string> { "BrandLink", "BrandText", "BrandBanner", "Str_guide", "Leveringstid" }; 50 51 52 var giftlistLink = NORRIQ.Common8.Razor.Navigation.GetUrlByNavigationTag("edit-giftlist"); 53 54 List<Product> moreSaleProducts = this.GetMoreSaleProducts(specs.GetAllByKey("MoreSaleProducts").ToList(), Pageview.Area.EcomShopId); 55 56 var productUrl = this.GetProductUrl(); 57 var prettyUrl = this.GetPrettyProductUrl(); 58 var barcode = @specs.GetByKey("Barcode").Value; 59 60 var filteredSpecs = specs.GetByGroup("Produkt detaljer").GroupBy(a => a.Key).Where(i => i.Key != "Barcode" && !doNotIncludeSpecsList.Contains(i.Key) && !string.Equals(i.Key, "ProductUSP", StringComparison.InvariantCultureIgnoreCase)); 61 var specsToSkipLabels = specs.GetByKey("SkjulLabelPaaWeb").Value.Split(';'); 62 63 var deliveryTime = specs.GetByGroup("Produkt detaljer").GroupBy(a => a.Key).FirstOrDefault(x => x.Key == "Leveringstid"); 64 } 65 66 <div class="container"> 67 @DwCaching.CacheByPage("breadcrumb.xslt" + GetLong("NIQ:ProductAutoId"), () => RenderNavigation(new {Template = "Breadcrumb.xslt", Expandmode = "all", StartLevel = 1, EndLevel = 5})) 68 <section class="pdp" itemscope="" itemtype="https://schema.org/Product"> 69 <meta itemprop="productID" content="@GetString("Ecom:Product.ID")"/> 70 @if (!barcode.IsNullOrEmpty()) 71 { 72 <meta itemprop="sku" content="@barcode"/> 73 } 74 75 <div class="pdp-images"> 76 <div class="pdp-images-inner"> 77 @if (!isOrderingProduct || specs.GetByKey("LeveringsTid").GetReferenceSpecification().GetByKey("Id").Value == "Udsolgt" || !string.IsNullOrWhiteSpace(specs.GetByKey("BobbelTekst").Value)) 78 { 79 <span class="pdp-bobbeltekst"> 80 @if (!isOrderingProduct) 81 { 82 if (soldOut) 83 { 84 <span class="pdp-label">@Translate("Soldtout", "Udsolgt")</span> 85 } 86 @*else if (limitedSupply) 87 { 88 <span class="pdp-label">@Translate("LImitedSupply", "Begrænset antal")</span> 89 }*@ 90 else if (!string.IsNullOrEmpty(stockPhaseDescription)) 91 { 92 @* Do not show anything as the XPI stock status should not be displayed when the stock is controlled by NAV. *@ 93 } 94 } 95 96 @if (specs.GetByKey("LeveringsTid").GetReferenceSpecification().GetByKey("Id").Value == "Udsolgt") 97 { 98 <span class="pdp-label">@specs.GetByKey("Leveringstid").Value</span> 99 } 100 101 else if (string.Equals(specs.GetByKey("BobbelTekst").Value, "#")) 102 { 103 @* Do not show anything because "#" means that nothing should be showed (This is an XPI fix because it is not possible to delete values from XPI via the Excel import) *@ 104 } 105 else if (!string.IsNullOrWhiteSpace(specs.GetByKey("BobbelTekst").Value)) 106 { 107 <span class="pdp-label">@specs.GetByKey("BobbelTekst").Value</span> 108 } 109 </span> 110 } 111 112 @if (images.Any()) 113 { 114 var firstImage = images.First().Value; 115 if (images.Count() > 1) 116 { 117 <div class="pdp-images-thumbs" id="pdp-thumbs"> 118 <div class="pdp-thumb"> 119 <img src="@Pageview.CdnWrap(string.Format("/Admin/Public/GetImage.ashx?Image=/Files/Images/XPI/{0}&amp;Width=90&amp;Height=90&amp;Crop=5&amp;Compression=90", firstImage))" 120 class="img-fluid" 121 alt="@imageAlt"/> 122 </div> 123 @foreach (var image in images.Skip(1)) 124 { 125 <div class="pdp-thumb"> 126 <img src="@Pageview.CdnWrap(string.Format("/Admin/Public/GetImage.ashx?Image=/Files/Images/XPI/{0}&amp;Width=90&amp;Height=90&amp;Crop=5&amp;Compression=90", image.Value))" 127 class="img-fluid" 128 alt="@imageAlt"/> 129 </div> 130 } 131 </div> 132 <div class="pdp-images-view" id="pdp-images"> 133 <a href="@Pageview.CdnWrap(string.Format("/Admin/Public/GetImage.ashx?Image=/Files/Images/XPI/{0}&amp;Width=1200&amp;Crompression=90", firstImage))" 134 class="pdp-image" 135 data-fancybox="images" 136 data-caption="@imageAlt" 137 data-options='{"infobar": false, "animationEffect": false, "buttons":["zoom","close"]}'> 138 <img src="@Pageview.CdnWrap(string.Format("/Admin/Public/GetImage.ashx?Image=/Files/Images/XPI/{0}&amp;Width=500&amp;Height=500&amp;Crop=5&amp;Compression=90", firstImage))" 139 class="img-fluid" 140 itemprop="image" 141 alt="@imageAlt"/> 142 </a> 143 @foreach (var image in images.Skip(1)) 144 { 145 <a href="@Pageview.CdnWrap(string.Format("/Admin/Public/GetImage.ashx?Image=/Files/Images/XPI/{0}&amp;Width=1200&amp;Crompression=90", image.Value))" 146 class="pdp-image" 147 data-fancybox="images" 148 data-caption="@imageAlt" 149 data-options='{"infobar": false, "animationEffect": false, "buttons":["zoom","close"]}'> 150 <img src="@Pageview.CdnWrap(string.Format("/Admin/Public/GetImage.ashx?Image=/Files/Images/XPI/{0}&amp;Width=500&amp;Height=500&amp;Crop=5&amp;Compression=90", image.Value))" 151 class="img-fluid" 152 alt="@imageAlt"/> 153 </a> 154 } 155 </div> 156 } 157 else 158 { 159 <a href="@Pageview.CdnWrap(string.Format("/Admin/Public/GetImage.ashx?Image=/Files/Images/XPI/{0}&amp;Width=1200&amp;Compression=90", images.First().Value))" 160 class="pdp-image-lg" 161 data-fancybox 162 data-caption="@imageAlt" 163 data-options='{"infobar": false, "animationEffect": false, "buttons":["zoom","close"]}'> 164 <img src="@Pageview.CdnWrap(string.Format("/Admin/Public/GetImage.ashx?Image=/Files/Images/XPI/{0}&amp;Width=500&amp;Height=500&amp;Crop=5&amp;Compression=90", images.First().Value))" 165 class="img-fluid" 166 itemprop="image" 167 alt="@imageAlt"/> 168 </a> 169 } 170 } 171 </div> 172 173 </div> 174 <div class="pdp-details"> 175 <div class="pdp-details-main"> 176 <p class="pdp-brand" itemprop="brand"> 177 @{ 178 var brandPage = specs.GetByKey("Product_brandpage"); 179 180 if (brandPage == null || string.IsNullOrEmpty(brandPage.Value)) 181 { 182 @GetString("Ecom:Product:Field.Brand") 183 } 184 else 185 { 186 <a href="@brandPage.Value"> 187 @GetString("Ecom:Product:Field.Brand") 188 </a> 189 } 190 } 191 </p> 192 <h1 class="pdp-name" itemprop="name"> 193 @GetString("Ecom:Product.Name") 194 </h1> 195 <div class="pdp-prices" itemprop="offers" itemscope itemtype="https://schema.org/Offer"> 196 <meta itemprop="url" content="@prettyUrl"/> 197 @if ((!soldOut && stockState == StockState.InStock) || stockState == StockState.NotTracked) 198 { 199 <link itemprop="availability" href="https://schema.org/InStock"/> 200 } 201 202 @if (soldOut && stockState == StockState.OutOfStock) 203 { 204 <link itemprop="availability" href="https://schema.org/OutOfStock"/> 205 } 206 207 208 209 @{ 210 var currencyCode = Pageview.Area.EcomCurrencyId; 211 var price = GetDouble("Ecom:Product.Discount.Price." + 212 "PriceWithVAT" + 213 ".Value"); 214 var priceWithVat = GetDouble("Ecom:Product.Price.PriceWithVAT.Value"); 215 var beforePrice = GetString("Ecom:Product:Field.Beforeprice.Value"); 216 var isDiscount = priceWithVat != price; 217 } 218 219 @if (isDiscount || beforePrice.IsNotNullOrEmpty()) 220 { 221 222 <span class="pdp-org-price"> 223 <span>@Translate("Before price", "Før ")</span> 224 @if (isDiscount) 225 { 226 <span> 227 @priceWithVat.ToString("N2") 228 </span> 229 } 230 else 231 { 232 <span> 233 @beforePrice 234 </span> 235 } 236 <span>@currencyCode</span> 237 </span> 238 <span class="pdp-list-price"> 239 <span>@Translate("After price", "Nu")</span> <span itemprop="price" content="@priceForContent">@price.ToString("N2")</span> <span itemprop="priceCurrency">@currencyCode</span> 240 </span> 241 } 242 else 243 { 244 <span class="pdp-list-price"> 245 <span itemprop="price" content="@priceForContent">@price.ToString("N2")</span> <span itemprop="priceCurrency" content="@currencyCode">@currencyCode</span> 246 </span> 247 } 248 </div> 249 <div class="pdp-buying"> 250 @{ 251 var canBuy = (!soldOut && deliveryTimeValue != "FremtidigKoeb") || isOrderingProduct; 252 } 253 @if (stockState != StockState.NotTracked) 254 { 255 if (limitedSupply) 256 { 257 <span class="pdp-stock-status"> 258 @Translate("Få på lager") 259 </span> 260 } 261 else if (stockState == StockState.InStock) 262 { 263 <span class="pdp-stock-status"> 264 @Translate("På lager") 265 </span> 266 } 267 } 268 <form class="form" data-action="addToCart" id="[email protected]("Ecom:Product:Page.ID")" name="[email protected]("Ecom:Product:Page.ID")" method="post" action="@GetGlobalValue("Global:Pageview.Url.Raw")"> 269 <input type="hidden" name="ProductURL" id="ProductURL" value="@productUrl" /> 270 <input type="hidden" name="LanguageId" id="LanguageId" value="@GetString("Ecom:Product.LanguageID")" /> 271 <input type="hidden" name="CartCmd" id="CartCmd" value="addMulti" /> 272 <input type="hidden" name="Redirect" id="Redirect" value="false" /> 273 274 <input type="hidden" name="ProductLoopCounter1" id="ProductLoopCounter1" value="1"> 275 <input type="hidden" name="ProductID1" id="ProductID1" value="@GetValue("Ecom:Product.ID")"> 276 <input type="hidden" name="VariantID1" id="VariantID1" value="@GetString("Ecom:Product.VariantID")"> 277 <input type="hidden" name="UnitID1" id="UnitID1" value="@GetString("Ecom:Product.DefaultUnitID")"> 278 <input type="hidden" name="wishListID1" id="wishListID1" value="0"> 279 280 <input type="hidden" name="custom_ProductNo" value="@GetString("Ecom:Product.Number")" /> 281 <input type="hidden" name="custom_ProductName" value="@GetString("Ecom:Product.Name")" /> 282 <input type="hidden" name="custom_ProductPrice" value="@GetDouble("Ecom:Product.Price.PriceWithVAT.Value").ToString("F2", new CultureInfo("en-US"))" /> 283 <input type="hidden" name="custom_ProductCurrency" value="@currency" /> 284 285 @if (!canBuy) 286 { 287 if (soldOut) 288 { 289 <p class="pdp-stock-status mb-0">@Translate("TemporaryUnavailable", "Varen er midlertidigt udsolgt.")</p> 290 } 291 else if (!string.IsNullOrEmpty(stockPhaseDescription)) 292 { 293 <p class="pdp-stock-status mb-0">@stockPhaseDescription</p> 294 } 295 else 296 { 297 <p class="pdp-stock-status mb-0">@specs.GetByKey("Leveringstid").Value</p> 298 } 299 } 300 <div class="pdp-select"> 301 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 302 @using StandardWebshop.CustomCode.ViewModels.Variants; 303 @{ 304 var variants = GetLoop("VariantGroups").GetVariants(); 305 // In IBH, the Product Number can be used as a unique product identifier. 306 var currentProductNumber = GetString("Ecom:Product.Number"); 307 // All variant products and their associated variant groups/options. 308 var variantProducts = GetLoop("VariantCombinations").GetVariantProducts(variants, currentProductNumber); 309 var productsDictionary = VariantViewModelBuilder.GetProductsInDimensionOrder(variants, variantProducts); 310 var selectedVariant = VariantViewModelBuilder.GetSelectedOrEmpty(variantProducts); 311 var isVariantSelected = System.Web.HttpContext.Current.Request["Selected"] != null; 312 } 313 314 @{ 315 @* These lines are required because lazy load's its data. 316 GetString("Ecom:VariantGroup.Label") 317 GetString("Ecom:VariantGroup.Name") 318 GetLoop("VariantAvailableOptions") 319 GetString("Ecom:VariantOption.ID") 320 GetString("Ecom:VariantOption.Name") 321 *@ 322 } 323 324 @* // This will display all the different variants, and highlight the one currently being viewed. 325 <h1>Test</h1> 326 <ul> 327 @foreach (var v1 in productsDictionary) 328 { 329 <li>@v1.Key.GroupName || @v1.Key.OptionId</li> 330 331 <li> 332 <ul> 333 @foreach (var v2 in v1.Value) 334 { 335 <li @(v2.Value.IsSelected ? "style='font-weight:bold'" : "")>@v2.Key.GroupName || @v2.Key.OptionId ## <a href="@v2.Value.LinkToGroup">@v2.Value.Name</a></li> 336 } 337 </ul> 338 </li> 339 } 340 </ul>*@ 341 342 @if (variants.Count == 0) 343 { 344 @* No variants *@ 345 } 346 else if (variants.Count == 1) 347 { 348 <div class="pdp-variants pdp-variants-single"> 349 <div class="form-group"> 350 <label for="variant1Selector" class="sr-only">@Translate("Choose", "Vælg") <span class="text-lowercase">@selectedVariant.Variant1.GroupLabel</span></label> 351 <select class="form-control" id="variant1Selector" data-enable-target="#buy-button"> 352 <option value="0" @(!isVariantSelected ? "selected='selected'" : "")> 353 @Translate("Choose", "Vælg") @selectedVariant.Variant1.GroupLabel 354 </option> 355 @foreach (var v1 in productsDictionary.Where(a => !string.IsNullOrEmpty(a.Key.OptionId))) 356 { 357 var isSelected = selectedVariant.Variant1.Equals(v1.Key); 358 var product = v1.Value.First(); 359 <option value="@(isSelected? "0" : v1.Key.OptionId)" @(isSelected && isVariantSelected ? "selected='selected'" : "") data-linktogroup="@product.Value.LinkToGroup">@v1.Key.OptionName</option> 360 } 361 </select> 362 </div> 363 </div> 364 } 365 else 366 { 367 368 <div class="pdp-variants pdp-variants-double"> 369 <div class="form-group"> 370 <label for="variant1Selector">@Translate("Choose", "Vælg") <span class="text-lowercase">@selectedVariant.Variant1.GroupLabel</span></label> 371 <select class="form-control" id="variant1Selector" data-enable-target="#buy-button"> 372 <option value="0"> 373 @Translate("Choose", "Vælg") @selectedVariant.Variant1.GroupLabel 374 </option> 375 @foreach (var v1 in productsDictionary.Where(a => !string.IsNullOrEmpty(a.Key.OptionId))) 376 { 377 var isSelected = selectedVariant.Variant1.Equals(v1.Key); 378 <option value="@v1.Key.OptionId" @(isSelected ? "selected='selected'" : "")>@v1.Key.OptionName</option> 379 } 380 </select> 381 </div> 382 <div class="form-group"> 383 <label for="variant2Selector">@Translate("Choose", "Vælg") <span class="text-lowercase">@selectedVariant.Variant2.GroupLabel</span></label> 384 <select class="form-control" id="variant2Selector" data-enable-target="#buy-button"> 385 <option value="0"> 386 @Translate("Choose", "Vælg") @selectedVariant.Variant2.GroupLabel 387 </option> 388 @foreach (var v1 in productsDictionary.Where(pde => pde.Key.Equals(selectedVariant.Variant1))) 389 { 390 foreach (var v2 in v1.Value.Where(a => !string.IsNullOrEmpty(a.Key.OptionId))) 391 { 392 var isSelected = selectedVariant.Variant2.Equals(v2.Key); 393 <option value="@v2.Key.OptionId" @(isSelected ? "selected='selected'" : "") data-linktogroup="@v2.Value.LinkToGroup">@v2.Key.OptionName</option> 394 } 395 } 396 </select> 397 </div> 398 </div> 399 } 400 401 <script type="text/x-jsrender" id="emptyVariant2OptionTemplate"> 402 <option value="0"> 403 @Translate("Choose", "Vælg") @selectedVariant.Variant1.GroupLabel 404 </option> 405 </script> 406 407 <script type="text/x-jsrender" id="variant2OptionTemplate"> 408 <option value="0"> 409 @Translate("Choose", "Vælg") @selectedVariant.Variant2.GroupLabel 410 </option> 411 412 {{for Products}} 413 <option value="{{:OptionId}}" data-linktogroup="{{:LinkToGroup}}">{{:OptionName}}</option> 414 {{/for}} 415 </script> 416 417 418 <script append="true"> 419 var variantData = [ 420 @for (int i = 0; i < productsDictionary.Count; i++) 421 { 422 var v1 = productsDictionary.ElementAt(i); 423 <text> 424 { 425 "GroupLabel": "@v1.Key.GroupLabel", 426 "GroupName": "@v1.Key.GroupName", 427 "OptionId": "@v1.Key.OptionId", 428 "OptionName": "@v1.Key.OptionName", 429 "Products": [ 430 @for (int j = 0; j < v1.Value.Count; j++) 431 { 432 var v2 = v1.Value.ElementAt(j); 433 <text> 434 { 435 "GroupLabel": "@v2.Key.GroupLabel", 436 "GroupName": "@v2.Key.GroupName", 437 "OptionId": "@v2.Key.OptionId", 438 "OptionName": "@v2.Key.OptionName", 439 "LinkToGroup": "@v2.Value.LinkToGroup" 440 }@(j + 1 == v1.Value.Count ? "" : ",") 441 </text> 442 } 443 ] 444 }@(i + 1 == productsDictionary.Count ? "" : ",") 445 </text> 446 } 447 ]; 448 var variantMode = '@variants.Count'; 449 var variantSelector = new AppStart.VariantSelector({ 450 $emptyVariant2OptionTemplate: $('#emptyVariant2OptionTemplate'), 451 $variant2OptionTemplate: $('#variant2OptionTemplate'), 452 $v1Selector: $('#variant1Selector'), 453 $v2Selector: $('#variant2Selector'), 454 // 0 == no variants, 1 == single variant, 2 == 2 variants. 455 variantMode: variantMode, 456 variantData: variantData 457 }); 458 459 variantSelector.init(); 460 </script> 461 462 463 </div> 464 @if (specs.GetByGroup("Produkt detaljer").Any()) 465 { 466 var sizeGuide = specs.FirstOrDefault(x => x.Key == "Str_guide"); 467 if (sizeGuide != null) 468 { 469 <div class="pdp-select"> 470 <a href="@string.Format("/Files/Images/XPI/{0}", sizeGuide.Value)" target="_blank"> 471 @Translate("Størrelsesguide") 472 </a> 473 </div> 474 } 475 } 476 <div class="pdp-select"> 477 @if (canBuy) 478 { 479 <div class="pdp-qty"> 480 <label for="Quantity1" class="sr-only">@Translate("Number", "Antal")</label> 481 <div class="pdp-qty-control"> 482 <input type="number" name="Quantity1" id="Quantity1" min="1" step="1" value="1" class="form-control" autocomplete="off" /> 483 <button type="button" class="pdp-qty-decrease"> 484 - 485 </button> 486 <button type="button" class="pdp-qty-increase"> 487 + 488 </button> 489 </div> 490 </div> 491 492 var variantSelected = !GetLoop("VariantGroups").Any() || System.Web.HttpContext.Current.Request["Selected"] != null; 493 494 <div class="pdp-button-wrapper"> 495 <div class="pdp-button"> 496 <button class="btn btn-primary btn-buying" id="buy-button" 497 role="button" 498 type="submit" 499 @(!variantSelected ? "disabled=disabled" : @variantSelected.ToString())> 500 <svg class="icon icon-xs"> 501 <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/Files/dist/icons/icons.svg#shopping"></use> 502 </svg> 503 <span class="loader loader-light loader-xs"></span> 504 <span>@Translate("Add_to_cart", "Tilføj til kurv")</span> 505 </button> 506 </div> 507 <div class="pdp-delivery-time desktop"> 508 @if (deliveryTime != null && deliveryTime.Any()) 509 { 510 <span>@Translate("Leveringstid", "Leveringstid"): @String.Join(", ", deliveryTime.Select(x => x.Value))</span> 511 } 512 </div> 513 </div> 514 } 515 else 516 { 517 <input type="hidden" name="Quantity1" id="Quantity1" value="1" /> 518 } 519 </div> 520 521 <div class="pdp-delivery-time mobile"> 522 @if (deliveryTime != null && deliveryTime.Any()) 523 { 524 <span>@Translate("Leveringstid", "Leveringstid"): @String.Join(", ", deliveryTime.Select(x => x.Value))</span> 525 } 526 </div> 527 528 @if (string.Equals(Pageview.Area.Culture, "nb-NO")) 529 { 530 <div class="add-to-gift-list"> 531 <span data-action="addToGiftList">@Translate("Add to giftlist", "Tilføj til gaveliste")</span> 532 </div> 533 <p id="giftListSuccess" class="pdp-giftlist-added" style="display: none"> 534 @Translate("Added to giftlist info", "Varen er tilføjet til din gaveliste") 535 536 <a href="@giftlistLink"> 537 @Translate("Show giftlist button", "Vis gaveliste") 538 </a> 539 </p> 540 } 541 542 @if (!canBuy) 543 { 544 <div class="pdp-button"> 545 <a data-fancybox data-src="#nostockModal" href="javascript:;" data-options='{"infobar": false, "smallBtn": false, "toolbar": false, "buttons":["close"]' class="btn btn-outline-dark btn-buying"> 546 @Translate("nostock_btn", "Giv mig besked") 547 </a> 548 </div> 549 } 550 <div id="more-sale-input-container"></div> 551 </form> 552 @if (!canBuy) 553 { 554 var usermail = Pageview.User != null ? Pageview.User.Email : string.Empty; 555 <div class="pdp-backinstock" id="nostockModal" style="display: none;"> 556 <h2 class="modal-title">@Translate("modal_nostock_heading", "Giv mig besked")</h2> 557 <p>@Translate("modal_nostock_txt", "Vi sender dig en e-mail, når denne vare igen er på lager.")</p> 558 <form name="@GetValue("Ecom:Product.ID")" method="post" class="form validation pdp-backinstock-form" role="form" action=""> 559 <input type="hidden" name="ProductID" value="@GetValue("Ecom:Product.ID")"/> 560 <input type="hidden" name="VariantID" value="@GetValue("Ecom:Product.VariantID")"/> 561 <input type="hidden" name="LanguageID" value="@GetValue("Ecom:Product.LanguageID")"/> 562 <input type="hidden" name="ProductName" value="@specs.GetByKey("ProductName").Value"/> 563 <input type="hidden" name="CartCmd" value="createnotificationforthisproduct"/> 564 <div class="form-group"> 565 <label for="NotificationEmail">@Translate("ns_email", "E-mail adresse")</label> 566 <div class="form-group-combined"> 567 <input name="NotificationEmail" id="NotificationEmail" type="email" value="@usermail" class="required form-control"> 568 <button type="submit" class="btn btn-primary btn-block">@Translate("nostocksend_btn", "Send")</button> 569 </div> 570 </div> 571 </form> 572 </div> 573 } 574 </div> 575 @{ 576 var usps = specs.GetByKey("ProductUSP"); 577 } 578 @if (!usps.Value.IsNullOrEmpty()) 579 { 580 <ul class="pdp-usp"> 581 <li class="pdp-usp-item"> 582 <span class="pdp-usp-link"> 583 <svg class="icon icon-xs"> 584 <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/Files/dist/icons/icons.svg#star"></use> 585 </svg> 586 <span> 587 @usps.Value 588 </span> 589 </span> 590 </li> 591 </ul> 592 } 593 </div> 594 <div id="pdp-details-data" class="pdp-details-data mt-3"> 595 @if (moreSaleProducts.Any()) 596 { 597 <div class="pdp-more-sales"> 598 <h3>@specs.GetByKey("MoreSaleHeadline").Value</h3> 599 600 <div class="pdp-more-sales-container"> 601 <div class="more-sale-images"> 602 @PrintMoreSaleProductImage(moreSaleProducts, imageAlt) 603 </div> 604 605 <div class="more-sale-container"> 606 @PrintMoreSaleProduct(moreSaleProducts, currencyCode) 607 </div> 608 </div> 609 </div> 610 } 611 612 <div class="pdp-accordion" data-toggle="collapse" data-target="#pdp-details" aria-expanded="true" aria-controls="pdp-details" data-parent="#pdp-details-data"> 613 <h3>@Translate("Product details", "Detaljer")</h3> 614 </div> 615 <div class="pdp-accordion-content collapse show" id="pdp-details"> 616 @if (specs.GetByGroup("Produkt detaljer").Any()) 617 { 618 <div class="pdp-specs"> 619 <ul class="pdp-specs-list"> 620 @foreach (var spec in filteredSpecs) 621 { 622 var showLabel = !specsToSkipLabels.Contains(spec.First().Key); 623 var firstSpec = spec.First(); 624 625 if (firstSpec.Key == "Link") 626 { 627 <li class="pdp-specs-item"> 628 <a href="@firstSpec.Value" target="_blank">@firstSpec.Caption</a> 629 </li> 630 } 631 else if (firstSpec.Key == "Leveringstid" && !string.IsNullOrEmpty(stockPhaseDescription)) 632 { 633 <li class="pdp-specs-item"> 634 @(showLabel ? firstSpec.Caption + ": " : "")@stockPhaseDescription 635 </li> 636 } 637 else 638 { 639 <li class="pdp-specs-item"> 640 @(showLabel ? firstSpec.Caption + ": " : "")@String.Join(", ", spec.Select(a => a.Value)) 641 </li> 642 } 643 } 644 </ul> 645 </div> 646 } 647 </div> 648 649 <div class="pdp-accordion collapsed" data-toggle="collapse" data-target="#pdp-description" aria-expanded="false" aria-controls="pdp-description" data-parent="#pdp-details-data"> 650 <h3>@Translate("Produkt beskrivelse", "Produkt beskrivelse")</h3> 651 </div> 652 <div class="pdp-accordion-content collapse" id="pdp-description"> 653 @if (!string.IsNullOrEmpty(specs.GetByKey("Beskrivelse").Value)) 654 { 655 //Read the full text. 656 var fullText = specs.GetByKey("Beskrivelse").Value; // + " " + specs.GetByKey("Beskrivelse").Value; 657 658 <div class="pdp-description" itemprop="description"> 659 <p>@fullText</p> 660 </div> 661 } 662 </div> 663 664 @if (GetBoolean("Ecom:Product:Field.VisLagerstatus")) 665 { 666 DateTime? lastWmsSyncDateTime = new StockUpdateInfo().GetLatestTimestamp(); 667 668 <div class="pdp-accordion collapsed" data-toggle="collapse" data-target="#pdp-stock-locations" aria-expanded="false" aria-controls="pdp-stock-locations" data-parent="#pdp-details-data"> 669 <h3>@Translate("Lagerstatus i butik")</h3> 670 </div> 671 <div class="pdp-accordion-content collapse" id="pdp-stock-locations"> 672 <div class="pdp-stock-locations"> 673 @{ 674 foreach (var stockLocation in this.GetStockLocations()) 675 { 676 <div class="location-name"> 677 <h6>@stockLocation.Name</h6> 678 </div> 679 <div class="pdp-stock-location"> 680 <div class="stock-column location-info"> 681 <div class="location-text"> 682 @stockLocation.Address 683 </div> 684 </div> 685 <div class="stock-column location-status"> 686 <span class="icon @stockLocation.StockLocationState"></span> 687 <span class="stock-text"> 688 @if (stockLocation.StockLocationState == StockState.FewInStock.ToString()) 689 { 690 <span class="stock-status"> 691 @Translate("Få på lager i butik") 692 </span> 693 } 694 else if (stockLocation.StockLocationState == StockState.InStock.ToString()) 695 { 696 <span class="stock-status"> 697 @Translate("På lager i butik") 698 </span> 699 } 700 else if (stockLocation.StockLocationState == StockState.OutOfStock.ToString()) 701 { 702 <span class="stock-status"> 703 @Translate("Ikke på lager i butik", "Udsolgt") 704 </span> 705 } 706 </span> 707 </div> 708 <div class="stock-column location-opening-hours"> 709 <a href="@stockLocation.Link">@Translate("Se åbningstider")</a> 710 </div> 711 </div> 712 } 713 } 714 <div class="pdp-stock-updated"> 715 @Translate("Dette er lagertal pr.") @lastWmsSyncDateTime. @Translate("Lagerstatus kan ændre sig flere gange om dagen. Tjek om varen stadig er på lager, inden du tager i butik, så du ikke går forgæves.") 716 </div> 717 </div> 718 </div> 719 } 720 </div> 721 <div class="pdp-details-foot"> 722 <p> 723 @if (!string.IsNullOrEmpty(specs.GetByKey("Barcode").Value)) 724 { 725 <span> 726 @specs.GetByKey("Barcode").Caption: @specs.GetByKey("Barcode").Value 727 </span> 728 } 729 else 730 { 731 <text>&nbsp;</text> 732 } 733 </p> 734 <p> 735 <a data-fancybox data-src="#shoppingGuide" href="javascript:;" data-options='{"infobar": false, "smallBtn": false, "toolbar": false, "buttons":["close"]'>@Translate("Need help", "Brug for hjælp?")</a> 736 </p> 737 </div> 738 </div> 739 </section> 740 @*@if (GetLoop("eCom:Related.WhatAboutTheseProducts").Any()) 741 { 742 <section class="pdp-related" id="partnerloop"> 743 <h2 class="text-center">@Translate("other_favorites_heading", "Andre favoritter")</h2> 744 <ul class="plp-list"> 745 @foreach (var product in GetLoop("eCom:Related.WhatAboutTheseProducts").Take(4)) 746 { 747 var plpSpecs = product.GetProductSpecifications(); 748 var plpImage = plpSpecs.HasKey("Billeder") ? "/Files/Images/XPI/" + plpSpecs.GetByKey("Billeder").Value : "/Files/Images/Ecom/default.jpg"; 749 var url = "/Default.aspx?ID=" + NORRIQ.Common8.Razor.Navigation.GetPageIdByNavigationTag("webshop") + "&amp;ProductID=" + product.GetString("Ecom:Product.ID.UrlEncoded"); 750 <li class="plp-list-item"> 751 <article class="plp-list-product"> 752 <a href="@url" itemprop="url" class="plp-list-url"> 753 <figure class="plp-list-image"> 754 <img src="@Pageview.CdnWrap(string.Format("/Admin/Public/GetImage.ashx?Image={0}&amp;Width=220&amp;Height=220&amp;Crop=5&amp;Compression=90", plpImage))" 755 class="img-fluid" 756 alt="@product.GetString("Ecom:Product.Name")" 757 itemprop="image" /> 758 </figure> 759 <header class="plp-list-info"> 760 <p class="plp-list-brand" itemprop="brand"> 761 @plpSpecs.GetByKey("Brand").Value 762 </p> 763 <h2 class="plp-list-name" itemprop="name"> 764 @product.GetString("Ecom:Product.Name") 765 </h2> 766 </header> 767 </a> 768 <footer class="plp-list-prices"> 769 @{ 770 var pdpPrice = product.GetDouble("Ecom:Product.Price.PriceWithVAT.Value"); 771 772 var pdpBeforeprice = product.GetString("Ecom:Product:Field.Beforeprice.Value"); 773 774 } 775 @if (pdpBeforeprice != "") 776 { 777 <span class="plp-org-price"> 778 <span>@Translate("Before price", "Før ")</span> <span>@pdpBeforeprice</span> <span>@currencyCode</span> 779 </span> 780 <span class="plp-list-price"> 781 <span>@Translate("After price", "Nu")</span> <span itemprop="price">@pdpPrice.ToString("N2")</span> <span itemprop="price">@currencyCode</span> 782 </span> 783 } 784 else 785 { 786 <span class="plp-list-price"> 787 <span itemprop="price">@pdpPrice.ToString("N2")</span> <span itemprop="priceCurrency">@currencyCode</span> 788 </span> 789 } 790 </footer> 791 </article> 792 </li> 793 } 794 </ul> 795 </section> 796 }*@ 797 </div> 798 @{ 799 var No1Banner = 0; 800 if (!string.IsNullOrEmpty(Pageview.Area.Item["No1Banner"] as string)) 801 { 802 Int32.TryParse(Pageview.Area.Item["No1Banner"].ToString().Split('#').Last(), out No1Banner); 803 } 804 } 805 806 @{ 807 var imageLocation = ""; 808 var imageText = ""; 809 var brandPageLink = ""; 810 811 var fallback = false; 812 var xpiLocation = specs.GetByKey("BrandBanner").Value; 813 814 //If there is data in XPI, get everything from there 815 if (!string.IsNullOrWhiteSpace(xpiLocation.Trim())) 816 { 817 imageLocation = "/Files/Images/XPI/" + xpiLocation; 818 imageText = specs.GetByKey("BrandText").Value; 819 brandPageLink = specs.GetByKey("BrandLink").Value; 820 } 821 else 822 { 823 var brandingService = ObjectFactory.GetInstance<BrandingService> 824 (); 825 var brandName = specs.GetByKey("brand").Value; 826 var brandPageInfo = brandingService.GetDwBrandPageInfo(brandName); 827 var dwImageLocation = brandPageInfo.ImageLocation; 828 829 if (!string.IsNullOrWhiteSpace(dwImageLocation)) 830 { 831 imageLocation = dwImageLocation; 832 imageText = brandPageInfo.ImageText; 833 brandPageLink = "/Default.aspx?ID=" + brandPageInfo.BrandPageId; 834 } 835 else if (No1Banner > 0) 836 { 837 fallback = true; 838 //Render No1Banner as hidden and display it only if the user is not signed in 839 <div id="no1bannertest" style="display: none;"> 840 @RenderParagraphContent(No1Banner) 841 </div> 842 843 <script append="true"> 844 $(document).ready(function () { 845 var branding = new AppStart.BrandBannerHandler(); 846 branding.init(); 847 }); 848 </script> 849 } 850 } 851 if (!fallback && imageLocation.IsNotNullOrEmpty()) 852 { 853 <section class="banner"> 854 <picture> 855 <img src="@Pageview.CdnWrap(string.Format("/Admin/Public/GetImage.ashx?Image={0}&amp;Width=2048&amp;Compression=90", imageLocation))" class="img-fluid" /> 856 </picture> 857 <div class="banner-content justify-content-center align-items-center"> 858 <div class="banner-text text-center text-light bg-clear"> 859 <h2 class="h1">@imageText</h2> 860 <div class="btn-list"> 861 <a href="@brandPageLink" class="btn btn-outline-light"> 862 <span> 863 @Translate("Læs mere", "Læs mere") 864 </span> 865 </a> 866 </div> 867 </div> 868 </div> 869 </section> 870 } 871 } 872 873 <div id="addedModal" style="display:none;" class="fancybox-content"> 874 @*<button class="btn-modal-close" data-fancybox-close> 875 <svg class="icon"> 876 <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/Files/dist/icons/icons.svg#times"></use> 877 </svg> 878 </button>*@ 879 <div class="fancybox-pdp-header"> 880 <p class="h2"> 881 <span data-bind="text: QuantityAdded"></span> @Translate("Products added to basket", "vare(r) tilføjet til kurven") 882 </p> 883 <p class="alert alert-warning" data-bind="visible: NoProductsAdded"> 884 @Translate("Product not in stock", "Produktet er desværre ikke længere på lager og er derfor ikke tilføjet til kurven.") 885 </p> 886 887 <p class="alert alert-warning" data-bind="visible: QuantityAdjusted"> 888 @Translate("Added product amount adjusted", "Obs. ikke tilstrækkelig på lager, antallet er nedjusteret.") 889 </p> 890 </div> 891 <div class="fancybox-pdp-body"> 892 <div class="fancybox-pdp-thumb"> 893 <img data-bind="attr: { src: ProductImage}" src="" 894 class="img-fluid" 895 alt=""> 896 </div> 897 <div class="fancybox-pdp-product"> 898 <div class="fancybox-pdp-name"> 899 <span data-bind="text: Name"> 900 </span> 901 </div> 902 <div class="fancybox-pdp-row"> 903 <div class="fancybox-pdp-col"> 904 <span class="fancybox-pdp-brand"> 905 <span>@Translate("Brand", "Brand"):</span> 906 <span data-bind="text: ProductBrand"></span> 907 </span> 908 <span class="fancybox-pdp-sku"> 909 <span>@Translate("SKU", "Varenummer"):</span> 910 <span data-bind="text: ProductNumber">12345678</span> 911 </span> 912 </div> 913 <div class="fancybox-pdp-col"> 914 <span class="fancybox-pdp-qty"> 915 <span>@Translate("Quantity", "Antal"):</span> 916 <span data-bind="text: QuantityAdded"></span> 917 </span> 918 <span class="fancybox-pdp-price"> 919 <span><span data-bind="text: LinePrice"></span> @currency</span> 920 </span> 921 </div> 922 </div> 923 </div> 924 </div> 925 <div class="fancybox-pdp-navigation"> 926 <a href="@NORRIQ.Common8.Razor.Navigation.GetUrlByNavigationTag(" cart")" class="btn btn-outline-dark"> 927 @Translate("Show cart", "Vis kurv") 928 </a> 929 <a href="@NORRIQ.Common8.Razor.Navigation.GetUrlByNavigationTag(" checkout")" class="btn btn-secondary"> 930 @Translate("Checkout", "Checkout") 931 </a> 932 </div> 933 </div> 934 935 <div id="giftlistLogin" data-action="submitLogin" style="display: none" class="fancybox-content loginFeedback"> 936 <form method="post" id="testForm"> 937 <h2>@Translate("giftlist", "Gaveliste")</h2> 938 <span>@Translate("giftlist_not_loggedin", "Du bedes logge ind for at kunne tilføje til din gaveliste.")</span> 939 <h3>@Translate("login_pop_header", "Log ind")</h3> 940 <div class="form-group"> 941 <label for="giftListUsername">@Translate("usernameLabel", "Brugernavn")</label> 942 <input id="giftListUsername" name="Username" type="text" value="" class="form-control" required> 943 </div> 944 <div class="form-group"> 945 <label for="giftListPassword">@Translate("password", "Adgangskode")</label> 946 <input id="giftListPassword" name="Password" type="password" value="" class="form-control" required> 947 </div> 948 <div id="giftListloginFeedback"></div> 949 <p class=""> 950 <button type="submit" role="button" class="btn btn-primary btn-block" id="giftListloginBtn">@Translate("buttonLogin", "Log ind")</button> 951 </p> 952 953 @{ 954 var giftListPasswordUrl = NORRIQ.Common8.Razor.Navigation.GetUrlByNavigationTag("forgot-password"); 955 var giftListNewUserUrl = NORRIQ.Common8.Razor.Navigation.GetUrlByNavigationTag("new-user"); 956 } 957 <div class="loginFeedback" style="display: none;"> 958 <p class="alert alert-warning"> 959 @Translate("Cart Login Error", "Har du glemt dit brugernavn eller adgangskode?") 960 <a href="@NORRIQ.Common8.Razor.Navigation.GetUriByNavigationTag("forgot-password")">@Translate("Cart Login Error Label", " Så klik her")</a> 961 </p> 962 </div> 963 964 <ul class="list-unstyled"> 965 <li> 966 <a href="@giftListPasswordUrl" class="forgot-password">@Translate("label_forgotten_password", "Glemt adgangskode")</a> 967 </li> 968 <li> 969 <a href="@giftListNewUserUrl">@Translate("label_create_new_user", "Opret ny bruger")</a> 970 </li> 971 </ul> 972 </form> 973 </div> 974 975 @{ 976 var shoppingGuide = 0; 977 var createNo1 = 0; 978 var infoNo1 = 0; 979 var returnID = 0; 980 if (!string.IsNullOrEmpty(Pageview.Area.Item["ShoppingGuide"] as string)) 981 { 982 Int32.TryParse(Pageview.Area.Item["ShoppingGuide"].ToString().Split('#').Last(), out shoppingGuide); 983 } 984 if (!string.IsNullOrEmpty(Pageview.Area.Item["No1CreateUser"] as string)) 985 { 986 Int32.TryParse(Pageview.Area.Item["No1CreateUser"].ToString().Split('#').Last(), out createNo1); 987 } 988 if (!string.IsNullOrEmpty(Pageview.Area.Item["No1Infotext"] as string)) 989 { 990 Int32.TryParse(Pageview.Area.Item["No1Infotext"].ToString().Split('#').Last(), out infoNo1); 991 } 992 if (!string.IsNullOrEmpty(Pageview.Area.Item["ShoppingTerms"] as string)) 993 { 994 Int32.TryParse(Pageview.Area.Item["ShoppingTerms"].ToString().Split('#').Last(), out returnID); 995 } 996 } 997 @if (shoppingGuide > 0) 998 { 999 <div id="shoppingGuide" style="display:none;" class="fancybox-content"> 1000 @RenderParagraphContent(shoppingGuide) 1001 </div> 1002 } 1003 @if (createNo1 > 0 && infoNo1 > 0) 1004 { 1005 <div id="createNo1" style="display:none;" class="fancybox-content"> 1006 <h2 class="h1">@Translate("Opret dig som No1 kunde", "Opret dig som No1 kunde")</h2> 1007 @RenderParagraphContent(infoNo1) 1008 @RenderParagraphContent(createNo1) 1009 </div> 1010 } 1011 1012 @if (returnID > 0) 1013 { 1014 <div id="returnID" style="display:none;" class="fancybox-content"> 1015 @RenderParagraphContent(returnID) 1016 </div> 1017 } 1018 1019 1020 1021 1022 @* Facebook Pixel tracking, CAS-25405-W5J7V5 *@ 1023 <script append="true"> 1024 window.onload = function () { 1025 if (typeof fbq !== "undefined") { 1026 fbViewContent(); 1027 }; 1028 }; 1029 1030 window.addEventListener('CookieInformationConsentGiven', function (event) { 1031 if (CookieInformation.getConsentGivenFor('cookie_cat_marketing')) { 1032 if (typeof fbq !== "undefined") { 1033 fbViewContent(); 1034 }; 1035 } 1036 }, false); 1037 1038 function fbViewContent() { 1039 fbq('track', 'ViewContent', 1040 { 1041 content_ids: ['@GetString("Ecom:Product.Number")'], 1042 content_type: 'product', 1043 content_name: '@specs.GetByKey("ProductName").Value.Replace("'", "")', 1044 value: 1045 @GetDouble("Ecom:Product.Price.PriceWithVAT.Value").ToString("F2", new CultureInfo("en-US")), 1046 currency: '@currency' 1047 }); 1048 } 1049 1050 //TODO: Ulf tilføj dette til TS for PDP!!! 1051 $('.pdp-qty-increase').click(function() { 1052 var $input = $(this).parents('.pdp-qty-control').find('.form-control'); 1053 var val = parseInt($input.val(), 10); 1054 $input.val(val + 1); 1055 }); 1056 1057 $('.pdp-qty-decrease').click(function() { 1058 var $input = $(this).parents('.pdp-qty-control').find('.form-control'); 1059 var val = parseInt($input.val(), 10); 1060 if (val > 1) { 1061 $input.val(val - 1); 1062 } 1063 }); 1064 </script> 1065 1066 <script append="true"> 1067 $(document).ready(function () { 1068 var giftList = new AppStart.GiftList; 1069 giftList.init(); 1070 }); 1071 </script> 1072 1073 @helper PrintMoreSaleProductImage(List<Product> moreSaleProducts, string imageAlt) 1074 { 1075 int index = 0; 1076 1077 foreach (var moreSalesProduct in moreSaleProducts) 1078 { 1079 var moreSalesSpecs = ProductSpecificationExtensionMethods.GetProductSpecifications((int)moreSalesProduct.AutoId); 1080 var moreSalesProductImages = moreSalesSpecs.GetAllByKey("Billeder"); 1081 1082 <a href="@Pageview.CdnWrap(string.Format("/Admin/Public/GetImage.ashx?Image=/Files/Images/XPI/{0}&amp;Width=1200&amp;Crompression=90", moreSalesProductImages.First().Value))" 1083 @if (index == 0) 1084 { 1085 <text>class="pdp-image-lg more-sale-image active"</text> 1086 } 1087 else 1088 { 1089 <text>class="pdp-image-lg more-sale-image"</text> 1090 } 1091 data-fancybox 1092 data-caption="@imageAlt" 1093 data-options='{"infobar": false, "animationEffect": false, "buttons":["zoom","close"]}' 1094 data-id="@moreSalesProduct.Id"> 1095 <img src="@Pageview.CdnWrap(string.Format("/Admin/Public/GetImage.ashx?Image=/Files/Images/XPI/{0}&amp;Width=110&amp;Height=110&amp;Crop=5&amp;Compression=90", moreSalesProductImages.First().Value))" 1096 class="img-fluid" 1097 itemprop="image" 1098 alt="@imageAlt" /> 1099 </a> 1100 index++; 1101 } 1102 } 1103 1104 @helper PrintMoreSaleProduct(List<Product> moreSaleProducts, string currencyCode) 1105 { 1106 // We have to start at index 2, because index 1 is the main product. 1107 int index = 2; 1108 1109 foreach (var moreSalesProduct in moreSaleProducts) 1110 { 1111 string val = "value=\"" + index + "\""; 1112 <div class="more-sale-row"> 1113 <div class="more-sale-column radio"> 1114 1115 <div class="form-check"> 1116 <input type="checkbox" 1117 name="more-sale-product" 1118 id="[email protected]" 1119 value="@moreSalesProduct.Id" 1120 class="more-sale-product" 1121 data-index="@{@index}" 1122 style="display: none;" /> 1123 <label for="[email protected]" class="custom-checkbox-label"> 1124 <svg class="icon"> 1125 <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/Files/dist/icons/icons.svg#check"></use> 1126 </svg> 1127 </label> 1128 </div> 1129 1130 <div class="more-sale-input"> 1131 <input type="hidden" name="[email protected]{@index}" id="[email protected]{@index}" @val> 1132 <input type="hidden" name="[email protected]{@index}" id="[email protected]{@index}" value="@moreSalesProduct.Id"> 1133 <input type="hidden" name="[email protected]{@index}" id="[email protected]{@index}" value="@moreSalesProduct.VariantId"> 1134 <input type="hidden" name="[email protected]{@index}" id="[email protected]{@index}" value="@moreSalesProduct.DefaultUnitId"> 1135 <input type="hidden" name="[email protected]{@index}" id="[email protected]{@index}" value="0"> 1136 <input type="hidden" name="[email protected]{@index}" value="1" /> 1137 </div> 1138 </div> 1139 <div class="more-sale-column name"> 1140 <a href="@UrlHelper.GetProductUrl(moreSalesProduct.Id)"> 1141 @moreSalesProduct.Name 1142 </a> 1143 </div> 1144 <div class="more-sale-column price"> 1145 <label for="[email protected]"> 1146 @*@moreSalesProduct.Price.PriceWithVAT.ToString("N2") <span itemprop="priceCurrency" content="@currencyCode">@currencyCode</span>*@ 1147 </label> 1148 </div> 1149 </div> 1150 index++; 1151 } 1152 }