Biesse
Venligst oplys afhentningsadresse og kontaktoplysninger eller klik her for at se hvilken dag vi kører i dit område.
✔ Fri fragt ved køb over 2.000,- ex. moms på webshoppen
✔ Mulighed for at handle 24/7
✔ Kvalitetsværktøj til professionelle
Biesse
Error executing template "Designs/Junget/eCom/Product/productview.cshtml" System.IO.FileNotFoundException: D:\Web\DW3\Junget\Website\Files\System\Images\Shop\Category\W9\W9-11.jpg at System.Drawing.Image.FromFile(String filename, Boolean useEmbeddedColorManagement) at CompiledRazorTemplates.Dynamic.RazorEngine_3b1ba9a3c361405f864d8363cc616b5e.Execute() in D:\Web\DW3\Junget\Website\Files\Templates\Designs\Junget\eCom\Product\productview.cshtml:line 296 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.<RunCompile>b__0(TextWriter writer) at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter) at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template) at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template) at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2 3 @using System; 4 @using System.Collections.Generic; 5 @using System.Web 6 @using System.Drawing 7 @using System.Text.RegularExpressions; 8 @using Dynamicweb.Content 9 @using Dynamicweb.Security.UserManagement; 10 @using Helpers = Website.Helpers; 11 12 @{ 13 bool webshopOK = GetBoolean("Ecom:Product:Field.WebshopOK"); 14 bool internalProduct = GetBoolean("Ecom:Product:Field.InternalProduct"); 15 if (!webshopOK && !internalProduct) 16 { 17 HttpContext.Current.Response.Redirect("/", true); 18 } 19 //productHelper 20 var productHelper = new Website.Helpers.Product(); 21 22 int pageId = GetInteger("Ecom:Product:Page.ID"); 23 24 // Stock status 25 int jungStockAmount = Dynamicweb.Core.Converter.ToInt32(GetString("Ecom:Product:Field.jung_stock").Replace("D", "")); 26 string jungStockText = Helpers.Product.GetJungStock(GetString("Ecom:Product:Field.jung_stock"), GetInteger("Ecom:Product.Stock")); 27 int addDaysToLeadtimeCalculationDate = jungStockAmount; 28 if (GetInteger("Ecom:Product.Stock") > 0) 29 { 30 addDaysToLeadtimeCalculationDate = 0; 31 } 32 if (Pageview.Area.ID == 8) 33 { 34 addDaysToLeadtimeCalculationDate = addDaysToLeadtimeCalculationDate + 5; 35 } 36 double minQuantity = GetDouble("Ecom:Product.PurchaseMinimumQuantity"); 37 if (minQuantity < 1) 38 { 39 minQuantity = 1; 40 } 41 double quantityStep = GetDouble("Ecom:Product.PurchaseQuantityStep"); 42 if (quantityStep < 1) 43 { 44 quantityStep = 1; 45 } 46 47 // Images and files 48 string grpId = GetString("Ecom:Product.PrimaryOrFirstGroupID"); 49 var getGroup = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(grpId); 50 string groupImageLarge = getGroup != null && !string.IsNullOrWhiteSpace(getGroup.LargeImage) ? "Files/" + getGroup.LargeImage : string.Empty; 51 52 string productImage = "/Files/System/Images/Shop/na-image.jpg"; 53 if (!string.IsNullOrWhiteSpace(GetString("Ecom:Product.ImageNZProductImage.Clean"))) 54 { 55 productImage = GetString("Ecom:Product.ImageNZProductImage.Clean"); 56 } 57 else if (!string.IsNullOrWhiteSpace(groupImageLarge)) 58 { 59 productImage = groupImageLarge; 60 } 61 string productImageFullurl = "https://www.junget.com/" + productImage; 62 63 string productFigure = GetString("Ecom:Product.ImageNZProductFigure.Clean"); 64 string productFigure2 = GetString("Ecom:Product.ImageNZProductFigure2.Clean"); 65 string productFigure3 = GetString("Ecom:Product.ImageNZProductFigure3.Clean"); 66 string productFigure4 = GetString("Ecom:Product.ImageNZProductFigure4.Clean"); 67 string productFigure5 = GetString("Ecom:Product.ImageNZProductFigure5.Clean"); 68 string productFigure6 = GetString("Ecom:Product.ImageNZProductFigure6.Clean"); 69 70 71 string youtubeId = GetString("Ecom:Product:Field.YoutubeId"); 72 73 74 // Price 75 string productPrice = GetString("Ecom:Product.Price.PriceWithoutVATFormatted").Replace(",00", ",-"); 76 double productPriceDouble = GetDouble("Ecom:Product.Price.PriceWithoutVAT"); 77 string productName = GetString("Ecom:Product.Name"); 78 string productNumber = GetString("Ecom:Product.Number"); 79 string productVariantName = GetString("Ecom:Product:Field.VariantName"); 80 81 string longDescription = GetString("Ecom:Product.LongDescription"); 82 string teaserText = GetString("Ecom:Product.ShortDescription"); 83 string metaDescription = teaserText + longDescription; 84 85 string productSpecifications = GetString("Ecom:Product:Field.DJSpecifications"); 86 string userManuals = GetString("Ecom:Product:Field.UserManuals"); 87 int counter = 0; 88 string productFabrikat = GetString("Ecom:Product:Field.fabrikat").ToLower(); 89 90 if (string.IsNullOrEmpty(metaDescription)) 91 { 92 metaDescription = Translate("Besøg vores Webshop og find dit værktøj til gode priser.Tilmeld dig som bruger og få masser af fordele fx.nem genbestilling, Fri fragt v.køb over 2.000,.mm."); 93 } 94 metaDescription = Regex.Replace(System.Web.HttpUtility.HtmlDecode(metaDescription.Trim().Replace(System.Environment.NewLine, " ")), "<.*?>", String.Empty); 95 if (metaDescription.Length > 155) 96 { 97 metaDescription = metaDescription.Substring(0, 155); 98 } 99 100 //set meta title to productname 101 Dynamicweb.Frontend.PageView.Current().Meta.Title = productName; 102 103 User mainUserHeader = Pageview.User?.CurrentSecondaryUser != null ? Pageview.User.CurrentSecondaryUser : Pageview.User; 104 105 var productId = GetString("Ecom:Product.ID"); 106 var productVariantId = GetString("Ecom:Product.VariantID"); 107 var productLanguageId = GetString("Ecom:Product.LanguageID"); 108 var _productService = new Dynamicweb.Ecommerce.Products.ProductService(); 109 var schemaProduct = _productService.GetProductById(productId, productVariantId, productLanguageId); 110 111 112 //skal hentes på en anden måde, så det bliver den gyldige pris fra ribbon price 113 double webPrice = 0; 114 115 //fields 116 var productApi = Dynamicweb.Ecommerce.Services.Products.GetProductById(GetString("Ecom:Product.ID"), null, false); 117 var fields = productApi.ProductFieldValues; 118 119 //get prices 120 var prices = productApi.Prices; 121 bool hasCombinations = productApi.VariantCombinations.Any(); 122 123 //get campaign name 124 string campaignName = ""; 125 double oldPrice = 0; 126 double oldPriceVat = 0; 127 string oldPriceCurrency = ""; 128 129 var userToTakePriceFrom = Pageview.User; 130 foreach (var priceFromMatrix in prices) 131 { 132 if (Helpers.Product.IsPriceValid(priceFromMatrix)) 133 { 134 135 if (userToTakePriceFrom != null) 136 { 137 if (!string.IsNullOrEmpty(userToTakePriceFrom.Currency) && priceFromMatrix.CurrencyCode == userToTakePriceFrom.Currency) 138 { 139 webPrice = priceFromMatrix.Amount; 140 } 141 142 if (priceFromMatrix.CurrencyCode == "DKK" && string.IsNullOrEmpty(userToTakePriceFrom.Currency)) 143 { 144 webPrice = priceFromMatrix.Amount; 145 } 146 } 147 else if (priceFromMatrix.CurrencyCode == Pageview.Area.EcomCurrencyId) 148 { 149 150 webPrice = priceFromMatrix.Amount; 151 152 } 153 else 154 { 155 webPrice = priceFromMatrix.Amount; 156 } 157 158 } 159 160 161 162 if (priceFromMatrix.Amount == GetDouble("Ecom:Product.Price.PriceWithoutVAT.Value") && Helpers.Product.IsCampaingPrice(priceFromMatrix) 163 && Helpers.Product.IsPriceValid(priceFromMatrix)) 164 { 165 campaignName = priceFromMatrix.Periods.FirstOrDefault()?.Name; 166 foreach (var priceFromMatrix2 in prices) 167 { 168 169 170 if (priceFromMatrix2.Amount != GetDouble("Ecom:Product.Price.PriceWithoutVAT.Value") && 171 !Helpers.Product.IsCampaingPrice(priceFromMatrix2) && Helpers.Product.IsPriceValid(priceFromMatrix2)) 172 { 173 174 if (Pageview.Area.EcomCurrencyId == priceFromMatrix2.CurrencyCode) 175 { 176 oldPrice = priceFromMatrix2.Amount; 177 oldPriceVat = priceFromMatrix2.Amount * 1.25; 178 oldPriceCurrency = priceFromMatrix2.CurrencyCode; 179 break; 180 } 181 182 } 183 } 184 185 } 186 } 187 188 List<Dynamicweb.Ecommerce.Products.Group> 189 empty = new List<Dynamicweb.Ecommerce.Products.Group> 190 (); 191 bool isSparePartGroup = schemaProduct.Groups.FirstOrDefault().ProductGroupFieldValues.GetProductGroupFieldValue("Spareparts").Value.ToString() == "True"; 192 193 //Addtional items 194 195 var extraItems = GetLoop("ProductRelatedGroups"); 196 List<string> 197 possibleExtraItems = new List<string> 198 (); 199 possibleExtraItems.Add("Tilvalg_motor"); 200 possibleExtraItems.Add("Tilvalg_tilbehør"); 201 possibleExtraItems.Add("Tilvalg_forridser"); 202 possibleExtraItems.Add("Tilvalg_Snitbredde"); 203 possibleExtraItems.Add("Tilvalg_Snitlængde"); 204 possibleExtraItems.Add("Tilvalg_installation"); 205 possibleExtraItems.Add("Tilvalg_Værktøj"); 206 possibleExtraItems.Add("Tilvalg_test"); 207 possibleExtraItems.Add("Tilvalg_test2"); 208 List<LoopItem> 209 extraLoopItems = new List<LoopItem> 210 (); 211 212 foreach (var item in extraItems) 213 { 214 if (possibleExtraItems.Contains(item.GetString("Ecom:Product:RelatedGroup.Name"))) 215 { 216 var currentProducts = item.GetLoop("RelatedProducts"); 217 var hasItems = false; 218 219 //Checks if item in itemgroup has any items with webshop ok before adding 220 foreach (var product in currentProducts) 221 { 222 if (product.GetString("Ecom:Product:Field.WebshopOK.Value") == "True") 223 { 224 hasItems = true; 225 } 226 227 } 228 //if it has items with webshop ok, add it to list 229 if (hasItems) 230 { 231 extraLoopItems.Add(item); 232 } 233 } 234 } 235 236 bool showWebDiscountMessage = false; 237 bool webDiscountIsNotEmpty = !string.IsNullOrEmpty(GetString("Ecom:Product:Field.WebDiscount")) && GetString("Ecom:Product:Field.WebDiscount") != "0"; 238 bool webDiscountIsLowest = false; 239 240 double customerPrice = GetDouble("Ecom:Product.Price.PriceWithoutVAT"); 241 242 if (webPrice <= customerPrice) 243 { 244 webDiscountIsLowest = true; 245 } 246 247 var priceCurrency = GetString("Ecom:Product.Currency"); 248 249 if (webDiscountIsNotEmpty) 250 { 251 252 if (!User.IsExtranetUserLoggedIn()) 253 { 254 showWebDiscountMessage = true; 255 } 256 else if (User.IsExtranetUserLoggedIn() && webDiscountIsLowest) 257 { 258 showWebDiscountMessage = true; 259 } 260 } 261 262 //if productVariantid, then get the min and max for customSize 263 int customSizeMin = 0; 264 int customSizeMax = 10000000; 265 if (!String.IsNullOrEmpty(productVariantId) && productVariantId.Contains("-")) 266 { 267 var customSize = productVariantId.Split('-'); 268 customSizeMin = Dynamicweb.Core.Converter.ToInt32(customSize[0]); 269 customSizeMax = Dynamicweb.Core.Converter.ToInt32(customSize[1]); 270 } 271 } 272 273 @* Set product canonical URL *@ 274 @SnippetStart("canonical") 275 @{ 276 string host = GetGlobalValue("Global:Request.Host"); 277 string url = GetGlobalValue("Global:Pageview.Url"); 278 int queryIndex = url.IndexOf("?", StringComparison.Ordinal); 279 if (queryIndex > -1) 280 { 281 url = url.Substring(0, queryIndex); 282 } 283 } 284 285 <meta name="description" content="@metaDescription" /> 286 287 <link rel="canonical" href="https://@host@url"> 288 @SnippetEnd("canonical") 289 290 <section class="product-details js-photoswipe"> 291 <div class="container-fluid"> 292 <div class="row no-gutters"> 293 @* Product images *@ 294 <div class="col-12 col-md-6"> 295 @{ 296 Image productImageSize = System.Drawing.Image.FromFile(System.Web.HttpContext.Current.Server.MapPath(productImage)); 297 <div class="d-block"> 298 <a class="mb-3" href="/Admin/Public/GetImage.ashx?Image=@productImage&Width=@productImageSize.Width&Height=@productImageSize.Height&Compression=75&Format=webP" data-fancybox="gallery" data-caption="@productName"> 299 <img class="img-fluid" src="/Admin/Public/GetImage.ashx?Image=@productImage&Width=483&Height=416&format=webP&Compression=75&Background=ffffff&fillcanvas=true" alt="@productName"> 300 </a> 301 </div> 302 303 if (!String.IsNullOrEmpty(productFigure)) 304 { 305 Image productFigureSize = System.Drawing.Image.FromFile(System.Web.HttpContext.Current.Server.MapPath(productFigure)); 306 <div class="d-inline-block"> 307 <a class="mt-3 mr-3 d-inline-block" href="/Admin/Public/GetImage.ashx?Image=@productFigure&Width=@productFigureSize.Width&Height=@productFigureSize.Height&Compression=75&Format=webP" data-fancybox="gallery" data-caption="@productName"> 308 <img class="img-fluid" src="/Admin/Public/GetImage.ashx?Image=@productFigure&width=110&height=100&format=webP&Compression=75&crop=0&Background=ffffff&fillcanvas=true" alt="@productName"> 309 </a> 310 </div> 311 } 312 if (!String.IsNullOrEmpty(productFigure2)) 313 { 314 Image productFigure2Size = System.Drawing.Image.FromFile(System.Web.HttpContext.Current.Server.MapPath(productFigure2)); 315 <div class="d-inline-block"> 316 <a class="mt-3 mr-3 d-inline-block" href="/Admin/Public/GetImage.ashx?Image=@productFigure2&Width=@productFigure2Size.Width&Height=@productFigure2Size.Height&Compression=75&Format=webP" data-fancybox="gallery" data-caption="@productName"> 317 <img class="img-fluid" src="/Admin/Public/GetImage.ashx?Image=@productFigure2&width=110&height=100&format=webP&Compression=75&crop=0&Background=ffffff&fillcanvas=true" alt="@productName"> 318 </a> 319 </div> 320 } 321 322 if (!String.IsNullOrEmpty(productFigure3)) 323 { 324 Image productFigure3Size = System.Drawing.Image.FromFile(System.Web.HttpContext.Current.Server.MapPath(productFigure3)); 325 <div class="d-inline-block"> 326 <a class="mt-3 mr-3 d-inline-block" href="/Admin/Public/GetImage.ashx?Image=@productFigure3&Width=@productFigure3Size.Width&Height=@productFigure3Size.Height&Compression=75&Format=webP" data-fancybox="gallery" data-caption="@productName"> 327 <img class="img-fluid" src="/Admin/Public/GetImage.ashx?Image=@productFigure3&width=110&height=100&format=webP&Compression=75&crop=0&Background=ffffff&fillcanvas=true" alt="@productName"> 328 </a> 329 </div> 330 } 331 if (!String.IsNullOrEmpty(productFigure4)) 332 { 333 Image productFigure4Size = System.Drawing.Image.FromFile(System.Web.HttpContext.Current.Server.MapPath(productFigure4)); 334 <div class="d-inline-block"> 335 <a class="mt-3 mr-3 d-inline-block" href="/Admin/Public/GetImage.ashx?Image=@productFigure4&Width=@productFigure4Size.Width&Height=@productFigure4Size.Height&Compression=75&Format=webP" data-fancybox="gallery" data-caption="@productName"> 336 <img class="img-fluid" src="/Admin/Public/GetImage.ashx?Image=@productFigure4&width=110&height=100&format=webP&Compression=75&crop=0&Background=ffffff&fillcanvas=true" alt="@productName"> 337 </a> 338 </div> 339 } 340 if (!String.IsNullOrEmpty(productFigure5)) 341 { 342 Image productFigure5Size = System.Drawing.Image.FromFile(System.Web.HttpContext.Current.Server.MapPath(productFigure5)); 343 <div class="d-inline-block"> 344 <a class="mt-3 mr-3 d-inline-block" href="/Admin/Public/GetImage.ashx?Image=@productFigure5&Width=@productFigure5Size.Width&Height=@productFigure5Size.Height&Compression=75&Format=webP" data-fancybox="gallery" data-caption="@productName"> 345 <img class="img-fluid" src="/Admin/Public/GetImage.ashx?Image=@productFigure5&width=110&height=100&format=webP&Compression=75&crop=0&Background=ffffff&fillcanvas=true" alt="@productName"> 346 </a> 347 </div> 348 } 349 if (!String.IsNullOrEmpty(productFigure6)) 350 { 351 Image productFigure6Size = System.Drawing.Image.FromFile(System.Web.HttpContext.Current.Server.MapPath(productFigure6)); 352 <div class="d-inline-block"> 353 <a class="mt-3 mr-3 d-inline-block" href="/Admin/Public/GetImage.ashx?Image=@productFigure6&Width=@productFigure6Size.Width&Height=@productFigure6Size.Height&Compression=75&Format=webP" data-fancybox="gallery" data-caption="@productName"> 354 <img class="img-fluid" src="/Admin/Public/GetImage.ashx?Image=@productFigure6&width=110&height=100&format=webP&Compression=75&crop=0&Background=ffffff&fillcanvas=true" alt="@productName"> 355 </a> 356 </div> 357 } 358 <div class="d-inline-block video-item"> 359 @if (!string.IsNullOrWhiteSpace(youtubeId)) 360 { 361 string youtubeUrl = "https://youtube.com/embed/" + youtubeId; 362 var uri = new Uri(youtubeUrl); 363 364 <a href="@youtubeUrl?autoplay=1" class="video-play-btn js-video-button mt-3 mr-3 d-inline-block" data-type="youtube" style="position:relative"> 365 <picture> 366 <!--[if IE 9]><video style="display: none;"><![endif]--> 367 <source srcset="https://img.youtube.com/vi/@youtubeId/hqdefault.jpg 2x" media="(min-width: 576px)"> 368 <!--[if IE 9]></video><![endif]--> 369 <img class="w-100 img-fluid" src="https://img.youtube.com/vi/@youtubeId/hqdefault.jpg" alt=""> 370 </picture> 371 <div class="video js-video_bcg"></div> 372 <div class="video-play-icon video-play-icon--small">PLAY</div> 373 </a> 374 } 375 </div> 376 } 377 </div> 378 <div class="col-12 col-md-6 pl-0 pl-md-4 mt-7 mt-md-0"> 379 @if (!string.IsNullOrEmpty(campaignName)) 380 { 381 string discountImage = ""; //@TODO hvad skal vi gøre med billeder? 382 bool blackFriday = false; //@TODO hvad skal vi gøre med black friday? 383 <div class="mb-8"> 384 @if (!String.IsNullOrEmpty(discountImage)) 385 { 386 <img src="@discountImage" alt="Kampagne billede" /> 387 } 388 else if (blackFriday) 389 { 390 <div class="product-details__promo-badge blackfriday-badge float-left">@Translate("ecom-campaigne-blackfriday", "Black Friday")</div> 391 } 392 else 393 { 394 <div class="product-details__promo-badge float-left">@Translate("Campaign-" + campaignName, campaignName)</div> 395 } 396 397 </div> 398 } 399 400 @if (internalProduct && !webshopOK) 401 { 402 <img src="/Files/System/Images/Shop/Webshop_logo_intern.jpg" alt="Internt produkt" class="mb-4" height="70" /> 403 } 404 405 <h1 class="h2 mb-5">@productName</h1> 406 <div class="mb-7">@Translate("ProductNumber", "Varenummer") @productNumber</div> 407 @if (mainUserHeader != null && mainUserHeader.HasGroup(24)) 408 { 409 string image = VestjyskMarketing.Helpers.ImageHelper.ResizeImage(new ResizeImageSettings() 410 { 411 Image = "/Files/Files/Images/img_calculator.png", 412 Height = 96, 413 Width = 96, 414 Quality = 85 415 }); 416 417 string sPrice = GetDouble("Ecom:Product.DBPrice").ToString("F2"); 418 string wPrice = webPrice.ToString("F2"); 419 string webDiscount = Dynamicweb.Core.Converter.ToDouble(productApi.GetProductFieldValue("WebDiscount")).ToString("F2"); 420 string cost = Dynamicweb.Core.Converter.ToString(productApi.Cost); 421 string externalNumber = Dynamicweb.Core.Converter.ToString(productApi.GetProductFieldValue("ExterntNummer")); 422 string manufacturer = productApi.Manufacturer != null ? productApi.Manufacturer.Name : ""; 423 string discountGroup = Dynamicweb.Core.Converter.ToString(productApi.GetProductFieldValue("ItemDiscGroup")); 424 425 if (addDaysToLeadtimeCalculationDate == 0) 426 { 427 <div> 428 Beholdning: 429 (@GetInteger("Ecom:Product.Stock") @Translate("stk.")) 430 </div> 431 } 432 433 <div class="d-flex flex-row align-items-end"> 434 <div> 435 <div> 436 @Translate("Bruttopris", "Bruttopris"): @sPrice 437 </div> 438 439 <div> 440 @Translate("Webpris", "Webpris"): @wPrice 441 </div> 442 </div> 443 <div class="product-item__details ml-6"> 444 <img src="@image" class="product-item__details__image"> 445 <div class="product-item__details__tooltip"> 446 <div class="row"> 447 <div class="col-7"> 448 @Translate("Bruttopris", "Bruttopris"): 449 </div> 450 <div class="col-5"> 451 @sPrice 452 </div> 453 <div class="col-7"> 454 @Translate("Webrabat", "Webrabat") %: 455 </div> 456 <div class="col-5"> 457 @webDiscount 458 </div> 459 <div class="col-7"> 460 @Translate("Webpris", "Webpris"): 461 </div> 462 <div class="col-5"> 463 @wPrice 464 </div> 465 <div class="col-7"> 466 @Translate("Cost", "Kostpris"): 467 </div> 468 <div class="col-5"> 469 @cost 470 </div> 471 <div class="col-7"> 472 @Translate("Manufacturer's number", "Leverandørens varenr"): 473 </div> 474 <div class="col-5"> 475 @externalNumber 476 </div> 477 <div class="col-7"> 478 @Translate("Manufacturer", "Levenrandør"): 479 </div> 480 <div class="col-5"> 481 @manufacturer 482 </div> 483 <div class="col-7"> 484 @Translate("DiscountGroup", "Varerabatgruppe"): 485 </div> 486 <div class="col-5"> 487 @discountGroup 488 </div> 489 </div> 490 </div> 491 </div> 492 </div> 493 } 494 @if (minQuantity > 1) 495 { 496 <div><strong>@Translate("Minimumskøb:", "Minimumskøb:")</strong> @minQuantity @Translate("stk.")</div> 497 } 498 499 @if (grpId == "W2-1") 500 { 501 <div class="mb-8"> 502 @{ 503 Dynamicweb.Content.ParagraphService paragraphService = new Dynamicweb.Content.ParagraphService(); 504 Dynamicweb.Content.Paragraph paragraph = paragraphService.GetParagraph(11486); 505 506 if (paragraph != null) 507 { 508 @paragraph.Text 509 } 510 } 511 </div> 512 } 513 514 @{ 515 var itemQuality = GetLoop("quality_dd.Options").Where(item => item.GetBoolean("quality_dd.Option.IsSelected")).FirstOrDefault(); 516 } 517 518 <div class="mb-4 d-flex flex-row align-items-center"> 519 <div class="popup-wrap favorite"> 520 <button class="popup-show" data-popup="favorite-list" type="button" title="@Translate("Add to favorites", "Add to favorites")"><i class="icon icon-heart"></i> </button> 521 <div id="favorite-list" class="popup-form"> 522 <div class="close"> 523 <i class="icon icon-close"></i> 524 </div> 525 <h3>@Translate("Choose list", "Choose list")</h3> 526 <ul> 527 @{ 528 if (Dynamicweb.Frontend.PageView.Current().User != null) 529 { 530 var lists = Dynamicweb.Ecommerce.CustomerCenter.CustomerProductList.GetListByCustomerId(Dynamicweb.Frontend.PageView.Current().User.ID); 531 532 foreach (var list in lists) 533 { 534 535 if (list.Products.Where(p => p.ProductId.ToString() == GetString("Ecom:Product.ID")).Count() > 0) 536 { 537 <li><i class="icon icon-heart-solid"></i> <a href="@(System.Web.HttpContext.Current.Request.Url)&CCRemoveFromMyLists=@GetString("Ecom:Product.ID")&CCAddToListVariantID=&CCAddToListLanguageID=LANG1&CCAddToListID=@list.ListId&CCListType=">@list.Name</a></li> 538 } 539 else 540 { 541 <li><i class="icon icon-heart"></i> <a href="@(System.Web.HttpContext.Current.Request.Url)&CCAddToMyLists=@GetString("Ecom:Product.ID")&CCAddToListVariantID=&CCAddToListLanguageID=LANG1&CCAddToListID=@list.ListId&CCListType=">@list.Name</a></li> 542 } 543 } 544 } 545 } 546 <li><i class="icon icon-plus"></i> <a href="/da-dk/favoritlister?CC11503=CreateFormList">@Translate("Add new list", "Add new list")</a></li> 547 </ul> 548 </div> 549 </div> 550 </div> 551 552 @* Variants *@ 553 @{ 554 var pageServiceNew = new Dynamicweb.Content.PageService(); 555 var pagesNew = pageServiceNew.GetPagesForItems(new string[] { "PageShopList" }); 556 var variantsGroup = GetLoop("ProductRelatedGroups").FirstOrDefault(g => g.GetString("Ecom:Product:RelatedGroup.Name") == "Variants"); 557 } 558 @if (variantsGroup != null) 559 { 560 var activeProducts = variantsGroup.GetLoop("RelatedProducts").Where(p => p.GetBoolean("Ecom:Product:Field.WebshopOK") && !string.IsNullOrEmpty(p.GetString("Ecom:Product:Field.VariantName"))); 561 if (activeProducts.Count() > 0) 562 { 563 <div class="container"> 564 <div class="row product-details__related-products"> 565 <div class="accordion"> 566 <div class="card"> 567 <div class="card-header product-details__related-products__header" id="faqhead1"> 568 <a href="#" class="btn btn-header-link" data-toggle="collapse" data-target="#faq1" 569 aria-expanded="false" aria-controls="faq1"> 570 <span> 571 @productVariantName 572 </span> 573 <span class="arrow"> </span> 574 <span class="variants"> 575 @activeProducts.Count() @Translate("varianter", "varianter") 576 </span> 577 </a> 578 </div> 579 580 <div id="faq1" class="collapse" aria-labelledby="faqhead1" data-parent="#faq"> 581 <div> 582 @foreach (LoopItem related in activeProducts) 583 { 584 int jungStockNumber = Dynamicweb.Core.Converter.ToInt32(related.GetString("Ecom:Product:Field.jung_stock").Replace("D", "")); 585 string relatedProductGroupId = related.GetString("Ecom:Product.PrimaryOrFirstGroupID"); 586 string relatedGroupImage = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(relatedProductGroupId) != null && !string.IsNullOrWhiteSpace(Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(relatedProductGroupId).LargeImage) ? "Files/" + Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(relatedProductGroupId).LargeImage : "/webroot/images/na-image.jpg"; 587 string productRelatedImage = !string.IsNullOrWhiteSpace(related.GetString("Ecom:Product.ImageNZProductImage.Clean")) ? related.GetString("Ecom:Product.ImageNZProductImage.Clean") : relatedGroupImage; 588 589 //set URL for page. To get correct URL all places in regards to list 590 var group = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(related.GetString("Ecom:Product.PrimaryOrFirstGroupID")); 591 int pageNumber = 0; 592 foreach (var page in pagesNew) 593 { 594 var shopGroupPage = Dynamicweb.Core.Converter.ToString(page.Item["ShopCategoryNumber"]); 595 if (group != null && shopGroupPage == group.Number && page.AreaId.Equals(Pageview.AreaID)) 596 { 597 pageId = page.ID; 598 break; 599 } 600 } 601 string productPageUrl = "/Default.aspx?ID=" + pageId + "&ProductID=" + related.GetString("Ecom:Product.ID"); 602 if (pageId == 0) 603 { 604 productPageUrl = related.GetString("Ecom:Product.Link.Clean"); 605 } 606 string variantProductFabrikat = related.GetString("Ecom:Product:Field.fabrikat").ToLower(); 607 608 <a href="@productPageUrl" class="product-details__related-products__item"> 609 <div class="product-details__related-products__item__title">@related.GetString("Ecom:Product:Field.VariantName")</div> 610 @if ((variantProductFabrikat == "leitz" && Pageview.User != null) || variantProductFabrikat != "leitz") 611 { 612 <div class="product-details__related-products__item__price"> 613 <div class="lazyload-price lazyload-price-dash" data-id="@related.GetString("Ecom:Product.ID")" data-variantid="@related.GetString("Ecom:Product.VariantID")"><img src="/Files/Images/loading.gif"><span>@related.GetString("Ecom:Product.ActualPriceWithoutVAT").Replace(",00", ",-")</span></div> 614 </div> 615 } 616 <div class="product-details__related-products__item__stock"> 617 @if (jungStockNumber > 0 && jungStockNumber < 3) 618 { 619 @Translate("pa-lager", "På lager") <span class="product-details__related-products__item__stock__in-stock"></span> 620 } 621 else 622 { 623 624 string jungStockTextRelated = Helpers.Product.GetJungStock(related.GetString("Ecom:Product:Field.jung_stock"), related.GetInteger("Ecom:Product.Stock")); 625 626 if (variantProductFabrikat != "leitz" && !String.IsNullOrEmpty(jungStockTextRelated)) 627 { 628 <div class="product-details__stock-info"> 629 <span class="text-success">@jungStockTextRelated</span> 630 @if (jungStockNumber < 10 || GetInteger("Ecom:Product.Stock") > 0) 631 { 632 <span class="product-details__related-products__item__stock__in-stock"></span> 633 } 634 </div> 635 636 } 637 else 638 { 639 @Translate("ikke-pa-lager", "Ikke på lager") <span class="product-details__related-products__item__stock__not-in-stock"></span> 640 } 641 } 642 </div> 643 </a> 644 } 645 </div> 646 </div> 647 </div> 648 </div> 649 </div> 650 </div> 651 } 652 } 653 @* Variants end *@ 654 655 656 @* Product price *@ 657 @if (productFabrikat != "leitz") 658 { 659 660 661 <div class="mb-1 mb-md-5 text-success font-weight-bold product-details__price"> 662 663 664 665 @if (!String.IsNullOrEmpty(campaignName) && oldPrice > 0 && !User.IsExtranetUserLoggedIn()) 666 { 667 668 669 if (showWebDiscountMessage) 670 { 671 672 <div class="product-details__web-discount">@Translate("ecom-web-price-only")</div> 673 } 674 675 <div class="product-details__price-container"> 676 <div class="price-offer"> 677 <div class="product-details__price-item">@productPrice</div> 678 <div class="product-details__price-withvat">( @Translate("ecom-price-incl-vat", "Vat included") @GetString("Ecom:Product.Price.PriceWithVATFormatted").Replace(",00", ",-"),-)</div> 679 </div> 680 <div class="price-before"> 681 <span class="product-details__price-before">@oldPriceCurrency @oldPrice,-</span> 682 <div class="product-details__price-before product-details__price-withvat">( @Translate("ecom-price-incl-vat", "Vat included") @oldPriceCurrency @oldPriceVat,- )</div> 683 684 685 </div> 686 </div> 687 } 688 else 689 { 690 691 if (showWebDiscountMessage) 692 { 693 694 <div class="product-details__web-discount">@Translate("ecom-web-price-only")</div> 695 } 696 697 698 699 <div data-id="@GetString("Ecom:Product.ID")" data-variantid="@(hasCombinations ? "variantid" :"")" class="lazyload-price lazyload-price-main"> 700 <span> 701 <div>@productPrice</div> 702 </span> 703 <img class="productview" src="/Files/Images/loading.gif"> 704 </div> 705 706 <div class="product-details__price-withvat" style="visibility: hidden">( @Translate("ecom-price-incl-vat", "Vat included") <span data-id="@GetString("Ecom:Product.ID")" data-variantid="@(hasCombinations ? "variantid" : "")" class="lazyload-price lazyload-price-with-vat lazyload-price-main">@GetString("Ecom:Product.Price.PriceWithVATFormatted").Replace(",00", ",-")</span> )</div> 707 708 } 709 </div> 710 711 <div class="mb-2 product-details__stock-info"><span class="text-success">@jungStockText</span></div> 712 713 714 } 715 else if (User.IsExtranetUserLoggedIn()) 716 { 717 <div class="mb-5 mb-md-9 text-success font-weight-bold product-details__price"> 718 <div>@productPrice</div> 719 <div class="product-details__price-withvat">( @Translate("ecom-price-incl-vat", "Vat included") @GetString("Ecom:Product.Price.PriceWithVATFormatted").Replace(",00", ",-") )</div> 720 </div> 721 722 <div class="mb-2 product-details__stock-info"><span class="text-success">@jungStockText</span></div> 723 } 724 else 725 { 726 <div class="d-inline-block ml-auto flex-row no-wrap"> 727 <div class="align-self-end px-4 d-md-inline-block product-details-login">@Translate("Log ind for at se prisen")</div> 728 <button type="button" class="btn btn-success align-self-end d-md-inline-block js-aside-btn" href="#" data-view="login">@Translate("HeaderLoginButton", "Login")</button> 729 </div> 730 } 731 732 @* Add to cart functionality *@ 733 @if (productFabrikat != "leitz") 734 { 735 <form id="ecomCart" class="js-product-form mt-5" name="ecomCart" method="post"> 736 @GetString("Ecom:Product.Form.Multi.HiddenFields") 737 738 <div class="form-group m-0 mt-4"> 739 @if (productApi.VariantCombinations.Any()) 740 { 741 <label for="customsize" class="m-0 col-form-label">@Translate("TextSelectVariant", "Vælg variant")</label> 742 <select id="product-options" class="js-radio-container js-product-variant-select js-required-select form-control" name="variant" required> 743 <option value="" disabled selected hidden>@Translate("TextSelectVariant", "Vælg variant")</option> 744 745 @foreach (var variant in productApi.VariantCombinations) 746 { 747 string isSelected = variant.VariantId == GetString("Ecom:Product.VariantID") ? "selected" : null; 748 string link = "Default.aspx?ID=" + Pageview.Page.ID + "&ProductID=" + variant.ProductId + "&VariantID=" + variant.VariantId; 749 <option @isSelected value="@variant.VariantId" data-variantlink="@link"> 750 @variant.GetVariantName(Pageview.Area.EcomLanguageId) 751 </option> 752 } 753 754 </select> 755 } 756 @foreach (LoopItem item in GetLoop("Product.OrderLineFields")) 757 { 758 if (item.GetString("Ecom:Product.OrderLineField.SystemName") == "DeliveryPromised") 759 { 760 <input name="EcomOrderLineFieldInput_DeliveryPromised1" type="hidden" value="@jungStockText"> 761 762 } 763 else if (item.GetString("Ecom:Product.OrderLineField.SystemName") == "LeadtimeCalculationDate") 764 { 765 <input name="EcomOrderLineFieldInput_LeadtimeCalculationDate1" type="hidden" value="@DateTime.Today.AddDays(addDaysToLeadtimeCalculationDate).ToString("yyyy-MM-dd")"> 766 } 767 else 768 { 769 <label for="customsize" class="col-form-label">@Translate(item.GetString("Ecom:Product.OrderLineField.Name"))</label> 770 <input id="customsize" name="EcomOrderLineFieldInput_customSizeAdded1" class="form-control input mb-3" type="number" placeholder="Eks. 3650" min="@customSizeMin" max="@customSizeMax" required> 771 } 772 773 } 774 </div> 775 776 <input type="hidden" name="@GetString("Ecom:Product:Field.customsize.Value")" id="@GetString("Ecom:Product:Field.customsize.Value")" value="@GetString("Ecom:Product:Field.customsize.Value")"> 777 <div class="d-flex flex-row align-items-top justify-content-between"> 778 779 <div class="w-100 d-flex align-items-end"> 780 781 782 <div class="input-group product-item__quantity-wrapper"> 783 <span class="input-group-btn"> 784 <button class="btn btn-buy js-product-quantity-subtract" type="button"><span class="icon icon-minus"></span></button> 785 </span> 786 <input type="text" autocomplete="off" class="form-control text-center js-quantity-input" name="Quantity1" min="@minQuantity" value="@minQuantity" data-step="@quantityStep"> 787 788 789 <span class="input-group-btn"> 790 <button class="btn btn-buy js-product-quantity-add" type="button"><span class="icon icon-plus"></span></button> 791 </span> 792 </div> 793 </div> 794 795 <div class="pl-7 w-100"> 796 797 @if (extraLoopItems.Count > 0) 798 { 799 <div class="product-item__basket-notification js-basket-notification"> 800 801 <a class="js-cta-button w-100 btn btn-secondary ml-auto align-self-end px-4 d-md-inline-block"> 802 <span class="icon mr-4"></span> 803 <span class="text-uppercase product-item__basket-notification__buttons">Gå til tilkøb</span> 804 </a> 805 </div> 806 } 807 808 <div class="product-item__basket-notification js-basket-notification mt-5"> 809 <div class="product-item__basket-notification-inner"> 810 <img class="product-item__basket-notification-image" src="/webroot/images/loading-bubbles.svg" title="Loading"> 811 </div> 812 <button type="submit" class="js-product-add-to-basket add-multi-basket w-100 btn btn-success ml-auto align-self-end px-4 d-md-inline-block"> 813 <span class="icon icon-shopping-cart mr-4"></span> 814 <span class="text-uppercase product-item__basket-notification__buttons">@Translate("ecom-add-to-basket", "Læg i kurv")</span> 815 </button> 816 </div> 817 818 819 820 </div> 821 </div> 822 823 824 <input name="cartcmd" value="addmulti" type="hidden"> 825 826 827 @if (mainUserHeader != null && mainUserHeader.HasGroup(24)) 828 { 829 <input type="hidden" name="OrderContext" id="OrderContext" value="ORDERCONTEXT2"> 830 } 831 </form> 832 } 833 else if (User.IsExtranetUserLoggedIn()) 834 { 835 <form id="ecomCart" class="js-product-form" name="ecomCart" method="post"> 836 @GetString("Ecom:Product.Form.Multi.HiddenFields") 837 <div class="form-group"> 838 @if (productApi.VariantCombinations.Any()) 839 { 840 <label for="customsize" class="col-form-label">@Translate("TextSelectVariant", "Vælg variant")</label> 841 <select id="product-options" class="js-radio-container js-product-variant-select js-required-select form-control" name="variant" required> 842 <option value="" disabled selected hidden>@Translate("TextSelectVariant", "Vælg variant")</option> 843 @foreach (var variant in productApi.VariantCombinations) 844 { 845 string isSelected = variant.VariantId == GetString("Ecom:Product.VariantID") ? "selected" : null; 846 string link = "Default.aspx?ID=" + Pageview.Page.ID + "&ProductID=" + variant.ProductId + "&VariantID=" + variant.VariantId; 847 <option @isSelected value="@variant.VariantId" data-variantlink="@link"> 848 @variant.GetVariantName(Pageview.Area.EcomLanguageId) 849 </option> 850 } 851 </select> 852 } 853 @foreach (LoopItem item in GetLoop("Product.OrderLineFields")) 854 { 855 if (item.GetString("Ecom:Product.OrderLineField.SystemName") == "DeliveryPromised") 856 { 857 <input name="EcomOrderLineFieldInput_DeliveryPromised1" type="hidden" value="@jungStockText"> 858 859 } 860 else if (item.GetString("Ecom:Product.OrderLineField.SystemName") == "LeadtimeCalculationDate") 861 { 862 <input name="EcomOrderLineFieldInput_LeadtimeCalculationDate1" type="hidden" value="@DateTime.Today.AddDays(addDaysToLeadtimeCalculationDate).ToString("yyyy-MM-dd")"> 863 } 864 else 865 { 866 <label for="customsize" class="col-form-label">@Translate(item.GetString("Ecom:Product.OrderLineField.Name"))</label> 867 <input id="customsize" name="EcomOrderLineFieldInput_customSizeAdded1" class="form-control input" type="number" placeholder="Eks. 3650" min="@customSizeMin" max="@customSizeMax" required> 868 } 869 870 } 871 </div> 872 <div class="d-flex flex-row align-items-top"> 873 <div class="input-group product-item__quantity-wrapper"> 874 <span class="input-group-btn"> 875 <button class="btn btn-buy js-product-quantity-subtract" type="button"><span class="icon icon-minus"></span></button> 876 </span> 877 <input type="text" autocomplete="off" class="form-control text-center js-quantity-input" name="Quantity1" min="@minQuantity" value="@minQuantity" data-step="@quantityStep"> 878 <span class="input-group-btn"> 879 <button class="btn btn-buy js-product-quantity-add" type="button"><span class="icon icon-plus"></span></button> 880 </span> 881 </div> 882 883 <div class="w-100 pl-7"> 884 <div class="product-item__basket-notification js-basket-notification"> 885 <div class="product-item__basket-notification-inner"> 886 <img class="product-item__basket-notification-image" src="/webroot/images/loading-bubbles.svg" title="Loading"> 887 </div> 888 <button type="submit" class="js-product-add-to-basket add-multi-basket w-100 btn btn-success ml-auto align-self-end px-4 d-md-inline-block"> 889 <span class="icon icon icon-shopping-cart mr-4"></span> 890 <span>@Translate("ecom-add-to-basket", "Læg i kurv")</span> 891 </button> 892 </div> 893 </div> 894 </div> 895 <input name="cartcmd" value="addmulti" type="hidden"> 896 @if (mainUserHeader != null && mainUserHeader.HasGroup(24)) 897 { 898 <input type="hidden" name="OrderContext" id="OrderContext" value="ORDERCONTEXT2"> 899 } 900 </form> 901 } 902 </div> 903 </div> 904 905 @*Product specs*@ 906 <div class="product-details__specs row no-gutters js-toggle-class" data-trigger-once="true"> 907 <button type="button" class="show-more-btn btn btn-outline-primary text-uppercase">@Translate("ecom-show-more", "Show more")</button> 908 <div class="col-12 col-md-6 pr-md-4"> 909 @{ 910 var disallowedFields = new List<string> { "Webshop OK", "Beholdning", "Kvalitet (God, Bedre og Bedst)", "VariantName", "Specifikationer", "Produktbeskrivelse", "InternalProduct", "Beholdning Tal", "Youtube video id", "WebDiscount" }; 911 var specificationsTitle = fields.FirstOrDefault(f => f.GetFieldName() == "Specifikations titel").Value.ToString(); 912 var productDescriptionTitle = fields.FirstOrDefault(f => f.GetFieldName() == "Produktbeskrivelse titel").Value.ToString(); 913 } 914 @if (specificationsTitle != null && !string.IsNullOrEmpty(specificationsTitle)) 915 { 916 <h2 class="mb-6">@specificationsTitle</h2> 917 } 918 else 919 { 920 <h2 class="mb-6">@Translate("ecom-specs", "Specs")</h2> 921 } 922 @{ 923 bool isSKUShown = false; 924 string skuNumber = ""; 925 var allowedProducers = new List<string> { "leitz", "sistemi", "biesse", "gjerde", "maggi", "weinig", "robland", "altendorf", "striebig" }; 926 927 if (allowedProducers.Contains(productFabrikat)) 928 { 929 isSKUShown = true; 930 var skuNumberField = fields.FirstOrDefault(f => f.GetFieldName().Equals("ExterntNummer")); 931 if (skuNumberField != null) 932 { 933 skuNumber = skuNumberField.Value.ToString(); 934 } 935 } 936 } 937 <dl class="row no-gutters mb-6"> 938 939 @foreach (var item in fields) 940 { 941 if (item.ProductField.DoNotRender == true || String.IsNullOrEmpty(item.Value.ToString()) || item.Value.ToString() == "0" || item.Value.ToString() == "0,00" || disallowedFields.Contains(item.GetFieldName()) 942 || (item.GetFieldName() == "Fabrikat" && !isSKUShown)) 943 { 944 continue; 945 } 946 947 string fieldValue = item.Value.ToString(); 948 string fieldName = item.GetFieldName(); 949 950 //the most dumt way to get out these values. I dont know why - but I am afraid to change the logic if it is needed, so create fallback and all sorts. 951 if (item.ProductField.TypeId == 15) 952 { 953 bool useTranslationDwFields = false; 954 foreach (var loopCustom in GetLoop("CustomFieldValues")) 955 { 956 loopCustom.Values.TryGetValue("Product.CustomField.Value.Clean", out object valueCustomFieldValue); 957 if (valueCustomFieldValue != null) 958 { 959 if (valueCustomFieldValue.ToString() == fieldValue) 960 { 961 loopCustom.Values.TryGetValue("Product.CustomField.Label", out object fieldValueTemp); 962 fieldValue = fieldValueTemp.ToString(); 963 useTranslationDwFields = true; 964 break; 965 } 966 967 } 968 } 969 970 if (useTranslationDwFields == false) 971 { 972 var prodOptionCollection = Dynamicweb.Ecommerce.Services.FieldOptions.GetOptionsByFieldId(item.ProductField.Id); 973 foreach (var myOptions in prodOptionCollection) 974 { 975 if (myOptions.Value == item.Value.ToString()) 976 { 977 var translationField = myOptions.Translations.Get(productLanguageId); 978 979 if (translationField != null) 980 { 981 fieldValue = translationField.Name; 982 983 } 984 else 985 { 986 fieldValue = myOptions.GetName(productLanguageId); 987 } 988 break; 989 } 990 } 991 } 992 } 993 994 995 if (item.GetFieldName() == ("Fabrikat")) 996 { 997 fieldValue = skuNumber; 998 fieldName = Translate("Lev_varenr", "Lev. varenr."); 999 } 1000 1001 1002 counter++; 1003 string bgColor = counter % 2 == 1 ? "bg-light-gray" : ""; 1004 1005 <dt class="used-machine__specs-display col-12 col-sm-4 p-4 @bgColor">@fieldName</dt> 1006 <dd class="used-machine__specs-value col-12 col-sm-8 m-0 py-4 @bgColor"> 1007 @if (item.ProductField.TypeId == 9) 1008 { 1009 <a href="/Files/Images/@fieldValue" target="_blank">@Translate("Download") @fieldName</a> 1010 } 1011 else 1012 { 1013 1014 @fieldValue 1015 } 1016 </dd> 1017 } 1018 </dl> 1019 </div> 1020 <div class="col-12 col-md-6 pl-md-4"> 1021 @if (productDescriptionTitle != null && !string.IsNullOrEmpty(productDescriptionTitle)) 1022 { 1023 <h2 class="mb-6">@productDescriptionTitle</h2> 1024 } 1025 else 1026 { 1027 <h2 class="mb-6">@Translate("ecom-description", "Description")</h2> 1028 } 1029 <div class="mb-6"> 1030 @GetString("Ecom:Product.ShortDescription") @GetString("Ecom:Product.LongDescription") 1031 </div> 1032 </div> 1033 </div> 1034 1035 1036 1037 </div> 1038 1039 1040 1041 @* Tilvalg *@ 1042 1043 @{ 1044 1045 if (extraLoopItems.Count > 0) 1046 { 1047 1048 1049 <!-- Tilvalg--> 1050 <div class="w-100 h-100 " style="background-color: #e8e4ec"> 1051 <div class="pt-10"> 1052 <div class=""> 1053 <h2 class="mb-7 pl-10 pr-10 js-contact-form">Tilvalg</h2> 1054 </div> 1055 1056 @{ 1057 var productService = new Dynamicweb.Ecommerce.Products.ProductService(); 1058 List<string> colors = new List<string> { "#e8e4ec", "#f8f4f4" }; 1059 1060 } 1061 1062 1063 @{ 1064 1065 1066 var groupIndex = 0; 1067 var totalIndex = 0; 1068 foreach (LoopItem item in extraLoopItems) 1069 { 1070 string columnName = item.GetString("Ecom:Product:RelatedGroup.Name").Replace("Tilvalg_", ""); 1071 var items = item.GetLoop("RelatedProducts"); 1072 1073 //Checks if items has webshop as true 1074 List<LoopItem> okItems = new List<LoopItem>(); 1075 1076 1077 foreach (LoopItem _item in items) 1078 { 1079 1080 if (_item.GetString("Ecom:Product:Field.WebshopOK.Value") == "True") 1081 { 1082 1083 okItems.Add(_item); 1084 1085 } 1086 } 1087 1088 1089 items = okItems; 1090 1091 1092 <!--Række 1--> 1093 1094 1095 var color = ""; 1096 1097 if (groupIndex % 2 == 0) 1098 { 1099 color = colors[0]; 1100 1101 } 1102 else 1103 { 1104 color = colors[1]; 1105 } 1106 1107 groupIndex++; 1108 1109 <div style="background-color: @color"> 1110 <div class="pl-10 pr-10 pb-5"> 1111 1112 <div class="d-flex"> 1113 <div class="col-3 p-0 additional-container__text text-capitalize mt-5">@columnName</div> 1114 <div class="col-9 p-0 d-flex flex-wrap additional-container"> 1115 <div class="col-3 p-0 text-break additional-container__text"> 1116 </div> 1117 <div class="col-6 p-0"> </div> 1118 <div class="col-3 col-3 d-flex justify-content-end p-0 additional-container__text"> 1119 </div> 1120 </div> 1121 </div> 1122 1123 @{ 1124 var index = 0; 1125 var count = items.Count; 1126 } 1127 1128 @foreach (LoopItem subitem in items) 1129 { 1130 index++; 1131 totalIndex++; 1132 var name = subitem.GetString("Ecom:Product.Name"); 1133 var id = subitem.GetString("Ecom:Product.ID"); 1134 1135 var variantId = subitem.GetString("Ecom:Product.VariantID"); 1136 var product = productService.GetProductById(id, variantId, false); 1137 1138 var _prices = Website.Helpers.Product.GetProductLivePrices(product); 1139 var price = subitem.GetString("Ecom:Product.Price.PriceWithoutVATFormatted"); 1140 1141 if (prices != null) 1142 { 1143 foreach (var subPrice in _prices) 1144 { 1145 if (price != null) 1146 { 1147 price = subPrice.Currency.Format(subPrice.Amount); 1148 } 1149 } 1150 } 1151 1152 //Der må der være en bedre måde at gøre dette på? - altså at fjerne p tag fra LongDescription 1153 var description = subitem.GetString("Ecom:Product.ShortDescription.Raw").Replace("<p>", ""); 1154 var image = subitem.GetString("Ecom:Product.ImageNZProductImage.Clean"); 1155 var hasTooltip = !string.IsNullOrEmpty(description) || !string.IsNullOrEmpty(image); 1156 1157 description = description.Replace("</p>", ""); 1158 1159 <div class="d-flex"> 1160 <div class="col-0 col-sm-0 col-lg-3 p-0"></div> 1161 <div class="col-12 col-sm-12 col-lg-9 p-0 d-flex flex-wrap additional-container"> 1162 <div class="col-9 p-0 text-break additional-container__text"> 1163 <input id="productId/@totalIndex" data-productId="@id" data-productVariantId="@variantId" class="additional-container__text__input product-info" type="checkbox" value=""> 1164 <label for="productId/@totalIndex">@name</label><br> 1165 </div> 1166 1167 <div class="justify-content-end w-100 position-absolute additional-container__tooltip" id="additionalDescription-@totalIndex" style="display: none;"> 1168 @if (!string.IsNullOrEmpty(image)) 1169 { 1170 <img class="additional-container__image__hover-container @(!string.IsNullOrEmpty(description) ? "" : "additional-container__image__hover-container--right")" src="/Admin/Public/GetImage.ashx?Image=@image&Width=1000&Height=1000" alt="@name"> 1171 } 1172 1173 @if (!string.IsNullOrEmpty(description)) 1174 { 1175 <div class="additional-container__text__hover-container">@description</div> 1176 } 1177 </div> 1178 1179 <div class="col-3 p-0 d-flex justify-content-end additional-container__text"> 1180 @if (hasTooltip) 1181 { 1182 <span class="icon icon-info mr-2 additionalIcon" style="z-index: 1" data-id="@totalIndex"></span> 1183 } 1184 (+ <span class="lazyload-price" data-id="@subitem.GetString("Ecom:Product.ID")" data-variantid="@subitem.GetString("Ecom:Product.VariantID")"><img src="/Files/Images/loading.gif"> @price</span> ) 1185 </div> 1186 @if (index != count) 1187 { 1188 <div class="w-100 ml-5 mt-3 mb-3" style="border-top: 1px solid #cfd4dc"> 1189 </div> 1190 } 1191 </div> 1192 </div> 1193 } 1194 </div> 1195 </div> 1196 } 1197 } 1198 1199 <div class="addmulti-item"> 1200 <input type="hidden" name="" value="1"> 1201 <input type="hidden" name="" value=""> 1202 <input type="hidden" name="" value=""> 1203 <input type="hidden" name="" value="1"> 1204 </div> 1205 1206 <form id="ecomCartMulti" class="js-product-multi-form" method="post"> 1207 <div class="form-content"> 1208 </div> 1209 1210 <div class="d-flex justify-content-end p-10"> 1211 1212 <div class="product-item__basket-notification js-basket-notification mt-5"> 1213 <div class="product-item__basket-notification-inner"> 1214 <img class="product-item__basket-notification-image" src="/webroot/images/loading-bubbles.svg" title="Loading"> 1215 </div> 1216 <button type="submit" class="js-product-add-to-basket add-multi-basket w-100 btn btn-success ml-auto align-self-end px-4 d-md-inline-block mr-5 ml-5"> 1217 <span class="icon icon-shopping-cart mr-4"></span> 1218 <span class="text-uppercase product-item__basket-notification__buttons">@Translate("ecom-add-to-basket", "Læg i kurv")</span> 1219 </button> 1220 </div> 1221 </div> 1222 </form> 1223 </div> 1224 </div> 1225 } 1226 } 1227 </section> 1228 1229 <!-- New related products --> 1230 @using Dynamicweb.Ecommerce 1231 @using Dynamicweb.Ecommerce.Products 1232 @using Dynamicweb.Security.UserManagement; 1233 @using Helpers = Website.Helpers; 1234 @using VestjyskMarketing.Models; 1235 1236 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 1237 @functions { 1238 1239 string DiscountPct(LoopItem context = null) { 1240 double oldPrice = 0; 1241 double price = 0; 1242 double discount = 0; 1243 1244 string inputdiscountPrice = (context != null ? context.GetString("Ecom:Product.Discount.AmountWithVAT") : GetString("Ecom:Product.Discount.AmountWithVAT")); 1245 string inputprice = (context != null ? context.GetString("Ecom:Product.Price.Price") : GetString("Ecom:Product.Price.Price")); 1246 1247 double.TryParse( inputprice, out oldPrice); 1248 double.TryParse( inputdiscountPrice, out price); 1249 1250 double difference = ( oldPrice - price ); 1251 discount = Math.Round((difference / oldPrice) * 100); 1252 1253 return discount.ToString(); 1254 } 1255 1256 string DiscountDiff(LoopItem context = null) { 1257 double oldPrice = 0; 1258 double price = 0; 1259 1260 var inputdiscountPrice = (context != null ? context.GetString("Ecom:Product.Discount.AmountWithVAT") : GetString("Ecom:Product.Discount.AmountWithVAT")); 1261 var inputprice = (context != null ? context.GetString("Ecom:Product.Price.Price") : GetString("Ecom:Product.Price.Price")); 1262 1263 double.TryParse( inputprice, out oldPrice); 1264 double.TryParse( inputdiscountPrice, out price); 1265 1266 double difference = ( oldPrice - price ); 1267 1268 return SliceCommas(difference.ToString()); 1269 } 1270 1271 string OldPrice(LoopItem context = null, LoopItem product = null) { 1272 double oldPrice = 0; 1273 double price = 0; 1274 1275 var inputdiscountPrice = (context != null ? context.GetString("Ecom:Product.Discount.AmountWithVAT") : GetString("Ecom:Product.Discount.AmountWithVAT")); 1276 var inputprice = (product != null ? product.GetString("Ecom:Product.Price.Price") : GetString("Ecom:Product.Price.Price")); 1277 1278 double.TryParse( inputprice, out oldPrice); 1279 double.TryParse( inputdiscountPrice, out price); 1280 1281 double difference = ( oldPrice + price ); 1282 1283 return SliceCommas(difference.ToString()); 1284 } 1285 1286 string SliceCommas(string givenPrice) { 1287 // We remove everything after comma, if the Discount-Handler calculates it differently, however the price in the cart is with comma values *@ 1288 string price = givenPrice; 1289 int index = price.LastIndexOf(','); 1290 1291 if(index > -1) { 1292 price = price.Substring(0, index) + ",-"; 1293 } 1294 else { 1295 price = price + ",-"; 1296 } 1297 1298 return price.ToString(); 1299 } 1300 1301 string ChangeAttribute(string input, string format) { 1302 if(!String.IsNullOrEmpty(input) && input == "checked") { 1303 return format; 1304 } 1305 else if(!String.IsNullOrEmpty(input) && Convert.ToBoolean(input)) { 1306 return format; 1307 } 1308 return null; 1309 } 1310 1311 } 1312 1313 1314 @helper ContentRenderingNew(LoopItem item, string loopName, bool isSmallSpot = false, string productUrl = "", bool checkoutPage = false) 1315 { 1316 1317 User mainUserHeader = Pageview.User?.CurrentSecondaryUser != null ? Pageview.User.CurrentSecondaryUser : Pageview.User; 1318 1319 //set URL for page. To get correct URL all places in regards to list 1320 //fetch pages from shop 1321 var pageService = new Dynamicweb.Content.PageService(); 1322 var pages = pageService.GetPagesForItems(new string[] { "PageShopList" }).Where(p => p.AreaId == Pageview.AreaID); 1323 string productPrice = GetString("Ecom:Product.Price.PriceWithoutVATFormatted").Replace(",00", ",-"); 1324 var group = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(item.GetString("Ecom:Product.PrimaryOrFirstGroupID")); 1325 int pageId = 0; 1326 foreach (var page in pages) 1327 { 1328 var shopGroupPage = Dynamicweb.Core.Converter.ToString(page.Item["ShopCategoryNumber"]); 1329 if (shopGroupPage == group.Number && page.AreaId.Equals(Pageview.AreaID)) 1330 { 1331 pageId = page.ID; 1332 break; 1333 } 1334 } 1335 1336 productUrl = "/Default.aspx?ID=" + pageId + "&ProductID=" + item.GetString("Ecom:Product.ID"); 1337 if (pageId == 0) 1338 { 1339 productUrl = item.GetString("Ecom:Product.Link.Clean"); 1340 } 1341 1342 // Images 1343 string grpId = string.Empty; 1344 string grpQtyDiscount5 = string.Empty; 1345 string grpQtyDiscount10 = string.Empty; 1346 1347 foreach (LoopItem subItem in item.GetLoop("AssociatedGroups")) 1348 { 1349 grpId = subItem.GetString("Ecom:Group.ID"); 1350 } 1351 1352 if (!string.IsNullOrEmpty(grpId)) 1353 { 1354 1355 double minQuantity = item.GetDouble("Ecom:Product.PurchaseMinimumQuantity"); 1356 if (minQuantity < 1) 1357 { 1358 minQuantity = 1; 1359 } 1360 double quantityStep = item.GetDouble("Ecom:Product.PurchaseQuantityStep"); 1361 if (quantityStep < 1) 1362 { 1363 quantityStep = 1; 1364 } 1365 1366 bool internalProduct = item.GetBoolean("Ecom:Product:Field.InternalProduct"); 1367 bool webshopOK = item.GetBoolean("Ecom:Product:Field.WebshopOK"); 1368 string productName = item.GetString("Ecom:Product.Name"); 1369 string productImage = "/Files/System/Images/Shop/na-image.jpg"; 1370 1371 1372 string getImageForProductList = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(grpId).LargeImage; 1373 string myFormat = string.Format("/Files/{0}", getImageForProductList); 1374 1375 if (!string.IsNullOrEmpty(item.GetString("Ecom:Product.ImageNZProductImage.Clean"))) 1376 { 1377 productImage = item.GetString("Ecom:Product.ImageNZProductImage.Clean"); 1378 } 1379 else if (!string.IsNullOrEmpty(getImageForProductList)) 1380 { 1381 productImage = myFormat; 1382 } 1383 1384 var deleteLink = item.GetString("Ecom:Order:OrderLine.DeleteLink"); 1385 1386 var newDeleteLink = deleteLink; 1387 if (!string.IsNullOrEmpty(deleteLink) && deleteLink.ToLower().Contains("&productid")) 1388 { 1389 var deleteLinkParts = deleteLink.ToLowerInvariant().Split('&'); 1390 var productItemPart = deleteLinkParts.FirstOrDefault(p => p.Contains("productid")); 1391 var productId = item.GetString("Ecom:Product.ID"); 1392 deleteLinkParts[Array.IndexOf(deleteLinkParts, productItemPart)] = "productid=" + productId; 1393 newDeleteLink = string.Join("&", deleteLinkParts); 1394 } 1395 1396 int jungStockAmount = Dynamicweb.Core.Converter.ToInt32(item.GetString("Ecom:Product:Field.jung_stock").Replace("D", "")); 1397 string productFabrikat = item.GetString("Ecom:Product:Field.fabrikat").ToLower(); 1398 1399 string image = VestjyskMarketing.Helpers.ImageHelper.ResizeImage(new ResizeImageSettings() 1400 { 1401 Image = "/Files/Files/Images/img_calculator.png", 1402 Height = 96, 1403 Width = 96, 1404 Quality = 85 1405 }); 1406 1407 //get campaign name 1408 string campaignName = ""; 1409 var productApi = Dynamicweb.Ecommerce.Services.Products.GetProductById(item.GetString("Ecom:Product.ID"), null, false); 1410 var prices = productApi.Prices; 1411 double oldPrice = 0; 1412 string oldPriceCurrency = ""; 1413 1414 1415 foreach (var priceFromMatrix in prices) 1416 { 1417 if (priceFromMatrix.Amount == item.GetDouble("Ecom:Product.Price.PriceWithoutVAT.Value") && Helpers.Product.IsCampaingPrice(priceFromMatrix) 1418 && Helpers.Product.IsPriceValid(priceFromMatrix)) 1419 { 1420 campaignName = priceFromMatrix.Periods.FirstOrDefault()?.Name; 1421 foreach (var priceFromMatrix2 in prices) 1422 { 1423 if (priceFromMatrix2.Amount != item.GetDouble("Ecom:Product.Price.PriceWithoutVAT.Value") && 1424 !Helpers.Product.IsCampaingPrice(priceFromMatrix2) && Helpers.Product.IsPriceValid(priceFromMatrix2)) 1425 { 1426 1427 if (Pageview.Area.EcomCurrencyId == priceFromMatrix2.CurrencyCode) 1428 { 1429 oldPrice = priceFromMatrix2.Amount; 1430 oldPriceCurrency = priceFromMatrix2.CurrencyCode; 1431 break; 1432 } 1433 1434 } 1435 } 1436 1437 1438 } 1439 } 1440 1441 //has to be done like this and not tags. tags will make more calls via live integrayion. 1442 bool hasCombinations = productApi.VariantCombinations.Any(); 1443 1444 var smallSpotClasses = "product-item__price"; 1445 1446 if (isSmallSpot) 1447 { 1448 1449 smallSpotClasses = "text-success font-weight-bold ml-auto"; 1450 1451 if (checkoutPage) 1452 { 1453 <a href="@item.GetString("Ecom:Order:OrderLine.DeleteLink")" class="product-item__closebtn btn p-0"><span class="icon icon-close m-0"></span></a> 1454 } 1455 else 1456 { 1457 <a href="#" class="product-item__closebtn btn p-0 js-product-state-submit" data-action="@newDeleteLink"><span class="icon icon-close m-0"></span></a> 1458 } 1459 1460 } 1461 if (!string.IsNullOrEmpty(campaignName)) 1462 { 1463 string discountImage = ""; //@TODO hvad skal vi gøre med billeder? 1464 bool blackFriday = false; //@TODO hvad skal vi gøre med black friday? 1465 1466 if (!String.IsNullOrEmpty(discountImage)) 1467 { 1468 <div class="product-item__badge image-badge"><img src="@discountImage" alt="Kampagne billede" width="150px" /></div> 1469 } 1470 else if (blackFriday) 1471 { 1472 <div class="product-item__badge blackfriday-badge text-uppercase">@Translate("ecom-campaigne-blackfriday", "Black Friday")</div> 1473 } 1474 else 1475 { 1476 1477 //old campaign 1478 @*<div class="product-item__badge text-uppercase">@Translate("Campaign-" + campaignName, campaignName)</div>*@ 1479 1480 } 1481 1482 } 1483 1484 if (internalProduct && !webshopOK) 1485 { 1486 <div class="product-item__badge image-badge"><img src="/Files/System/Images/Shop/Webshop_logo_intern.jpg" alt="Internt produkt" height="50px" /></div> 1487 } 1488 <div class=" d-flex flex-column result-item__product-content w-100"> 1489 @if (loopName == "Products" || loopName == "Item.ProductDisplay") 1490 { 1491 <picture class="product-item__photo d-flex justify-content-center " onclick="window.location = '@productUrl';" style="cursor:pointer"> 1492 <!-- 1493 <source srcset="/Admin/Public/GetImage.ashx?Image=@productImage&width=146&height=128&background=ffffff&format=webP&Compression=99&fillcanvas=true" media="(min-width: 576px)"> 1494 1495 --> 1496 <img class="img-fluid" src="/Admin/Public/GetImage.ashx?Image=@productImage&width=345&height=300&background=ffffff&format=webP&Compression=99&fillcanvas=true" alt="@productName"> 1497 </picture> 1498 } 1499 <div class="d-flex flex-row mb-3 mt-3" style="height: 110px; justify-content: center;"> 1500 <div class="w-100 d-flex flex-column justify-content-center" onclick="window.location = '@productUrl';" style="cursor:pointer"> 1501 <div style="font-size: 13px; padding: 5px; text-align: center; line-height: 15px; line-break: auto " class="product-item__title p-0 m-0">@productName</div> 1502 1503 <div class="d-flex justify-content-center"> 1504 <div class="product-item__description d-flex mt-2" style="justify-content: center; width: max-content; font-size: 12px"> 1505 @Translate("ProductNumber", "Varenummer") @item.GetString("Ecom:Product.Number") 1506 @if ((jungStockAmount > 0 && jungStockAmount < 3) || item.GetInteger("Ecom:Product.Stock") > 0) 1507 { 1508 <svg style="margin-left: 10px" height="20" width="20"> <circle cx="8" cy="8" r="6" stroke="#92D053" stroke-width="3" fill="#92D053" /> Sorry, your browser does not support inline SVG. </svg> 1509 1510 1511 } 1512 </div> 1513 </div> 1514 <div class="product-item__delivery-time" style="font-size: 12px; text-align: center"> 1515 @Helpers.Product.GetJungStock(item.GetString("Ecom:Product:Field.jung_stock"), item.GetInteger("Ecom:Product.Stock")) 1516 </div> 1517 1518 1519 @if (mainUserHeader != null && mainUserHeader.HasGroup(24)) 1520 { 1521 <span class="d-flex justify-content-center"> 1522 1523 (@item.GetInteger("Ecom:Product.Stock") @Translate("stk.")) 1524 </span> 1525 } 1526 1527 @{ 1528 if (minQuantity > 1) 1529 { 1530 <div class="d-flex" style="justify-content: center; font-size: 12px"><strong> @Translate("Minimumskøb:", "Minimumskøb:") @minQuantity @Translate("stk.")</strong> </div> 1531 } 1532 } 1533 @foreach (LoopItem subItem in item.GetLoop("Order.OrderLineFields")) 1534 { 1535 <div class="product-item__description"> 1536 @if (subItem.GetString("Ecom:Order:OrderLine.OrderLineField.SystemName") == "DeliveryPromised") 1537 { 1538 @subItem.GetString("Ecom:Order:OrderLine.OrderLineField.Value") 1539 } 1540 else if (subItem.GetString("Ecom:Order:OrderLine.OrderLineField.SystemName") == "customSizeAdded") 1541 { 1542 @Translate("customSize", "Størrelse") @subItem.GetString("Ecom:Order:OrderLine.OrderLineField.Value")<span>mm</span> 1543 } 1544 </div> 1545 } 1546 </div> 1547 1548 </div> 1549 1550 <div> 1551 1552 <div class="d-flex mb-2" style="justify-content: space-evenly; align-items: center"> 1553 <input type="hidden" name="ProdId" class="js-reorder-product-id" value="@item.GetString("Ecom:Product.ID")" /> 1554 @if (loopName != "Products" && loopName != "Item.ProductDisplay") 1555 { 1556 <div class="input-group product-item__quantity-wrapper"> 1557 <span class="input-group-btn"> 1558 @if (checkoutPage) 1559 { 1560 <a href="@item.GetString("Ecom:Order:OrderLine.DecrementLink")" role="button" class="btn btn-buy d-inline-flex align-items-center justify-content-center"><span class="icon icon-minus"></span></a> 1561 } 1562 else 1563 { 1564 <a href="#" role="button" class="btn btn-buy d-inline-flex align-items-center justify-content-center js-product-state-submit" data-action="@item.GetString("Ecom:Order:OrderLine.DecrementLink")"><span class="icon icon-minus"></span></a> 1565 } 1566 </span> 1567 <input id="Quantity" type="text" autocomplete="off" class="form-control text-center js-quantity-input" name="Quantity" min="@minQuantity" value="@item.GetString("Ecom:Order:OrderLine.Quantity")" data-step="@quantityStep" data-type="order"> 1568 <span class="input-group-btn"> 1569 @if (checkoutPage) 1570 { 1571 <a href="@item.GetString("Ecom:Order:OrderLine.IncrementLink")" role="button" class="btn btn-buy d-inline-flex align-items-center justify-content-center"><span class="icon icon-plus"></span></a> 1572 } 1573 else 1574 { 1575 <a href="#" role="button" class="btn btn-buy d-inline-flex align-items-center justify-content-center js-product-state-submit" data-action="@item.GetString("Ecom:Order:OrderLine.IncrementLink")"><span class="icon icon-plus"></span></a> 1576 } 1577 1578 </span> 1579 </div> 1580 } 1581 else if (!hasCombinations) 1582 { 1583 <div class="input-group product-item__quantity-wrapper d-md-none"> 1584 <span class="input-group-btn"> 1585 <button class="btn btn-buy js-reorder-quantity-subtract" type="button"><span class="icon icon-minus"></span></button> 1586 </span> 1587 <input type="text" autocomplete="off" class="form-control text-center js-reorder-quantity-input" name="Quantity" min="0" max="20" value="1"> 1588 <span class="input-group-btn"> 1589 <button class="btn btn-buy js-reorder-quantity-add" type="button"><span class="icon icon-plus"></span></button> 1590 </span> 1591 </div> 1592 } 1593 1594 1595 @if (productFabrikat != "leitz") 1596 { 1597 <div class="@smallSpotClasses" onclick="window.location = '@productUrl';" style="cursor:pointer"> 1598 @if (!String.IsNullOrEmpty(campaignName) && oldPrice > 0 && !User.IsExtranetUserLoggedIn()) 1599 { 1600 @*<div class="product-details__price-container"> 1601 @if (hasCombinations && loopName != "OrderLines") 1602 { 1603 <div class="from-price">@Translate("ProductFromPrice", "Fra")</div> 1604 } 1605 <div>@item.GetString("Ecom:Product.Price.PriceWithoutVATFormatted").Replace(",00", ",-")</div> 1606 <div class="product-item__price--old">DKK @oldPrice,-</div> 1607 </div>*@ 1608 1609 1610 <div class="without-discount d-flex flex-column align-items-center" style="font-size: 17px; line-height: 1.2"> 1611 @if (loopName == "OrderLines") 1612 { 1613 @item.GetString("Ecom:Order:OrderLine.UnitPrice.PriceWithoutVATFormatted").Replace(",00", ",-") 1614 } 1615 else 1616 { 1617 <div class="without-discount d-flex flex-column align-items-center"> 1618 @if (hasCombinations && loopName != "OrderLines") 1619 { 1620 @Translate("ProductFromPrice", "Fra") 1621 } 1622 1623 @item.GetString("Ecom:Product.Price.PriceWithoutVATFormatted").Replace(",00", ",-") 1624 1625 <div class="product-item__price--old m-0 text-center" style="font-size: 11px; color: #68943c">@oldPriceCurrency @oldPrice,-</div> 1626 </div> 1627 1628 1629 } 1630 </div> 1631 1632 } 1633 1634 else 1635 { 1636 1637 1638 <div class="without-discount d-flex flex-column align-items-center" style="font-size: 17px; line-height: 1.2"> 1639 @if (loopName == "OrderLines") 1640 { 1641 @item.GetString("Ecom:Order:OrderLine.UnitPrice.PriceWithoutVATFormatted").Replace(",00", ",-") 1642 } 1643 else 1644 { 1645 <div class="d-flex"> 1646 @if (hasCombinations && loopName != "OrderLines") 1647 { 1648 @Translate("ProductFromPrice", "Fra")<span> </span> 1649 } 1650 1651 <div data-id="@item.GetString("Ecom:Product.ID")" data-variantid='@(hasCombinations ? "variantid" : "")' class="lazyload-price lazyload-price-vat"> 1652 <span> 1653 @item.GetString("Ecom:Product.Price.PriceWithoutVATFormatted").Replace(",00", ",-") 1654 </span> 1655 <img src="Files/Images/loading.gif"> 1656 </div> 1657 </div> 1658 <div class="item__container__info__no-vat">(@Translate("ecom-price-excl-vat", ""))</div> 1659 1660 } 1661 </div> 1662 } 1663 </div> 1664 } 1665 else if (User.IsExtranetUserLoggedIn()) 1666 { 1667 <div class="@smallSpotClasses" onclick="window.location = '@productUrl';" style="cursor:pointer"> 1668 1669 @if (hasCombinations && loopName != "OrderLines") 1670 { 1671 <div class="from-price without-discount">@Translate("ProductFromPrice", "Fra")</div> 1672 } 1673 1674 <div class="without-discount d-flex flex-column align-items-center" style="font-size: 17px; line-height: 1.2"> 1675 @if (loopName == "OrderLines") 1676 { 1677 @item.GetString("Ecom:Order:OrderLine.UnitPrice.PriceWithoutVATFormatted").Replace(",00", ",-") 1678 } 1679 else 1680 { 1681 @item.GetString("Ecom:Product.Price.PriceWithoutVATFormatted").Replace(",00", ",-") 1682 } 1683 <div class="item__container__info__no-vat">(@Translate("ecom-price-excl-vat", ""))</div> 1684 </div> 1685 1686 1687 </div> 1688 } 1689 1690 @if (loopName == "Products" || loopName == "Item.ProductDisplay") 1691 { 1692 if (productFabrikat != "leitz" || User.IsExtranetUserLoggedIn()) 1693 { 1694 <div class="d-inline-block flex-row no-wrap"> 1695 @if (!hasCombinations) 1696 { 1697 <button type="submit" class="js-reorder-add-to-basket w-100 btn btn-sm btn-success ml-auto align-self-end d-md-none"> 1698 <span class="icon icon-cart"></span> 1699 </button> 1700 } 1701 else 1702 { 1703 <button type="submit" class="w-100 btn btn-sm btn-success ml-auto align-self-end d-md-none" onclick="window.location = '@productUrl';"> 1704 <span class="icon icon-cart"></span> 1705 </button> 1706 } 1707 <button type="button" class="btn btn-success align-self-end px-4 d-none d-md-flex" onclick="window.location = '@productUrl';"> <div class="d-flex flex-row"> <span class="icon icon-shopping-cart mr-2" style="font-size: 14px"></span> </div>@Translate("BESTIL") </button> 1708 1709 1710 </div> 1711 } 1712 else 1713 { 1714 <div class="d-flex"> 1715 1716 <div class="align-self-end px-4 d-none d-md-inline-block" style="font-size: 12px">@Translate("Log ind for at se prisen")</div> 1717 1718 <button type="button" class="btn btn-success align-self-end px-4 d-md-inline-block js-aside-btn" href="#" data-view="login">@Translate("HeaderLoginButton", "Login")</button> 1719 </div> 1720 } 1721 } 1722 </div> 1723 1724 @if (mainUserHeader != null && mainUserHeader.HasGroup(24) && !isSmallSpot) 1725 { 1726 string salesPrice = item.GetDouble("Ecom:Product.DBPrice").ToString("F2"); 1727 string webPrice = salesPrice; 1728 string webDiscount = Dynamicweb.Core.Converter.ToString(productApi.GetProductFieldValue("WebDiscount")); 1729 string cost = Dynamicweb.Core.Converter.ToString(productApi.Cost); 1730 string externalNumber = Dynamicweb.Core.Converter.ToString(productApi.GetProductFieldValue("ExterntNummer")); 1731 string manufacturer = productApi.Manufacturer != null ? productApi.Manufacturer.Name : ""; 1732 string discountGroup = Dynamicweb.Core.Converter.ToString(productApi.GetProductFieldValue("ItemDiscGroup")); 1733 1734 foreach (var priceFromMatrix in productApi.Prices) 1735 { 1736 1737 if (Helpers.Product.IsPriceValid(priceFromMatrix)) 1738 { 1739 var userToTakePriceFrom = Pageview.User; 1740 1741 if (!string.IsNullOrEmpty(userToTakePriceFrom.Currency) && priceFromMatrix.CurrencyCode == userToTakePriceFrom.Currency) 1742 { 1743 webPrice = priceFromMatrix.Amount.ToString("F2"); 1744 } 1745 1746 if (priceFromMatrix.CurrencyCode == "DKK" && string.IsNullOrEmpty(userToTakePriceFrom.Currency)) 1747 { 1748 webPrice = priceFromMatrix.Amount.ToString("F2"); 1749 } 1750 } 1751 } 1752 1753 <div class="mt-3 d-flex justify-content-between align-items-end"> 1754 <div> 1755 <div class="text-center" style="margin-left: 10px; font-size: 12px;"> 1756 @Translate("Bruttopris", "Bruttopris") @salesPrice 1757 </div> 1758 1759 <div class="text-center" style="margin-left: 8px; font-size: 12px;"> 1760 @Translate("Webpris", "Webpris") @webPrice 1761 </div> 1762 </div> 1763 <div class="product-item__details"> 1764 <img src="@image" class="product-item__details__image"> 1765 <div class="product-item__details__tooltip"> 1766 <div class="row"> 1767 <div class="col-7"> 1768 @Translate("Bruttopris", "Bruttopris"): 1769 </div> 1770 <div class="col-5"> 1771 @salesPrice 1772 </div> 1773 <div class="col-7"> 1774 @Translate("Webrabat", "Webrabat") %: 1775 </div> 1776 <div class="col-5"> 1777 @webDiscount 1778 </div> 1779 <div class="col-7"> 1780 @Translate("Webpris", "Webpris"): 1781 </div> 1782 <div class="col-5"> 1783 @webPrice 1784 </div> 1785 <div class="col-7"> 1786 @Translate("Cost", "Kostpris"): 1787 </div> 1788 <div class="col-5"> 1789 @cost 1790 </div> 1791 <div class="col-7"> 1792 @Translate("Manufacturer's number", "Leverandørens varenr"): 1793 </div> 1794 <div class="col-5"> 1795 @externalNumber 1796 </div> 1797 <div class="col-7"> 1798 @Translate("Manufacturer", "Levenrandør"): 1799 </div> 1800 <div class="col-5"> 1801 @manufacturer 1802 </div> 1803 <div class="col-7"> 1804 @Translate("DiscountGroup", "Varerabatgruppe"): 1805 </div> 1806 <div class="col-5"> 1807 @discountGroup 1808 </div> 1809 </div> 1810 </div> 1811 </div> 1812 </div> 1813 } 1814 </div> 1815 </div> 1816 1817 } 1818 } 1819 @helper ContentRendering(LoopItem item, string loopName, bool isSmallSpot = false, string productUrl = "", bool checkoutPage = false) 1820 { 1821 1822 User mainUserHeader = Pageview.User?.CurrentSecondaryUser != null ? Pageview.User.CurrentSecondaryUser : Pageview.User; 1823 1824 //set URL for page. To get correct URL all places in regards to list 1825 //fetch pages from shop 1826 var pageService = new Dynamicweb.Content.PageService(); 1827 var pages = pageService.GetPagesForItems(new string[] { "PageShopList" }).Where(p => p.AreaId == Pageview.AreaID); 1828 string productPrice = GetString("Ecom:Product.Price.PriceWithoutVATFormatted").Replace(",00", ",-"); 1829 var group = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(item.GetString("Ecom:Product.PrimaryOrFirstGroupID")); 1830 int pageId = 0; 1831 foreach (var page in pages) 1832 { 1833 var shopGroupPage = Dynamicweb.Core.Converter.ToString(page.Item["ShopCategoryNumber"]); 1834 if (shopGroupPage == group.Number && page.AreaId.Equals(Pageview.AreaID)) 1835 { 1836 pageId = page.ID; 1837 break; 1838 } 1839 } 1840 1841 productUrl = "/Default.aspx?ID=" + pageId + "&ProductID=" + item.GetString("Ecom:Product.ID"); 1842 if (pageId == 0) 1843 { 1844 productUrl = item.GetString("Ecom:Product.Link.Clean"); 1845 } 1846 1847 // Images 1848 string grpId = string.Empty; 1849 string grpQtyDiscount5 = string.Empty; 1850 string grpQtyDiscount10 = string.Empty; 1851 1852 foreach (LoopItem subItem in item.GetLoop("AssociatedGroups")) 1853 { 1854 grpId = subItem.GetString("Ecom:Group.ID"); 1855 } 1856 1857 if (!string.IsNullOrEmpty(grpId)) 1858 { 1859 1860 double minQuantity = item.GetDouble("Ecom:Product.PurchaseMinimumQuantity"); 1861 if (minQuantity < 1) 1862 { 1863 minQuantity = 1; 1864 } 1865 double quantityStep = item.GetDouble("Ecom:Product.PurchaseQuantityStep"); 1866 if (quantityStep < 1) 1867 { 1868 quantityStep = 1; 1869 } 1870 1871 bool internalProduct = item.GetBoolean("Ecom:Product:Field.InternalProduct"); 1872 bool webshopOK = item.GetBoolean("Ecom:Product:Field.WebshopOK"); 1873 string productName = item.GetString("Ecom:Product.Name"); 1874 string productImage = "/Files/System/Images/Shop/na-image.jpg"; 1875 1876 1877 string getImageForProductList = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(grpId).LargeImage; 1878 string myFormat = string.Format("/Files/{0}", getImageForProductList); 1879 1880 if (!string.IsNullOrEmpty(item.GetString("Ecom:Product.ImageNZProductImage.Clean"))) 1881 { 1882 productImage = item.GetString("Ecom:Product.ImageNZProductImage.Clean"); 1883 } 1884 else if (!string.IsNullOrEmpty(getImageForProductList)) 1885 { 1886 productImage = myFormat; 1887 } 1888 1889 var deleteLink = item.GetString("Ecom:Order:OrderLine.DeleteLink"); 1890 1891 var newDeleteLink = deleteLink; 1892 if (!string.IsNullOrEmpty(deleteLink) && deleteLink.ToLower().Contains("&productid")) 1893 { 1894 var deleteLinkParts = deleteLink.ToLowerInvariant().Split('&'); 1895 var productItemPart = deleteLinkParts.FirstOrDefault(p => p.Contains("productid")); 1896 var productId = item.GetString("Ecom:Product.ID"); 1897 deleteLinkParts[Array.IndexOf(deleteLinkParts, productItemPart)] = "productid=" + productId; 1898 newDeleteLink = string.Join("&", deleteLinkParts); 1899 } 1900 1901 int jungStockAmount = Dynamicweb.Core.Converter.ToInt32(item.GetString("Ecom:Product:Field.jung_stock").Replace("D", "")); 1902 string productFabrikat = item.GetString("Ecom:Product:Field.fabrikat").ToLower(); 1903 1904 //get campaign name 1905 string campaignName = ""; 1906 var productApi = Dynamicweb.Ecommerce.Services.Products.GetProductById(item.GetString("Ecom:Product.ID"), null, false); 1907 var prices = productApi.Prices; 1908 foreach (var priceFromMatrix in productApi.Prices) 1909 { 1910 if (priceFromMatrix.Amount == item.GetDouble("Ecom:Product.Price.PriceWithoutVAT.Value")) 1911 { 1912 campaignName = priceFromMatrix.Periods.FirstOrDefault()?.Name; 1913 } 1914 } 1915 1916 //has to be done like this and not tags. tags will make more calls via live integrayion. 1917 bool hasCombinations = productApi.VariantCombinations.Any(); 1918 1919 var smallSpotClasses = "product-item__price"; 1920 1921 if (isSmallSpot) 1922 { 1923 smallSpotClasses = "text-success font-weight-bold ml-auto"; 1924 1925 if (checkoutPage) 1926 { 1927 <a href="@item.GetString("Ecom:Order:OrderLine.DeleteLink")" class="product-item__closebtn btn p-0"><span class="icon icon-close m-0"></span></a> 1928 } 1929 else 1930 { 1931 <a href="#" class="product-item__closebtn btn p-0 js-product-state-submit" data-action="@newDeleteLink"><span class="icon icon-close m-0"></span></a> 1932 } 1933 1934 } 1935 if (!string.IsNullOrEmpty(campaignName)) 1936 { 1937 string discountImage = ""; //@TODO hvad skal vi gøre med billeder? 1938 bool blackFriday = false; //@TODO hvad skal vi gøre med black friday? 1939 1940 if (!String.IsNullOrEmpty(discountImage)) 1941 { 1942 <div class="product-item__badge image-badge"><img src="@discountImage" alt="Kampagne billede" width="150px" /></div> 1943 } 1944 else if (blackFriday) 1945 { 1946 <div class="product-item__badge blackfriday-badge text-uppercase">@Translate("ecom-campaigne-blackfriday", "Black Friday")</div> 1947 } 1948 else 1949 { 1950 <div class="product-item__badge text-uppercase">@Translate("Campaign-" + campaignName, campaignName)</div> 1951 } 1952 1953 } 1954 1955 if (internalProduct && !webshopOK) 1956 { 1957 <div class="product-item__badge image-badge"><img src="/Files/System/Images/Shop/Webshop_logo_intern.jpg" alt="Internt produkt" height="50px" /></div> 1958 } 1959 1960 if (loopName == "Products") 1961 { 1962 <picture class="product-item__photo mr-5 mr-md-7" onclick="window.location = '@productUrl';" style="cursor:pointer"> 1963 <source srcset="/Admin/Public/GetImage.ashx?Image=@productImage&width=146&height=128&background=ffffff&format=webP&Compression=75&fillcanvas=true" media="(min-width: 576px)"> 1964 <img class="img-fluid w-100" src="/Admin/Public/GetImage.ashx?Image=@productImage&width=345&height=300&background=ffffff&format=webP&Compression=75&fillcanvas=true" alt="@productName"> 1965 1966 1967 </picture> 1968 } 1969 1970 1971 <div class="h-100 d-flex flex-column result-item__product-content"> 1972 <div class="d-flex flex-row"> 1973 <div class="d-flex flex-column mb-3" onclick="window.location = '@productUrl';" style="cursor:pointer"> 1974 <div class="product-item__title">@productName</div> 1975 <div class="product-item__description"> 1976 @Translate("ProductNumber", "Varenummer") @item.GetString("Ecom:Product.Number") 1977 @if ((jungStockAmount > 0 && jungStockAmount < 3) || item.GetInteger("Ecom:Product.Stock") > 0) 1978 { 1979 <svg height="20" width="20"> <circle cx="8" cy="8" r="6" stroke="#92D053" stroke-width="3" fill="#92D053" /> Sorry, your browser does not support inline SVG. </svg> 1980 1981 if (mainUserHeader != null && mainUserHeader.HasGroup(24)) 1982 { 1983 <span> 1984 1985 (@item.GetInteger("Ecom:Product.Stock") @Translate("stk.")) 1986 </span> 1987 } 1988 } 1989 </div> 1990 @{ 1991 if (minQuantity > 1) 1992 { 1993 <div><strong>@Translate("Minimumskøb:", "Minimumskøb:")</strong> @minQuantity @Translate("stk.")</div> 1994 } 1995 } 1996 @foreach (LoopItem subItem in item.GetLoop("Order.OrderLineFields")) 1997 { 1998 <div class="product-item__description"> 1999 @if (subItem.GetString("Ecom:Order:OrderLine.OrderLineField.SystemName") == "DeliveryPromised") 2000 { 2001 @subItem.GetString("Ecom:Order:OrderLine.OrderLineField.Value") 2002 } 2003 else if (subItem.GetString("Ecom:Order:OrderLine.OrderLineField.SystemName") == "customSizeAdded") 2004 { 2005 @Translate("customSize", "Størrelse") @subItem.GetString("Ecom:Order:OrderLine.OrderLineField.Value")<span>mm</span> 2006 } 2007 </div> 2008 } 2009 2010 @if (mainUserHeader != null && mainUserHeader.HasGroup(24) && !isSmallSpot) 2011 { 2012 string image = VestjyskMarketing.Helpers.ImageHelper.ResizeImage(new ResizeImageSettings() 2013 { 2014 Image = "/Files/Files/Images/img_calculator.png", 2015 Height = 96, 2016 Width = 96, 2017 Quality = 85 2018 }); 2019 2020 string salesPrice = item.GetDouble("Ecom:Product.DBPrice").ToString("F2"); 2021 string webPrice = salesPrice; 2022 string webDiscount = Dynamicweb.Core.Converter.ToDouble(productApi.GetProductFieldValue("WebDiscount")).ToString("F2"); 2023 string cost = Dynamicweb.Core.Converter.ToString(productApi.Cost); 2024 string externalNumber = Dynamicweb.Core.Converter.ToString(productApi.GetProductFieldValue("ExterntNummer")); 2025 string manufacturer = productApi.Manufacturer != null ? productApi.Manufacturer.Name : ""; 2026 string discountGroup = Dynamicweb.Core.Converter.ToString(productApi.GetProductFieldValue("ItemDiscGroup")); 2027 2028 2029 foreach (var priceFromMatrix in productApi.Prices) 2030 { 2031 2032 if (Helpers.Product.IsPriceValid(priceFromMatrix)) 2033 { 2034 var userToTakePriceFrom = Pageview.User; 2035 2036 if (!string.IsNullOrEmpty(userToTakePriceFrom.Currency) && priceFromMatrix.CurrencyCode == userToTakePriceFrom.Currency) 2037 { 2038 webPrice = priceFromMatrix.Amount.ToString("F2"); 2039 } 2040 2041 if (priceFromMatrix.CurrencyCode == "DKK" && string.IsNullOrEmpty(userToTakePriceFrom.Currency)) 2042 { 2043 webPrice = priceFromMatrix.Amount.ToString("F2"); 2044 } 2045 } 2046 } 2047 2048 <div class="d-flex flex-row align-items-end"> 2049 <div> 2050 <div class="text-center" style="font-size: 10px;"> 2051 @Translate("Salgspris", "Salgspris"): @salesPrice 2052 </div> 2053 2054 <div class="text-center" style="font-size: 10px;"> 2055 @Translate("Webpris", "Webpris"): @webPrice 2056 </div> 2057 </div> 2058 <div class="product-item__details ml-6"> 2059 <img src="@image" class="product-item__details__image"> 2060 <div class="product-item__details__tooltip"> 2061 <div class="row"> 2062 <div class="col-7"> 2063 @Translate("Salgspris", "Salgspris"): 2064 </div> 2065 <div class="col-5"> 2066 @salesPrice 2067 </div> 2068 <div class="col-7"> 2069 @Translate("Webrabat", "Webrabat") %: 2070 </div> 2071 <div class="col-5"> 2072 @webDiscount 2073 </div> 2074 <div class="col-7"> 2075 @Translate("Webpris", "Webpris"): 2076 </div> 2077 <div class="col-5"> 2078 @webPrice 2079 </div> 2080 <div class="col-7"> 2081 @Translate("Cost", "Kostpris"): 2082 </div> 2083 <div class="col-5"> 2084 @cost 2085 </div> 2086 <div class="col-7"> 2087 @Translate("Manufacturer's number", "Leverandørens varenr"): 2088 </div> 2089 <div class="col-5"> 2090 @externalNumber 2091 </div> 2092 <div class="col-7"> 2093 @Translate("Manufacturer", "Levenrandør"): 2094 </div> 2095 <div class="col-5"> 2096 @manufacturer 2097 </div> 2098 <div class="col-7"> 2099 @Translate("DiscountGroup", "Varerabatgruppe"): 2100 </div> 2101 <div class="col-5"> 2102 @discountGroup 2103 </div> 2104 </div> 2105 </div> 2106 </div> 2107 </div> 2108 } 2109 </div> 2110 </div> 2111 <div class="d-flex flex-row mt-auto align-items-center justify-content-start"> 2112 <input type="hidden" name="ProdId" class="js-reorder-product-id" value="@item.GetString("Ecom:Product.ID")" /> 2113 @if (loopName != "Products") 2114 { 2115 <div class="input-group product-item__quantity-wrapper"> 2116 <span class="input-group-btn"> 2117 @if (checkoutPage) 2118 { 2119 <a href="@item.GetString("Ecom:Order:OrderLine.DecrementLink")" role="button" class="btn btn-buy d-inline-flex align-items-center justify-content-center"><span class="icon icon-minus"></span></a> 2120 } 2121 else 2122 { 2123 <a href="#" role="button" class="btn btn-buy d-inline-flex align-items-center justify-content-center js-product-state-submit" data-action="@item.GetString("Ecom:Order:OrderLine.DecrementLink")"><span class="icon icon-minus"></span></a> 2124 } 2125 </span> 2126 <input id="Quantity" type="text" autocomplete="off" class="form-control text-center js-quantity-input" name="Quantity" min="@minQuantity" value="@item.GetString("Ecom:Order:OrderLine.Quantity")" data-step="@quantityStep" data-type="order"> 2127 <span class="input-group-btn"> 2128 @if (checkoutPage) 2129 { 2130 <a href="@item.GetString("Ecom:Order:OrderLine.IncrementLink")" role="button" class="btn btn-buy d-inline-flex align-items-center justify-content-center"><span class="icon icon-plus"></span></a> 2131 } 2132 else 2133 { 2134 <a href="#" role="button" class="btn btn-buy d-inline-flex align-items-center justify-content-center js-product-state-submit" data-action="@item.GetString("Ecom:Order:OrderLine.IncrementLink")"><span class="icon icon-plus"></span></a> 2135 } 2136 2137 </span> 2138 </div> 2139 } 2140 else if (!hasCombinations) 2141 { 2142 <div class="input-group product-item__quantity-wrapper d-md-none"> 2143 <span class="input-group-btn"> 2144 <button class="btn btn-buy js-reorder-quantity-subtract" type="button"><span class="icon icon-minus"></span></button> 2145 </span> 2146 <input type="text" autocomplete="off" class="form-control text-center js-reorder-quantity-input" name="Quantity" min="0" max="20" value="1"> 2147 <span class="input-group-btn"> 2148 <button class="btn btn-buy js-reorder-quantity-add" type="button"><span class="icon icon-plus"></span></button> 2149 </span> 2150 </div> 2151 } 2152 2153 2154 @if (productFabrikat != "leitz") 2155 { 2156 <div class="@smallSpotClasses" onclick="window.location = '@productUrl';" style="cursor:pointer"> 2157 @if (false) //TODO campaign prices 2158 { 2159 <div class="product-details__price-container"> 2160 @if (hasCombinations && loopName != "OrderLines") 2161 { 2162 <div class="from-price">@Translate("ProductFromPrice", "Fra")</div> 2163 } 2164 <div>@item.GetString("Ecom:Product.Discount.Price.PriceWithoutVATFormatted").Replace(",00", ",-")</div> 2165 <div class="product-item__price--old">@item.GetString("Ecom:Product.Price.PriceWithoutVATFormatted").Replace(",00", ",-")</div> 2166 </div> 2167 } 2168 else 2169 { 2170 2171 2172 2173 2174 if (hasCombinations && loopName != "OrderLines") 2175 { 2176 <div class="from-price without-discount">@Translate("ProductFromPrice", "Fra")<span> </span></div> 2177 2178 } 2179 2180 <div class="without-discount lazyload-price" data-id="@item.GetString("Ecom:Product.ID")" data-variantid='@(hasCombinations ? "variantid" : "")' > 2181 <img src="/Files/Images/loading.gif"> 2182 @if (loopName == "OrderLines") 2183 { 2184 @item.GetString("Ecom:Order:OrderLine.UnitPrice.PriceWithoutVATFormatted").Replace(",00", ",-") 2185 } 2186 else 2187 { 2188 @item.GetString("Ecom:Product.Price.PriceWithoutVATFormatted").Replace(",00", ",-") 2189 } 2190 </div> 2191 2192 } 2193 </div> 2194 } 2195 else if (User.IsExtranetUserLoggedIn()) 2196 { 2197 <div class="@smallSpotClasses" onclick="window.location = '@productUrl';" style="cursor:pointer"> 2198 2199 @if (hasCombinations && loopName != "OrderLines") 2200 { 2201 <div class="from-price without-discount">@Translate("ProductFromPrice", "Fra")</div> 2202 } 2203 2204 <div class="without-discount"> 2205 @if (loopName == "OrderLines") 2206 { 2207 @item.GetString("Ecom:Order:OrderLine.UnitPrice.PriceWithoutVATFormatted").Replace(",00", ",-") 2208 } 2209 else 2210 { 2211 @item.GetString("Ecom:Product.Price.PriceWithoutVATFormatted").Replace(",00", ",-") 2212 } 2213 </div> 2214 2215 </div> 2216 } 2217 2218 @if (loopName == "Products") 2219 { 2220 if (productFabrikat != "leitz" || User.IsExtranetUserLoggedIn()) 2221 { 2222 <div class="product-item__infowrapper d-inline-block ml-auto flex-row no-wrap"> 2223 <button type="button" class="btn btn-link mr-2 align-self-end px-4 d-none d-md-inline-block" onclick="window.location = '@productUrl';">INFO</button> 2224 @if (!hasCombinations) 2225 { 2226 <button type="submit" class="js-reorder-add-to-basket w-100 btn btn-sm btn-success ml-auto align-self-end d-md-none"> 2227 <span class="icon icon-cart mr-4"></span> 2228 </button> 2229 } 2230 else 2231 { 2232 <button type="submit" class="w-100 btn btn-sm btn-success ml-auto align-self-end d-md-none" onclick="window.location = '@productUrl';"> 2233 <span class="icon icon-cart mr-4"></span> 2234 </button> 2235 } 2236 <button type="button" class="btn btn-success align-self-end px-4 d-none d-md-inline-block" onclick="window.location = '@productUrl';"><span class="icon icon-shopping-cart mr-2"></span>@Translate("BESTIL")</button> 2237 2238 2239 </div> 2240 } 2241 else 2242 { 2243 2244 <div class="d-flex"> 2245 2246 <div class="align-self-end px-4 d-none d-md-inline-block" style="font-size: 12px">@Translate("Log ind for at se prisen")</div> 2247 2248 <button type="button" class="btn btn-success align-self-end px-4 d-md-inline-block js-aside-btn" href="#" data-view="login">@Translate("HeaderLoginButton", "Login")</button> 2249 2250 </div> 2251 2252 2253 } 2254 2255 2256 } 2257 </div> 2258 2259 @if (loopName == "Products") 2260 { 2261 if (prices.Count > 1 && false) 2262 { 2263 int counterPrices = 0; 2264 string marginLeft = string.Empty; 2265 <div class="d-flex flex-column my-5 mb-md-7 font-weight-bolder "> 2266 <h4 class="font-weight-bold"> 2267 Køb flere og spar: 2268 </h4> 2269 2270 <div> 2271 <div class="font-small d-flex flex-column flex-lg-row"> 2272 2273 @foreach (Dynamicweb.Ecommerce.Prices.Price priceInMatrix in prices.OrderBy(x => x.Quantity)) 2274 { 2275 if (!Helpers.Product.IsCampaingPrice(priceInMatrix) && Helpers.Product.IsPriceValid(priceInMatrix) && priceInMatrix.Quantity > 1) 2276 { 2277 if (counterPrices > 0) 2278 { 2279 marginLeft = "ml-lg-3"; 2280 } 2281 double productPriceDouble = item.GetDouble("Ecom:Product.Price.PriceWithoutVAT"); 2282 double percentageSaved = (productPriceDouble - priceInMatrix.Amount) / productPriceDouble * 100; 2283 <div class="d-flex flex-row @marginLeft"> 2284 <span class="text-success"> 2285 @priceInMatrix.Quantity stk. af @priceInMatrix.Amount,- 2286 </span> 2287 <span class="text-danger ml-2"> 2288 Du sparer @Math.Round(percentageSaved)% 2289 </span> 2290 </div> 2291 counterPrices++; 2292 } 2293 } 2294 </div> 2295 </div> 2296 </div> 2297 } 2298 } 2299 </div> 2300 } 2301 } 2302 @helper RenderProductListNew(string loopName, int limit = 0, bool isSmallSpot = false, bool productPage = false, List<Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>>.LoopItem> newLoop = null) 2303 { 2304 var loop = GetLoop(loopName); 2305 2306 2307 2308 if (newLoop != null) 2309 { 2310 loop = newLoop; 2311 } 2312 2313 //fetch pages from shop 2314 var pageService = new Dynamicweb.Content.PageService(); 2315 var pages = pageService.GetPagesForItems(new string[] { "PageShopList" }).Where(p => p.AreaId == Pageview.AreaID); 2316 2317 foreach (LoopItem item in limit == 0 ? loop : loop.Take(limit)) 2318 { 2319 if (!string.IsNullOrEmpty(item.GetString("Ecom:Product.PrimaryOrFirstGroupID"))) 2320 { 2321 //set URL for page. To get correct URL all places in regards to list 2322 var group = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(item.GetString("Ecom:Product.PrimaryOrFirstGroupID")); 2323 int pageId = 0; 2324 foreach (var page in pages) 2325 { 2326 var shopGroupPage = Dynamicweb.Core.Converter.ToString(page.Item["ShopCategoryNumber"]); 2327 if (shopGroupPage == group.Number && page.AreaId.Equals(Pageview.AreaID)) 2328 { 2329 pageId = page.ID; 2330 break; 2331 } 2332 } 2333 string productPageUrl = "/Default.aspx?ID=" + pageId + "&ProductID=" + item.GetString("Ecom:Product.ID"); 2334 if (pageId == 0) 2335 { 2336 productPageUrl = item.GetString("Ecom:Product.Link.Clean"); 2337 } 2338 2339 var cols = "col-md-6 col-lg-4"; 2340 2341 if (productPage) 2342 { 2343 cols = "col-md-6 col-lg-3"; 2344 } 2345 2346 if (loopName.Equals("Products") || loopName.Equals("Item.ProductDisplay")) 2347 { 2348 2349 2350 2351 2352 2353 //get campaign name 2354 string campaignName = ""; 2355 var productApi = Dynamicweb.Ecommerce.Services.Products.GetProductById(item.GetString("Ecom:Product.ID"), null, false); 2356 var prices = productApi.Prices; 2357 foreach (var priceFromMatrix in productApi.Prices) 2358 { 2359 if (priceFromMatrix.Amount == item.GetDouble("Ecom:Product.Price.PriceWithoutVAT.Value")) 2360 { 2361 campaignName = priceFromMatrix.Periods.FirstOrDefault()?.Name; 2362 } 2363 } 2364 2365 2366 <div class="@cols d-none d-md-flex js-product-list-item position-relative" style="padding: 8px 8px 0 8px; justify-content: center;"> 2367 <a href="@productPageUrl" class="product-item mb-3 box-shadow-sm box-shadow-sm-hoover" style="width: 100%; padding: 10px; position: relative;"> 2368 @if (!string.IsNullOrEmpty(campaignName)) 2369 { 2370 <div onclick="window.location = '@productPageUrl'" class="campaign-container" style="position: absolute; height: 120px; top: 0; left: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center;"> 2371 <img src="/Admin/Public/GetImage.ashx?Image=/Files/Files/Images/discount_label2.png&Format=png&Width=587&Height=628&Resolution=99&Crop=0" style="height: 120px;"> 2372 <div class="text-uppercase" style="margin-bottom: 39px; font-size: 12px; margin-right: 30px; color: white; font-weight: 600; position: absolute; z-index: 5; transform: rotate(-46deg); transform-origin: center center; white-space: nowrap">@Translate("Campaign-" + campaignName, campaignName)</div> 2373 </div> 2374 2375 } 2376 @ContentRenderingNew(item, loopName, false, productPageUrl) 2377 </a> 2378 </div> 2379 } 2380 else 2381 { 2382 2383 <a href="@productPageUrl" class="product-item mb-3 box-shadow-sm box-shadow-sm-hoover js-product-list-item"> 2384 @ContentRenderingNew(item, loopName, false, productPageUrl) 2385 </a> 2386 2387 } 2388 2389 } 2390 } 2391 } 2392 @helper RenderProductList(string loopName, int limit = 0, bool isSmallSpot = false, bool isSearch = false) 2393 { 2394 var loop = GetLoop(loopName); 2395 2396 //fetch pages from shop 2397 var pageService = new Dynamicweb.Content.PageService(); 2398 var pages = pageService.GetPagesForItems(new string[] { "PageShopList" }).Where(p => p.AreaId == Pageview.AreaID); 2399 var productService = new ProductService(); 2400 2401 foreach (LoopItem item in limit == 0 ? loop : loop.Take(limit)) 2402 { 2403 if (!string.IsNullOrEmpty(item.GetString("Ecom:Product.PrimaryOrFirstGroupID"))) 2404 { 2405 //set URL for page. To get correct URL all places in regards to list 2406 var group = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(item.GetString("Ecom:Product.PrimaryOrFirstGroupID")); 2407 int pageId = 0; 2408 foreach (var page in pages) 2409 { 2410 var shopGroupPage = Dynamicweb.Core.Converter.ToString(page.Item["ShopCategoryNumber"]); 2411 if (shopGroupPage == group.Number && page.AreaId.Equals(Pageview.AreaID)) 2412 { 2413 pageId = page.ID; 2414 break; 2415 } 2416 } 2417 string productPageUrl = "/Default.aspx?ID=" + pageId + "&ProductID=" + item.GetString("Ecom:Product.ID"); 2418 if (pageId == 0) 2419 { 2420 productPageUrl = item.GetString("Ecom:Product.Link.Clean"); 2421 } 2422 2423 if (loopName.Equals("Products")) 2424 { 2425 2426 2427 var displays = isSearch ? "" : "d-flex d-md-none"; 2428 2429 2430 <a href="@productPageUrl" class="@displays product-item mb-3 box-shadow-sm box-shadow-sm-hoover js-product-list-item"> 2431 @ContentRendering(item, loopName, false, productPageUrl) 2432 2433 <span href="@productPageUrl" class="product-item__label d-md-none"> 2434 <span>@Translate("Læs mere")</span> 2435 </span> 2436 2437 </a> 2438 } 2439 } 2440 } 2441 } 2442 2443 @{ 2444 var relatedProductsGroup = GetLoop("ProductRelatedGroups").FirstOrDefault(g => g.GetString("Ecom:Product:RelatedGroup.Name") == "Relaterede produkter"); 2445 if (relatedProductsGroup != null) 2446 { 2447 var relatedProductList = relatedProductsGroup.GetLoop("RelatedProducts").Where(p => p.GetBoolean("Ecom:Product:Field.WebshopOK")).ToList(); 2448 if (relatedProductList.Count() > 0) 2449 { 2450 <div style="background-color: #18305b" class=""> 2451 <div class="container"> 2452 <div class="row"> 2453 <h2 style="color: white; padding-left: 8px;" class="mt-10 mb-6">@Translate("ecom-related-products")</h2> 2454 <div style="flex-flow: wrap; justify-content: start; margin-bottom: 70px" class="p-0 d-flex list-unstyled js-product-list js-product-list-loader col-12"> 2455 @RenderProductListNew("Products", 0, false, true, relatedProductList) 2456 </div> 2457 </div> 2458 </div> 2459 </div> 2460 2461 <svg width="auto" class="" height="100" style="background-color: #f4f4f4" viewBox="0 0 500 80" preserveAspectRatio="none"> 2462 <path d="M0,0 L0,40 Q250,80 500,40 L500,0 Z" fill="#18305b" /> 2463 </svg> 2464 } 2465 } 2466 } 2467 2468 @{ 2469 var productType = ""; 2470 if (isSparePartGroup) 2471 { 2472 productType = "spare_part"; 2473 } 2474 else 2475 { 2476 productType = "default"; 2477 } 2478 <div class="d-none producttype" data-type="@productType"></div> 2479 } 2480 2481 <!-- Additional products js functionality--> 2482 <script> 2483 2484 document.addEventListener("DOMContentLoaded", function () { 2485 //info icons 2486 var infoIcons = document.querySelectorAll(".additionalIcon"); 2487 2488 infoIcons.forEach(function (item) { 2489 var id = item.dataset.id; 2490 var additionalDescription = document.getElementById("additionalDescription-" + id); 2491 2492 item.addEventListener("mouseover", function () { 2493 additionalDescription.style.display = "flex"; 2494 additionalDescription.innerHTML = additionalDescription.innerHTML.trim(); 2495 2496 }) 2497 2498 item.addEventListener("mouseout", function () { 2499 additionalDescription.style.display = "none"; 2500 }) 2501 2502 item.addEventListener("click", function () { 2503 for (let i = 0; i < infoIcons.length; i++) { 2504 if (infoIcons[i].dataset.id !== id) { 2505 document.getElementById("additionalDescription-" + infoIcons[i].dataset.id).style.display = "none"; 2506 } 2507 } 2508 2509 additionalDescription.style.display = "flex"; 2510 additionalDescription.innerHTML = additionalDescription.innerHTML.trim(); 2511 }) 2512 2513 document.addEventListener("click", function (event) { 2514 var target = event.target; 2515 if (!target.closest('.additionalIcon') && additionalDescription.style.display === "flex") { 2516 additionalDescription.style.display = "none"; 2517 } 2518 }) 2519 }) 2520 }) 2521 2522 </script> 2523 2524 2525 <script> 2526 2527 document.addEventListener("DOMContentLoaded", function (){ 2528 2529 var typeElement = document.getElementsByClassName("producttype")[0]; 2530 2531 //SEO for product 2532 2533 var defaultObject = 2534 { 2535 "@@context": "https://schema.org/", 2536 "@@type": "Product", 2537 "name": "@productName", 2538 "image": [ 2539 "@productImageFullurl" 2540 ], 2541 "description": "@metaDescription", 2542 "brand": { 2543 "@@type": "Brand", 2544 "name": "@productFabrikat" 2545 }, 2546 "sku": "@productNumber", 2547 "offers": { 2548 "@@type": "Offer", 2549 "url": window.location.href, 2550 "priceCurrency": "@GetString("Ecom:Product.Currency.Code")", 2551 "price": "@GetDouble("Ecom:Product.Price.PriceWithoutVAT.Value")", 2552 "availability": "https://schema.org/InStock", 2553 "itemCondition": "https://schema.org/NewCondition" 2554 } 2555 } 2556 2557 2558 var objectSparepart = 2559 { 2560 "@@context": "https://schema.org/", 2561 "@@type": "Product", 2562 "name": "@productName", 2563 "image": [ 2564 "@productImageFullurl" 2565 ], 2566 "description": "@metaDescription", 2567 "sku": "@productNumber", 2568 "brand": "@productFabrikat", 2569 "offers": { 2570 "@@type": "Offer", 2571 "availability": "http://schema.org/InStock", 2572 "price": "@GetDouble("Ecom:Product.Price.PriceWithoutVAT.Value") ", 2573 "priceCurrency": "@GetString("Ecom:Product.Currency.Code")" 2574 } 2575 } 2576 2577 var jsonLdScript = document.createElement('script'); 2578 jsonLdScript.type = 'application/ld+json'; 2579 2580 if (typeElement.dataset.type == "spare_part") 2581 { 2582 jsonLdScript.text = JSON.stringify(objectSparepart); 2583 } 2584 else { 2585 jsonLdScript.text = JSON.stringify(defaultObject); 2586 } 2587 2588 document.head.appendChild(jsonLdScript); 2589 2590 //view_item 2591 window.dataLayer = window.dataLayer || []; 2592 dataLayer.push({ecommerce: null}) 2593 dataLayer.push({ 2594 "event": "view_item", 2595 "ecommerce": { 2596 "currency": "@GetValue("Ecom:Product.Currency.Code")", 2597 "value": @Dynamicweb.Core.Converter.ToString(GetDouble("Ecom:Product.Price.PriceWithoutVAT")).Replace(",", "."), 2598 "items": [ 2599 { 2600 "item_id": "@productNumber", 2601 "item_name": "@productName", 2602 "affiliation": "Online Store", 2603 "variant" : "@productVariantName", 2604 "price": @Dynamicweb.Core.Converter.ToString(GetDouble("Ecom:Product.Price.PriceWithoutVAT")).Replace(",", "."), 2605 } 2606 ] 2607 }, 2608 2609 }); 2610 2611 //add_to_cart 2612 2613 window.addEventListener("DOMContentLoaded", (event) => { 2614 2615 var addToBasketButton = document.getElementsByClassName("js-product-add-to-basket"); 2616 addToBasketButton = addToBasketButton[0]; 2617 addToBasketButton.addEventListener("click", addToBasketClicked); 2618 2619 function addToBasketClicked () 2620 { 2621 window.dataLayer = window.dataLayer || []; 2622 dataLayer.push({ecommerce: null}) 2623 dataLayer.push({ 2624 "event": "add_to_cart", 2625 "ecommerce": { 2626 "currency": "@GetValue("Ecom:Product.Currency.Code")", 2627 "value": @Dynamicweb.Core.Converter.ToString(GetDouble("Ecom:Product.Price.PriceWithoutVAT")).Replace(",", "."), 2628 "items": [ 2629 { 2630 "item_id": "@productNumber", 2631 "item_name": "@productName", 2632 "affiliation": "Online Store", 2633 "variant" : "@productVariantName", 2634 "price": @Dynamicweb.Core.Converter.ToString(GetDouble("Ecom:Product.Price.PriceWithoutVAT")).Replace(",", "."), 2635 } 2636 ] 2637 }, 2638 }); 2639 } 2640 2641 }); 2642 }) 2643 2644 </script> 2645
Fandt du ikke den reservedel du søgte? Vi hjælper gerne med at finde de korrekte Biesse reservedele til dine maskiner.
Find en medarbejder for direkte kontakt