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 Dynamicweb.Frontend.XmlNavigation.MakeHrefs(String& href, String& friendlyHref, Page page, String[] params)
   at Dynamicweb.Frontend.XmlNavigation.GenerateXml(IEnumerable`1 pages, XmlElement parentNode)
   at Dynamicweb.Frontend.XmlNavigation.GenerateXml(IEnumerable`1 pages, XmlElement parentNode)
   at Dynamicweb.Frontend.XmlNavigation.GenerateXml(IEnumerable`1 pages, XmlElement parentNode)
   at Dynamicweb.Frontend.XmlNavigation.MakeXml(Int32 parentId, Int32 levelStart, Int32 levelStop, Expand expand, Int32 selectedAreaId)
   at Dynamicweb.Frontend.XmlNavigation.GetNavigationHtml(Int32 parentId, Int32 levelStart, Int32 levelStop, Expand expand, String name, String xsltPath, Int32 selectedAreaId, Boolean sitemapMode, NameValueCollection settings, NameValueCollection attributes, IncludeMode mode)
   at Dynamicweb.Frontend.XmlNavigation.GetNavigationHtml(NameValueCollection settings, NameValueCollection attributes)
   at Dynamicweb.Rendering.TemplateBase`1.RenderNavigation(Object settings)
   at CompiledRazorTemplates.Dynamic.RazorEngine_f3cf787bcece485485826fc19e1d2721.<>c__DisplayClass3_0.b__5() in E:\Solutions\IBH\Web\Live\Files\Templates\Designs\IBH\eCom\Product\PDP.cshtml:line 67
   at NORRIQ.Common8.Caching.CacheItemContainer.BuildItem[T](Func`1 buildmethod, Type dependencyType)
   at NORRIQ.Common8.Caching.HttpCache.GetOrInsert[T](String cacheKey, Func`1 buildCacheDependency, Func`1 buildNewItem)
   at NORRIQ.Common8.Caching.HttpCache`1.GetOrInsert[T](String cacheKey, Func`1 buildNewItem)
   at NORRIQ.Common8.Caching.AreaCache.GetOrInsert[T](String cacheKey, Func`1 buildNewItem)
   at NORRIQ.Common8.Caching.DwCaching.CacheByPage(String cacheKey, Func`1 buildFunc)
   at CompiledRazorTemplates.Dynamic.RazorEngine_f3cf787bcece485485826fc19e1d2721.Execute() in E:\Solutions\IBH\Web\Live\Files\Templates\Designs\IBH\eCom\Product\PDP.cshtml:line 67
   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 } 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 var variantSelected = System.Web.HttpContext.Current.Request["Selected"] != null; 349 <div class="pdp-variants pdp-variants-single"> 350 <div class="form-group"> 351 <label for="variant1Selector" class="sr-only">@Translate("Choose", "Vælg") <span class="text-lowercase">@selectedVariant.Variant1.GroupLabel</span></label> 352 <select class="form-control" id="variant1Selector" data-enable-target="#buy-button"> 353 <option value="0" @(!variantSelected ? "selected='selected'" : "")> 354 @Translate("Choose", "Vælg") @selectedVariant.Variant1.GroupLabel 355 </option> 356 @foreach (var v1 in productsDictionary.Where(a => !string.IsNullOrEmpty(a.Key.OptionId))) 357 { 358 var isSelected = selectedVariant.Variant1.Equals(v1.Key); 359 var product = v1.Value.First(); 360 var linkToGroup = product.Value.LinkToGroup+ "&Selected=ready"; 361 <option value="@(isSelected? "0" : v1.Key.OptionId)" @(isSelected && variantSelected ? "selected='selected'" : "") data-linktogroup="@linkToGroup">@v1.Key.OptionName</option> 362 } 363 </select> 364 </div> 365 </div> 366 } 367 else 368 { 369 370 <div class="pdp-variants pdp-variants-double"> 371 <div class="form-group"> 372 <label for="variant1Selector">@Translate("Choose", "Vælg") <span class="text-lowercase">@selectedVariant.Variant1.GroupLabel</span></label> 373 <select class="form-control" id="variant1Selector"> 374 @foreach (var v1 in productsDictionary.Where(a => !string.IsNullOrEmpty(a.Key.OptionId))) 375 { 376 var isSelected = selectedVariant.Variant1.Equals(v1.Key); 377 <option value="@v1.Key.OptionId" @(isSelected ? "selected='selected'" : "")>@v1.Key.OptionName</option> 378 } 379 </select> 380 </div> 381 <div class="form-group"> 382 <label for="variant2Selector">@Translate("Choose", "Vælg") <span class="text-lowercase">@selectedVariant.Variant2.GroupLabel</span></label> 383 <select class="form-control" id="variant2Selector"> 384 @foreach (var v1 in productsDictionary.Where(pde => pde.Key.Equals(selectedVariant.Variant1))) 385 { 386 foreach (var v2 in v1.Value.Where(a => !string.IsNullOrEmpty(a.Key.OptionId))) 387 { 388 var isSelected = selectedVariant.Variant2.Equals(v2.Key); 389 <option value="@v2.Key.OptionId" @(isSelected ? "selected='selected'" : "") data-linktogroup="@v2.Value.LinkToGroup">@v2.Key.OptionName</option> 390 } 391 } 392 </select> 393 </div> 394 </div> 395 } 396 397 <script type="text/x-jsrender" id="emptyVariant2OptionTemplate"> 398 <option value="0"> 399 @Translate("Choose", "Vælg") @selectedVariant.Variant1.GroupLabel 400 </option> 401 </script> 402 403 <script type="text/x-jsrender" id="variant2OptionTemplate"> 404 <option value="0"> 405 @Translate("Choose", "Vælg") @selectedVariant.Variant2.GroupLabel 406 </option> 407 408 {{for Products}} 409 <option value="{{:OptionId}}" data-linktogroup="{{:LinkToGroup}}">{{:OptionName}}</option> 410 {{/for}} 411 </script> 412 413 414 <script append="true"> 415 var variantData = [ 416 @for (int i = 0; i < productsDictionary.Count; i++) 417 { 418 var v1 = productsDictionary.ElementAt(i); 419 <text> 420 { 421 "GroupLabel": "@v1.Key.GroupLabel", 422 "GroupName": "@v1.Key.GroupName", 423 "OptionId": "@v1.Key.OptionId", 424 "OptionName": "@v1.Key.OptionName", 425 "Products": [ 426 @for (int j = 0; j < v1.Value.Count; j++) 427 { 428 var v2 = v1.Value.ElementAt(j); 429 <text> 430 { 431 "GroupLabel": "@v2.Key.GroupLabel", 432 "GroupName": "@v2.Key.GroupName", 433 "OptionId": "@v2.Key.OptionId", 434 "OptionName": "@v2.Key.OptionName", 435 "LinkToGroup": "@v2.Value.LinkToGroup" 436 },@(j + 1 == v1.Value.Count ? "" : ",") 437 </text> 438 } 439 ] 440 },@(i + 1 == productsDictionary.Count ? "" : ",") 441 </text> 442 } 443 ]; 444 var variantMode = '@variants.Count'; 445 var variantSelector = new AppStart.VariantSelector({ 446 $emptyVariant2OptionTemplate: $('#emptyVariant2OptionTemplate'), 447 $variant2OptionTemplate: $('#variant2OptionTemplate'), 448 $v1Selector: $('#variant1Selector'), 449 $v2Selector: $('#variant2Selector'), 450 // 0 == no variants, 1 == single variant, 2 == 2 variants. 451 variantMode: variantMode, 452 variantData: variantData 453 }); 454 455 variantSelector.init(); 456 @*require(['jquery', 'standardwebshop/areas/ecom/product/variantselection'], function($, variantSelection) { 457 // 0 == no variants, 1 == single variant, 2 == 2 variants. 458 var variantMode = @variants.Count; 459 460 if (variantMode == 0) 461 return; 462 463 variantSelection.init({ 464 $emptyVariant2OptionTemplate: $('#emptyVariant2OptionTemplate'), 465 $variant2OptionTemplate: $('#variant2OptionTemplate'), 466 $v1Selector: $('#variant1Selector'), 467 $v2Selector: $('#variant2Selector'), 468 469 // 0 == no variants, 1 == single variant, 2 == 2 variants. 470 variantMode: variantMode, 471 472 variantData: variantData 473 }); 474 });*@ 475 </script> 476 477 478 </div> 479 @if (specs.GetByGroup("Produkt detaljer").Any()) 480 { 481 var sizeGuide = specs.FirstOrDefault(x => x.Key == "Str_guide"); 482 if (sizeGuide != null) 483 { 484 <div class="pdp-select"> 485 <a href="@string.Format("/Files/Images/XPI/{0}", sizeGuide.Value)" target="_blank"> 486 @Translate("Størrelsesguide") 487 </a> 488 </div> 489 } 490 } 491 <div class="pdp-select"> 492 @if (canBuy) 493 { 494 <div class="pdp-qty"> 495 <label for="Quantity1" class="sr-only">@Translate("Number", "Antal")</label> 496 <div class="pdp-qty-control"> 497 <input type="number" name="Quantity1" id="Quantity1" min="1" step="1" value="1" class="form-control" autocomplete="off" /> 498 <button type="button" class="pdp-qty-decrease"> 499 - 500 </button> 501 <button type="button" class="pdp-qty-increase"> 502 + 503 </button> 504 </div> 505 </div> 506 507 var variantSelected = !GetLoop("VariantGroups").Any() || System.Web.HttpContext.Current.Request["Selected"] != null; 508 509 <div class="pdp-button-wrapper"> 510 <div class="pdp-button"> 511 <button class="btn btn-primary btn-buying" id="buy-button" 512 role="button" 513 type="submit" 514 @(!variantSelected ? "disabled=disabled" : @variantSelected.ToString())> 515 <svg class="icon icon-xs"> 516 <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/Files/dist/icons/icons.svg#shopping"></use> 517 </svg> 518 <span class="loader loader-light loader-xs"></span> 519 <span>@Translate("Add_to_cart", "Tilføj til kurv")</span> 520 </button> 521 </div> 522 <div class="pdp-delivery-time desktop"> 523 @if (deliveryTime != null && deliveryTime.Any()) 524 { 525 <span>@Translate("Leveringstid", "Leveringstid"): @String.Join(", ", deliveryTime.Select(x => x.Value))</span> 526 } 527 </div> 528 </div> 529 } 530 else 531 { 532 <input type="hidden" name="Quantity1" id="Quantity1" value="1" /> 533 } 534 </div> 535 536 <div class="pdp-delivery-time mobile"> 537 @if (deliveryTime != null && deliveryTime.Any()) 538 { 539 <span>@Translate("Leveringstid", "Leveringstid"): @String.Join(", ", deliveryTime.Select(x => x.Value))</span> 540 } 541 </div> 542 543 @if (string.Equals(Pageview.Area.Culture, "nb-NO")) 544 { 545 <div class="add-to-gift-list"> 546 <span data-action="addToGiftList">@Translate("Add to giftlist", "Tilføj til gaveliste")</span> 547 </div> 548 <p id="giftListSuccess" class="pdp-giftlist-added" style="display: none"> 549 @Translate("Added to giftlist info", "Varen er tilføjet til din gaveliste") 550 551 <a href="@giftlistLink"> 552 @Translate("Show giftlist button", "Vis gaveliste") 553 </a> 554 </p> 555 } 556 557 @if (!canBuy) 558 { 559 <div class="pdp-button"> 560 <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"> 561 @Translate("nostock_btn", "Giv mig besked") 562 </a> 563 </div> 564 } 565 <div id="more-sale-input-container"></div> 566 </form> 567 @if (!canBuy) 568 { 569 var usermail = Pageview.User != null ? Pageview.User.Email : string.Empty; 570 <div class="pdp-backinstock" id="nostockModal" style="display: none;"> 571 <h2 class="modal-title">@Translate("modal_nostock_heading", "Giv mig besked")</h2> 572 <p>@Translate("modal_nostock_txt", "Vi sender dig en e-mail, når denne vare igen er på lager.")</p> 573 <form name="@GetValue("Ecom:Product.ID")" method="post" class="form validation pdp-backinstock-form" role="form" action=""> 574 <input type="hidden" name="ProductID" value="@GetValue("Ecom:Product.ID")"/> 575 <input type="hidden" name="VariantID" value="@GetValue("Ecom:Product.VariantID")"/> 576 <input type="hidden" name="LanguageID" value="@GetValue("Ecom:Product.LanguageID")"/> 577 <input type="hidden" name="ProductName" value="@specs.GetByKey("ProductName").Value"/> 578 <input type="hidden" name="CartCmd" value="createnotificationforthisproduct"/> 579 <div class="form-group"> 580 <label for="NotificationEmail">@Translate("ns_email", "E-mail adresse")</label> 581 <div class="form-group-combined"> 582 <input name="NotificationEmail" id="NotificationEmail" type="email" value="@usermail" class="required form-control"> 583 <button type="submit" class="btn btn-primary btn-block">@Translate("nostocksend_btn", "Send")</button> 584 </div> 585 </div> 586 </form> 587 </div> 588 } 589 </div> 590 @{ 591 var usps = specs.GetByKey("ProductUSP"); 592 } 593 @if (!usps.Value.IsNullOrEmpty()) 594 { 595 <ul class="pdp-usp"> 596 <li class="pdp-usp-item"> 597 <span class="pdp-usp-link"> 598 <svg class="icon icon-xs"> 599 <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/Files/dist/icons/icons.svg#star"></use> 600 </svg> 601 <span> 602 @usps.Value 603 </span> 604 </span> 605 </li> 606 </ul> 607 } 608 </div> 609 <div id="pdp-details-data" class="pdp-details-data mt-3"> 610 @if (moreSaleProducts.Any()) 611 { 612 <div class="pdp-more-sales"> 613 <h3>@specs.GetByKey("MoreSaleHeadline").Value</h3> 614 615 <div class="pdp-more-sales-container"> 616 <div class="more-sale-images"> 617 @PrintMoreSaleProductImage(moreSaleProducts, imageAlt) 618 </div> 619 620 <div class="more-sale-container"> 621 @PrintMoreSaleProduct(moreSaleProducts, currencyCode) 622 </div> 623 </div> 624 </div> 625 } 626 627 <div class="pdp-accordion" data-toggle="collapse" data-target="#pdp-details" aria-expanded="true" aria-controls="pdp-details" data-parent="#pdp-details-data"> 628 <h3>@Translate("Product details", "Detaljer")</h3> 629 </div> 630 <div class="pdp-accordion-content collapse show" id="pdp-details"> 631 @if (specs.GetByGroup("Produkt detaljer").Any()) 632 { 633 <div class="pdp-specs"> 634 <ul class="pdp-specs-list"> 635 @foreach (var spec in filteredSpecs) 636 { 637 var showLabel = !specsToSkipLabels.Contains(spec.First().Key); 638 var firstSpec = spec.First(); 639 640 if (firstSpec.Key == "Link") 641 { 642 <li class="pdp-specs-item"> 643 <a href="@firstSpec.Value" target="_blank">@firstSpec.Caption</a> 644 </li> 645 } 646 else if (firstSpec.Key == "Leveringstid" && !string.IsNullOrEmpty(stockPhaseDescription)) 647 { 648 <li class="pdp-specs-item"> 649 @(showLabel ? firstSpec.Caption + ": " : "")@stockPhaseDescription 650 </li> 651 } 652 else 653 { 654 <li class="pdp-specs-item"> 655 @(showLabel ? firstSpec.Caption + ": " : "")@String.Join(", ", spec.Select(a => a.Value)) 656 </li> 657 } 658 } 659 </ul> 660 </div> 661 } 662 </div> 663 664 <div class="pdp-accordion collapsed" data-toggle="collapse" data-target="#pdp-description" aria-expanded="false" aria-controls="pdp-description" data-parent="#pdp-details-data"> 665 <h3>@Translate("Produkt beskrivelse", "Produkt beskrivelse")</h3> 666 </div> 667 <div class="pdp-accordion-content collapse" id="pdp-description"> 668 @if (!string.IsNullOrEmpty(specs.GetByKey("Beskrivelse").Value)) 669 { 670 //Read the full text. 671 var fullText = specs.GetByKey("Beskrivelse").Value; // + " " + specs.GetByKey("Beskrivelse").Value; 672 673 <div class="pdp-description" itemprop="description"> 674 <p>@fullText</p> 675 </div> 676 } 677 </div> 678 679 @if (GetBoolean("Ecom:Product:Field.VisLagerstatus")) 680 { 681 DateTime? lastWmsSyncDateTime = new StockUpdateInfo().GetLatestTimestamp(); 682 683 <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"> 684 <h3>@Translate("Lagerstatus i butik")</h3> 685 </div> 686 <div class="pdp-accordion-content collapse" id="pdp-stock-locations"> 687 <div class="pdp-stock-locations"> 688 @{ 689 foreach (var stockLocation in this.GetStockLocations()) 690 { 691 <div class="location-name"> 692 <h6>@stockLocation.Name</h6> 693 </div> 694 <div class="pdp-stock-location"> 695 <div class="stock-column location-info"> 696 <div class="location-text"> 697 @stockLocation.Address 698 </div> 699 </div> 700 <div class="stock-column location-status"> 701 <span class="icon @stockLocation.StockLocationState"></span> 702 <span class="stock-text"> 703 @if (stockLocation.StockLocationState == StockState.FewInStock.ToString()) 704 { 705 <span class="stock-status"> 706 @Translate("Få på lager i butik") 707 </span> 708 } 709 else if (stockLocation.StockLocationState == StockState.InStock.ToString()) 710 { 711 <span class="stock-status"> 712 @Translate("På lager i butik") 713 </span> 714 } 715 else if (stockLocation.StockLocationState == StockState.OutOfStock.ToString()) 716 { 717 <span class="stock-status"> 718 @Translate("Ikke på lager i butik", "Udsolgt") 719 </span> 720 } 721 </span> 722 </div> 723 <div class="stock-column location-opening-hours"> 724 <a href="@stockLocation.Link">@Translate("Se åbningstider")</a> 725 </div> 726 </div> 727 } 728 } 729 <div class="pdp-stock-updated"> 730 @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.") 731 </div> 732 </div> 733 </div> 734 } 735 </div> 736 <div class="pdp-details-foot"> 737 <p> 738 @if (!string.IsNullOrEmpty(specs.GetByKey("Barcode").Value)) 739 { 740 <span> 741 @specs.GetByKey("Barcode").Caption: @specs.GetByKey("Barcode").Value 742 </span> 743 } 744 else 745 { 746 <text>&nbsp;</text> 747 } 748 </p> 749 <p> 750 <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> 751 </p> 752 </div> 753 </div> 754 </section> 755 @*@if (GetLoop("eCom:Related.WhatAboutTheseProducts").Any()) 756 { 757 <section class="pdp-related" id="partnerloop"> 758 <h2 class="text-center">@Translate("other_favorites_heading", "Andre favoritter")</h2> 759 <ul class="plp-list"> 760 @foreach (var product in GetLoop("eCom:Related.WhatAboutTheseProducts").Take(4)) 761 { 762 var plpSpecs = product.GetProductSpecifications(); 763 var plpImage = plpSpecs.HasKey("Billeder") ? "/Files/Images/XPI/" + plpSpecs.GetByKey("Billeder").Value : "/Files/Images/Ecom/default.jpg"; 764 var url = "/Default.aspx?ID=" + NORRIQ.Common8.Razor.Navigation.GetPageIdByNavigationTag("webshop") + "&amp;ProductID=" + product.GetString("Ecom:Product.ID.UrlEncoded"); 765 <li class="plp-list-item"> 766 <article class="plp-list-product"> 767 <a href="@url" itemprop="url" class="plp-list-url"> 768 <figure class="plp-list-image"> 769 <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))" 770 class="img-fluid" 771 alt="@product.GetString("Ecom:Product.Name")" 772 itemprop="image" /> 773 </figure> 774 <header class="plp-list-info"> 775 <p class="plp-list-brand" itemprop="brand"> 776 @plpSpecs.GetByKey("Brand").Value 777 </p> 778 <h2 class="plp-list-name" itemprop="name"> 779 @product.GetString("Ecom:Product.Name") 780 </h2> 781 </header> 782 </a> 783 <footer class="plp-list-prices"> 784 @{ 785 var pdpPrice = product.GetDouble("Ecom:Product.Price.PriceWithVAT.Value"); 786 787 var pdpBeforeprice = product.GetString("Ecom:Product:Field.Beforeprice.Value"); 788 789 } 790 @if (pdpBeforeprice != "") 791 { 792 <span class="plp-org-price"> 793 <span>@Translate("Before price", "Før ")</span> <span>@pdpBeforeprice</span> <span>@currencyCode</span> 794 </span> 795 <span class="plp-list-price"> 796 <span>@Translate("After price", "Nu")</span> <span itemprop="price">@pdpPrice.ToString("N2")</span> <span itemprop="price">@currencyCode</span> 797 </span> 798 } 799 else 800 { 801 <span class="plp-list-price"> 802 <span itemprop="price">@pdpPrice.ToString("N2")</span> <span itemprop="priceCurrency">@currencyCode</span> 803 </span> 804 } 805 </footer> 806 </article> 807 </li> 808 } 809 </ul> 810 </section> 811 }*@ 812 </div> 813 @{ 814 var No1Banner = 0; 815 if (!string.IsNullOrEmpty(Pageview.Area.Item["No1Banner"] as string)) 816 { 817 Int32.TryParse(Pageview.Area.Item["No1Banner"].ToString().Split('#').Last(), out No1Banner); 818 } 819 } 820 821 @{ 822 var imageLocation = ""; 823 var imageText = ""; 824 var brandPageLink = ""; 825 826 var fallback = false; 827 var xpiLocation = specs.GetByKey("BrandBanner").Value; 828 829 //If there is data in XPI, get everything from there 830 if (!string.IsNullOrWhiteSpace(xpiLocation.Trim())) 831 { 832 imageLocation = "/Files/Images/XPI/" + xpiLocation; 833 imageText = specs.GetByKey("BrandText").Value; 834 brandPageLink = specs.GetByKey("BrandLink").Value; 835 } 836 else 837 { 838 var brandingService = ObjectFactory.GetInstance<BrandingService> 839 (); 840 var brandName = specs.GetByKey("brand").Value; 841 var brandPageInfo = brandingService.GetDwBrandPageInfo(brandName); 842 var dwImageLocation = brandPageInfo.ImageLocation; 843 844 if (!string.IsNullOrWhiteSpace(dwImageLocation)) 845 { 846 imageLocation = dwImageLocation; 847 imageText = brandPageInfo.ImageText; 848 brandPageLink = "/Default.aspx?ID=" + brandPageInfo.BrandPageId; 849 } 850 else if (No1Banner > 0) 851 { 852 fallback = true; 853 //Render No1Banner as hidden and display it only if the user is not signed in 854 <div id="no1bannertest" style="display: none;"> 855 @RenderParagraphContent(No1Banner) 856 </div> 857 858 <script append="true"> 859 $(document).ready(function () { 860 var branding = new AppStart.BrandBannerHandler(); 861 branding.init(); 862 }); 863 </script> 864 } 865 } 866 if (!fallback && imageLocation.IsNotNullOrEmpty()) 867 { 868 <section class="banner"> 869 <picture> 870 <img src="@Pageview.CdnWrap(string.Format("/Admin/Public/GetImage.ashx?Image={0}&amp;Width=2048&amp;Compression=90", imageLocation))" class="img-fluid" /> 871 </picture> 872 <div class="banner-content justify-content-center align-items-center"> 873 <div class="banner-text text-center text-light bg-clear"> 874 <h2 class="h1">@imageText</h2> 875 <div class="btn-list"> 876 <a href="@brandPageLink" class="btn btn-outline-light"> 877 <span> 878 @Translate("Læs mere", "Læs mere") 879 </span> 880 </a> 881 </div> 882 </div> 883 </div> 884 </section> 885 } 886 } 887 888 <div id="addedModal" style="display:none;" class="fancybox-content"> 889 @*<button class="btn-modal-close" data-fancybox-close> 890 <svg class="icon"> 891 <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/Files/dist/icons/icons.svg#times"></use> 892 </svg> 893 </button>*@ 894 <div class="fancybox-pdp-header"> 895 <p class="h2"> 896 <span data-bind="text: QuantityAdded"></span> @Translate("Products added to basket", "vare(r) tilføjet til kurven") 897 </p> 898 <p class="alert alert-warning" data-bind="visible: NoProductsAdded"> 899 @Translate("Product not in stock", "Produktet er desværre ikke længere på lager og er derfor ikke tilføjet til kurven.") 900 </p> 901 902 <p class="alert alert-warning" data-bind="visible: QuantityAdjusted"> 903 @Translate("Added product amount adjusted", "Obs. ikke tilstrækkelig på lager, antallet er nedjusteret.") 904 </p> 905 </div> 906 <div class="fancybox-pdp-body"> 907 <div class="fancybox-pdp-thumb"> 908 <img data-bind="attr: { src: ProductImage}" src="" 909 class="img-fluid" 910 alt=""> 911 </div> 912 <div class="fancybox-pdp-product"> 913 <div class="fancybox-pdp-name"> 914 <span data-bind="text: Name"> 915 </span> 916 </div> 917 <div class="fancybox-pdp-row"> 918 <div class="fancybox-pdp-col"> 919 <span class="fancybox-pdp-brand"> 920 <span>@Translate("Brand", "Brand"):</span> 921 <span data-bind="text: ProductBrand"></span> 922 </span> 923 <span class="fancybox-pdp-sku"> 924 <span>@Translate("SKU", "Varenummer"):</span> 925 <span data-bind="text: ProductNumber">12345678</span> 926 </span> 927 </div> 928 <div class="fancybox-pdp-col"> 929 <span class="fancybox-pdp-qty"> 930 <span>@Translate("Quantity", "Antal"):</span> 931 <span data-bind="text: QuantityAdded"></span> 932 </span> 933 <span class="fancybox-pdp-price"> 934 <span><span data-bind="text: LinePrice"></span> @currency</span> 935 </span> 936 </div> 937 </div> 938 </div> 939 </div> 940 <div class="fancybox-pdp-navigation"> 941 <a href="@NORRIQ.Common8.Razor.Navigation.GetUrlByNavigationTag(" cart")" class="btn btn-outline-dark"> 942 @Translate("Show cart", "Vis kurv") 943 </a> 944 <a href="@NORRIQ.Common8.Razor.Navigation.GetUrlByNavigationTag(" checkout")" class="btn btn-secondary"> 945 @Translate("Checkout", "Checkout") 946 </a> 947 </div> 948 </div> 949 950 <div id="giftlistLogin" data-action="submitLogin" style="display: none" class="fancybox-content loginFeedback"> 951 <form method="post" id="testForm"> 952 <h2>@Translate("giftlist", "Gaveliste")</h2> 953 <span>@Translate("giftlist_not_loggedin", "Du bedes logge ind for at kunne tilføje til din gaveliste.")</span> 954 <h3>@Translate("login_pop_header", "Log ind")</h3> 955 <div class="form-group"> 956 <label for="giftListUsername">@Translate("usernameLabel", "Brugernavn")</label> 957 <input id="giftListUsername" name="Username" type="text" value="" class="form-control" required> 958 </div> 959 <div class="form-group"> 960 <label for="giftListPassword">@Translate("password", "Adgangskode")</label> 961 <input id="giftListPassword" name="Password" type="password" value="" class="form-control" required> 962 </div> 963 <div id="giftListloginFeedback"></div> 964 <p class=""> 965 <button type="submit" role="button" class="btn btn-primary btn-block" id="giftListloginBtn">@Translate("buttonLogin", "Log ind")</button> 966 </p> 967 968 @{ 969 var giftListPasswordUrl = NORRIQ.Common8.Razor.Navigation.GetUrlByNavigationTag("forgot-password"); 970 var giftListNewUserUrl = NORRIQ.Common8.Razor.Navigation.GetUrlByNavigationTag("new-user"); 971 } 972 <div class="loginFeedback" style="display: none;"> 973 <p class="alert alert-warning"> 974 @Translate("Cart Login Error", "Har du glemt dit brugernavn eller adgangskode?") 975 <a href="@NORRIQ.Common8.Razor.Navigation.GetUriByNavigationTag("forgot-password")">@Translate("Cart Login Error Label", " Så klik her")</a> 976 </p> 977 </div> 978 979 <ul class="list-unstyled"> 980 <li> 981 <a href="@giftListPasswordUrl" class="forgot-password">@Translate("label_forgotten_password", "Glemt adgangskode")</a> 982 </li> 983 <li> 984 <a href="@giftListNewUserUrl">@Translate("label_create_new_user", "Opret ny bruger")</a> 985 </li> 986 </ul> 987 </form> 988 </div> 989 990 @{ 991 var shoppingGuide = 0; 992 var createNo1 = 0; 993 var infoNo1 = 0; 994 var returnID = 0; 995 if (!string.IsNullOrEmpty(Pageview.Area.Item["ShoppingGuide"] as string)) 996 { 997 Int32.TryParse(Pageview.Area.Item["ShoppingGuide"].ToString().Split('#').Last(), out shoppingGuide); 998 } 999 if (!string.IsNullOrEmpty(Pageview.Area.Item["No1CreateUser"] as string)) 1000 { 1001 Int32.TryParse(Pageview.Area.Item["No1CreateUser"].ToString().Split('#').Last(), out createNo1); 1002 } 1003 if (!string.IsNullOrEmpty(Pageview.Area.Item["No1Infotext"] as string)) 1004 { 1005 Int32.TryParse(Pageview.Area.Item["No1Infotext"].ToString().Split('#').Last(), out infoNo1); 1006 } 1007 if (!string.IsNullOrEmpty(Pageview.Area.Item["ShoppingTerms"] as string)) 1008 { 1009 Int32.TryParse(Pageview.Area.Item["ShoppingTerms"].ToString().Split('#').Last(), out returnID); 1010 } 1011 } 1012 @if (shoppingGuide > 0) 1013 { 1014 <div id="shoppingGuide" style="display:none;" class="fancybox-content"> 1015 @RenderParagraphContent(shoppingGuide) 1016 </div> 1017 } 1018 @if (createNo1 > 0 && infoNo1 > 0) 1019 { 1020 <div id="createNo1" style="display:none;" class="fancybox-content"> 1021 <h2 class="h1">@Translate("Opret dig som No1 kunde", "Opret dig som No1 kunde")</h2> 1022 @RenderParagraphContent(infoNo1) 1023 @RenderParagraphContent(createNo1) 1024 </div> 1025 } 1026 1027 @if (returnID > 0) 1028 { 1029 <div id="returnID" style="display:none;" class="fancybox-content"> 1030 @RenderParagraphContent(returnID) 1031 </div> 1032 } 1033 1034 1035 1036 1037 @* Facebook Pixel tracking, CAS-25405-W5J7V5 *@ 1038 <script append="true"> 1039 window.onload = function () { 1040 if (typeof fbq !== "undefined") { 1041 fbViewContent(); 1042 }; 1043 }; 1044 1045 window.addEventListener('CookieInformationConsentGiven', function (event) { 1046 if (CookieInformation.getConsentGivenFor('cookie_cat_marketing')) { 1047 if (typeof fbq !== "undefined") { 1048 fbViewContent(); 1049 }; 1050 } 1051 }, false); 1052 1053 function fbViewContent() { 1054 fbq('track', 'ViewContent', 1055 { 1056 content_ids: ['@GetString("Ecom:Product.Number")'], 1057 content_type: 'product', 1058 content_name: '@specs.GetByKey("ProductName").Value', 1059 value: 1060 @GetDouble("Ecom:Product.Price.PriceWithVAT.Value").ToString("F2", new CultureInfo("en-US")), 1061 currency: '@currency' 1062 }); 1063 } 1064 1065 //TODO: Ulf tilføj dette til TS for PDP!!! 1066 $('.pdp-qty-increase').click(function() { 1067 var $input = $(this).parents('.pdp-qty-control').find('.form-control'); 1068 var val = parseInt($input.val(), 10); 1069 $input.val(val + 1); 1070 }); 1071 1072 $('.pdp-qty-decrease').click(function() { 1073 var $input = $(this).parents('.pdp-qty-control').find('.form-control'); 1074 var val = parseInt($input.val(), 10); 1075 if (val > 1) { 1076 $input.val(val - 1); 1077 } 1078 }); 1079 </script> 1080 1081 <script append="true"> 1082 $(document).ready(function () { 1083 var giftList = new AppStart.GiftList; 1084 giftList.init(); 1085 }); 1086 </script> 1087 1088 @helper PrintMoreSaleProductImage(List<Product> moreSaleProducts, string imageAlt) 1089 { 1090 int index = 0; 1091 1092 foreach (var moreSalesProduct in moreSaleProducts) 1093 { 1094 var moreSalesSpecs = ProductSpecificationExtensionMethods.GetProductSpecifications((int)moreSalesProduct.AutoId); 1095 var moreSalesProductImages = moreSalesSpecs.GetAllByKey("Billeder"); 1096 1097 <a href="@Pageview.CdnWrap(string.Format("/Admin/Public/GetImage.ashx?Image=/Files/Images/XPI/{0}&amp;Width=1200&amp;Crompression=90", moreSalesProductImages.First().Value))" 1098 @if (index == 0) 1099 { 1100 <text>class="pdp-image-lg more-sale-image active"</text> 1101 } 1102 else 1103 { 1104 <text>class="pdp-image-lg more-sale-image"</text> 1105 } 1106 data-fancybox 1107 data-caption="@imageAlt" 1108 data-options='{"infobar": false, "animationEffect": false, "buttons":["zoom","close"]}' 1109 data-id="@moreSalesProduct.Id"> 1110 <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))" 1111 class="img-fluid" 1112 itemprop="image" 1113 alt="@imageAlt" /> 1114 </a> 1115 index++; 1116 } 1117 } 1118 1119 @helper PrintMoreSaleProduct(List<Product> moreSaleProducts, string currencyCode) 1120 { 1121 // We have to start at index 2, because index 1 is the main product. 1122 int index = 2; 1123 1124 foreach (var moreSalesProduct in moreSaleProducts) 1125 { 1126 string val = "value=\"" + index + "\""; 1127 <div class="more-sale-row"> 1128 <div class="more-sale-column radio"> 1129 1130 <div class="form-check"> 1131 <input type="checkbox" 1132 name="more-sale-product" 1133 id="[email protected]" 1134 value="@moreSalesProduct.Id" 1135 class="more-sale-product" 1136 data-index="@{@index}" 1137 style="display: none;" /> 1138 <label for="[email protected]" class="custom-checkbox-label"> 1139 <svg class="icon"> 1140 <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/Files/dist/icons/icons.svg#check"></use> 1141 </svg> 1142 </label> 1143 </div> 1144 1145 <div class="more-sale-input"> 1146 <input type="hidden" name="[email protected]{@index}" id="[email protected]{@index}" @val> 1147 <input type="hidden" name="[email protected]{@index}" id="[email protected]{@index}" value="@moreSalesProduct.Id"> 1148 <input type="hidden" name="[email protected]{@index}" id="[email protected]{@index}" value="@moreSalesProduct.VariantId"> 1149 <input type="hidden" name="[email protected]{@index}" id="[email protected]{@index}" value="@moreSalesProduct.DefaultUnitId"> 1150 <input type="hidden" name="[email protected]{@index}" id="[email protected]{@index}" value="0"> 1151 <input type="hidden" name="[email protected]{@index}" value="1" /> 1152 </div> 1153 </div> 1154 <div class="more-sale-column name"> 1155 <a href="@UrlHelper.GetProductUrl(moreSalesProduct.Id)"> 1156 @moreSalesProduct.Name 1157 </a> 1158 </div> 1159 <div class="more-sale-column price"> 1160 <label for="[email protected]"> 1161 @*@moreSalesProduct.Price.PriceWithVAT.ToString("N2") <span itemprop="priceCurrency" content="@currencyCode">@currencyCode</span>*@ 1162 </label> 1163 </div> 1164 </div> 1165 index++; 1166 } 1167 }