Error executing template "Designs/CapoStarter/eCom/Product/M_Product_global.cshtml"
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at App_Code.SimilarProducts.GetSimilarProducts(String groupId, String productId, Boolean isGlobal)
   at CompiledRazorTemplates.Dynamic.RazorEngine_6039a913894d4d5793fdc380dd4275d1.Execute() in D:\dynamicweb.net\Solutions\Capo\sundqvist.cloud.dynamicweb-cms.com\files\Templates\Designs\CapoStarter\eCom\Product\M_Product_global.cshtml:line 2089
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2 @using System.Globalization 3 @using App_Code 4 @using Dynamicweb.Extensibility 5 @using Dynamicweb.Content 6 7 @{ 8 9 var loggedIn = HelperClass.IsLoggedIn(); 10 var currrencySymbol = GetGlobalValue("Global:eCommerce.Currency.Symbol"); 11 var culture = GetGlobalValue("Global:Area.Culture.Name"); 12 13 var buttonClass = "consument"; 14 15 var hideCart = Convert.ToBoolean(Pageview.Area.Item["Hide_Cart"]); 16 17 int buyHerePageID = GetPageIdByNavigationTag("BuyHere"); 18 19 decimal priceWithVat = Convert.ToDecimal(!string.IsNullOrEmpty(GetString("Ecom:Product.Price.PriceWithVAT")) ? GetString("Ecom:Product.Price.PriceWithVAT") : "0"); 20 string priceFormattedWithVat = priceWithVat.ToString("n0", new CultureInfo(GetGlobalValue("Global:Area.Culture.Name"))) + GetGlobalValue("Global:eCommerce.Currency.Symbol"); 21 22 //This is needed to be able to use the same Combined product template on all sites 23 bool NorwegianSite = false; 24 25 // Consumer old price - for campaign price graphics 26 double ConsumerOldPrice = GetDouble("Ecom:Product:Field.OldProductPrice"); 27 ConsumerOldPrice = ConsumerOldPrice * 1.25; 28 string ConsumerOldPriceFormatted = ConsumerOldPrice.ToString("n0", new CultureInfo(GetGlobalValue("Global:Area.Culture.Name"))) + GetGlobalValue("Global:eCommerce.Currency.Symbol"); 29 30 } 31 32 33 <section class="content productpage"> 34 <div class="div-max1170-centered"> 35 <div class="productcard"> 36 <div class="row"> 37 <div class="go-back-button"> 38 <button class="btn" onclick="Misc.goBack()">@Translate("productBackButton", "Tillbaka")</button> 39 </div> 40 </div> 41 42 <div class="row"> 43 <div class="col-sm-5 col-sm-offset-1"> 44 <!-- Left Column --> 45 <div class="productimages-area"> 46 <div class="productimages-wrapp"> 47 @{ 48 bool imgControl = false; 49 bool imgFunctions = false; 50 string disabledState = ""; 51 } 52 53 <div class="carousel slide" id="carousel-productimages"> 54 <!-- Wrapper for slides --> 55 <div class="carousel-inner"> 56 @{ 57 var counter = 0; 58 59 string prodnumber = GetString("Ecom:Product.Number").Replace("/", "-"); 60 61 var curprodpath = "/Files/Images/ProductImages/" + prodnumber; 62 var imglist = new List<string>(); 63 string[] imgfiles = new string[0]; 64 65 var relatedImages1 = GetString("Ecom:Product:Field.relatedImages1.FullPath"); 66 var relatedImages2 = GetString("Ecom:Product:Field.relatedImages2.FullPath"); 67 var relatedImages3 = GetString("Ecom:Product:Field.relatedImages3.FullPath"); 68 var relatedImages4 = GetString("Ecom:Product:Field.relatedImages4.FullPath"); 69 var relatedImages5 = GetString("Ecom:Product:Field.relatedImages5.FullPath"); 70 try 71 { 72 imgfiles = System.IO.Directory.GetFiles(System.Web.HttpContext.Current.Server.MapPath(curprodpath)); 73 74 } 75 catch 76 { 77 <div class="item active"> 78 <img src="/Files/Images/NoImageAvailable.png" alt="" class="img-responsive" /> 79 </div> 80 } 81 string[] fieldRelatedImages = { @relatedImages1, @relatedImages2, @relatedImages3, @relatedImages4, @relatedImages5 }; 82 83 //Check that first found image has list-image pattern productnumber_1.jpg 84 if (!imgfiles.Any(x => x.Contains(prodnumber + "_1.jpg"))) 85 { 86 87 <div class="item active"> 88 <img src="/Files/Images/NoImageAvailable.png" alt="" class="img-responsive" /> 89 </div> 90 } 91 else 92 { 93 94 for (int i = 0; i < imgfiles.Length; i++) 95 { 96 if (!imgfiles[i].EndsWith(".jpg")) { continue; } 97 98 string imgname = System.IO.Path.GetFileName(imgfiles[i]); 99 string fullpath = curprodpath + "/" + imgname; 100 imglist.Add(fullpath); 101 102 var active = (counter == 0 ? "active" : ""); 103 <div data-slide-number="@counter" class="item @active" data-hires="/admin/public/getimage.ashx?Image=@fullpath&Format=jpg&Compression=85&width=1900&height=1200&Crop=5&altFmImage_path=/Files/Images/NoImageAvailable.png"> 104 <img src="/admin/public/getimage.ashx?Image=@fullpath&Format=jpg&Compression=85&width=400&height=400&Crop=5&altFmImage_path=/Files/Images/NoImageAvailable.png" alt="" title="@imgname" class="img-responsive panzoom-elements" data-original="@fullpath" /> 105 </div> 106 107 counter = counter + 1; 108 109 } 110 111 foreach (var url in fieldRelatedImages) 112 { 113 if (!string.IsNullOrEmpty(url)) 114 { 115 <div data-slide-number="@counter" class="item " data-hires="/admin/public/getimage.ashx?Image=@url&Format=jpg&Compression=85&width=1900&height=1200&Crop=5&altFmImage_path=/Files/Images/NoImageAvailable.png"> 116 <img src="/admin/public/getimage.ashx?Image=@url&Format=jpg&Compression=85&width=400&height=400&Crop=5&altFmImage_path=/Files/Images/NoImageAvailable.png" alt="" title="@url" class="img-responsive panzoom-elements" data-original="@url" /> 117 </div> 118 119 counter = counter + 1; 120 } 121 } 122 123 // Only show image functions if there is at least one image 124 if (counter > 0) { imgFunctions = true; } 125 126 // Only show image controls if there is at least two images 127 if (counter > 1) { imgControl = true; } 128 129 } 130 131 132 133 } 134 135 </div> 136 137 @if (imgControl) 138 { 139 <!-- Controls --> 140 <a class="left carousel-control" href="#carousel-productimages" data-slide="prev"> 141 <i class="fa fa-angle-left"></i> 142 </a> 143 <a class="right carousel-control" href="#carousel-productimages" data-slide="next"> 144 <i class="fa fa-angle-right"></i> 145 </a> 146 } 147 </div> 148 149 @if (imgFunctions) 150 { 151 <div class="img-controls text-right hidden-xs"> 152 <a href="javascript:;" id="download" title="@Translate("productImageDownloadLinkText", "Ladda ner högupplöst...")"><i class="fa fa-download"></i></a> 153 <a href="javascript:;" id="y-zoom" title="@Translate("productImageEnlargeLinkText", "Förstora...")"><i class="fa fa-search-plus"></i></a> 154 </div> 155 } 156 157 158 @if (imgControl) 159 { 160 161 var counterThumbs = 0; 162 foreach (var src in imglist) 163 { 164 <div class="carousel-item col-sm-4 hidden-xs"> 165 <a id="carousel-selector-@counterThumbs"> 166 <img class="img-responsive" src="/admin/public/getimage.ashx?Image=@src&Format=jpg&Compression=80&width=100&height=70&crop=5&altFmImage_path=/Files/Images/NoImageAvailable.png"> 167 </a> 168 </div> 169 counterThumbs = counterThumbs + 1; 170 } 171 172 <!--Start RelatedImages thumbs --> 173 foreach (var val in fieldRelatedImages) 174 { 175 var url = val; 176 if (!string.IsNullOrEmpty(url)) 177 { 178 179 <div class="carousel-item col-sm-4 hidden-xs"> 180 <a id="carousel-selector-@counterThumbs"> 181 <img class="img-responsive" src="/admin/public/getimage.ashx?Image=@url&Format=jpg&Compression=80&width=100&height=70&crop=5&altFmImage_path=/Files/Images/NoImageAvailable.png"> 182 </a> 183 </div> 184 } 185 186 counterThumbs = counterThumbs + 1; 187 } 188 <!--End RelatedImages thumbs --> 189 190 } 191 </div> <!-- #END carousel area --> 192 <!-- YouTube banner--> 193 @{ 194 string youtubeVId = string.Empty; // string.Empty; 195 if (GetString("Ecom:Product:Field.YouTypeLink").Contains("?v=")) 196 { 197 var tempArr = GetString("Ecom:Product:Field.YouTypeLink").Split('='); 198 youtubeVId = tempArr[1]; 199 } 200 } 201 202 @if (!string.IsNullOrEmpty(youtubeVId)) 203 { 204 var videoThumb = "http://img.youtube.com/vi/" + youtubeVId + "/0.jpg"; 205 <div class="col-sm-6 col-md-4 youtube-vid hidden-xs"> 206 <div class="thumbnail display-box"> 207 <a class="y-video" data-video="@GetValue("Ecom:Product:Field.YouTypeLink")" data-toggle="modal" data-target="#videoModal"> 208 <div class="display-img img-wrapp"> 209 <div class="img-inner youtube product"> 210 <img src="@videoThumb" class="img-responsive" alt="..."> 211 </div> 212 </div> 213 </a> 214 </div> 215 </div> 216 } 217 </div> 218 </div> 219 <!-- #END Left Column --> 220 221 <div class="product-right col-sm-4 col-sm-offset-1"> 222 <!-- Right Column --> 223 <div class="row"> 224 <div class="col-sm-12 text-common"> 225 <!--Start show brand logo--> 226 227 @{ 228 229 230 var myListId = (int)Pageview.Area.Item["BrandList"]; 231 var itemList = Dynamicweb.Content.Items.ItemList.GetItemListById(myListId); 232 int count = 0; 233 var loop = itemList.Relations.Cast<Dynamicweb.Content.Items.Item>(); 234 string Link = string.Empty; 235 236 foreach (var c in loop) 237 { 238 239 string nameId = ""; 240 241 string LogoPath = String.Empty; 242 string LogoSmallPath = String.Empty; 243 string LogoUrl = String.Empty; 244 string Match = GetString("Ecom:Product:Field.productTrademark").ToLower(); 245 Link = c["Link"].ToString(); 246 247 if (c["NameID"] != null) 248 { 249 nameId = c["NameID"].ToString().ToLower(); 250 } 251 252 if (c["Image"] != null) 253 { 254 LogoPath = c["Image"].ToString(); 255 } 256 257 if (c["ImageSmall"] != null) 258 { 259 LogoSmallPath = c["ImageSmall"].ToString(); 260 261 } 262 263 if (!string.IsNullOrEmpty(LogoSmallPath)) 264 { 265 266 LogoUrl = LogoSmallPath; 267 268 } 269 270 else if (!string.IsNullOrEmpty(LogoPath)) 271 { 272 273 LogoUrl = LogoPath; 274 } 275 276 if (nameId == Match && !string.IsNullOrEmpty(LogoUrl)) 277 { 278 279 <a href="@Link" target="_self" class="logo-container" style="background-image: url('/admin/public/getimage.ashx?Image=@LogoUrl&amp;Format=jpg&amp;Compression=90&amp;height=140&amp;crop=0&amp;altFmImage_path=/Files/Images/NoImageAvailable.png'); background-position-y: bottom; " title="@nameId"></a> 280 281 count++; 282 283 } 284 if (nameId == Match && count == 0) 285 { 286 <a href="@Link" target="_self"> 287 <div class="itemBrand" style="height: 30px;padding-top: 12px">@GetString("Ecom:Product:Field.productTrademark")</div> 288 </a> 289 break; 290 } 291 292 } 293 294 } 295 296 <!--End show brand logo --> 297 298 <h1 class="Product-Title">@GetString("Ecom:Product.Name")</h1> 299 <span class="art-nr">Art. Nr: @GetValue("Ecom:Product.Number")</span> 300 @{ 301 var descr = GetString("Ecom:Product.LongDescription"); 302 303 <div class="lead"> 304 @descr 305 </div> 306 } 307 308 <div class="intro-black-collapse print-show collapse" id="viewdetails"> 309 </div> 310 311 <a class="pull-left las-mer hidden-print" data-toggle="collapse" data-target="#viewdetails">@Translate("productLongDescriptionReadMore", "Läs mer")<i class="fa fa-angle-right"></i></a> 312 </div> 313 </div> 314 315 <div class="x-print"> 316 <!-- well row --> 317 <div class="row well"> 318 <div class="col-md-12 no-padding"> 319 <div class="item-main-info"> 320 321 @{ 322 var stock = GetInteger("Ecom:Product:Field.ProductStockGlobal"); 323 324 if (stock <= 2) 325 { 326 disabledState = "disabled"; 327 } 328 329 var globalStockStatus = HelperClass.GetGlobalStockStatusByProductId(GetString("Ecom:Product.ID")); 330 331 332 var stockstatusClass = globalStockStatus.ExpectedDeliveryValue; 333 334 } 335 336 @if (!hideCart) 337 { 338 <div class="clearfix"> 339 <p> 340 <i class="fa stock-icon @stockstatusClass"></i><span>@globalStockStatus.Text</span> 341 </p> 342 </div> 343 } 344 </div> 345 346 <form class="form-inline"> 347 <div class="item-main-info"> 348 @{ 349 if (GetBoolean("Ecom:Product:Field.productCampaign") && ConsumerOldPrice > 0) 350 { 351 <div class="inline-price"> 352 <h5 class="campaign-price">@priceFormattedWithVat</h5> 353 &nbsp; 354 <h6 class="old-price">@ConsumerOldPriceFormatted</h6> 355 </div> 356 } 357 else 358 { 359 <h5>@priceFormattedWithVat</h5> 360 } 361 } 362 </div> 363 364 @if (!hideCart) 365 { 366 <div class="form-group inline @disabledState "> 367 <button id="btnBuy" 368 onclick="Cart.addToBasket(@GetValue("Ecom:Product:Page.ID"), '@GetValue("Ecom:Product.ID")', '@GetValue("Ecom:Product.Number")', this);gtag('event', 'Konsument Global - Köp');" 369 class="btn btn-default consument" type="button"> 370 @Translate("productAddToCartButtonText", "LÄGG I VARUKORG") 371 <i class="fa fa-refresh"></i> 372 </button> 373 </div> 374 } 375 else 376 { 377 <a href="/Default.aspx?ID=@buyHerePageID" class="buyHereLink"> 378 <div class="form-group inline"> 379 <button id="btnBuy" class="btn btn-default consument" type="button"> 380 @Translate("productBuyInShopButtonText", "KÖP I BUTIK") 381 </button> 382 </div> 383 </a> 384 } 385 386 <div class="form-group inline"> 387 @if (!string.IsNullOrEmpty(GetString("Ecom:Product.AddToFavorites"))) 388 { 389 string favorite = GetBoolean("Ecom:Product.IsProductInFavoriteList") ? "favorite checked" : "favorite "; 390 <a href="javascript:;" onclick="Product.addToFavorites('?CCAddToMyLists=@GetString("Ecom:Product.ID")&CCAddToListVariantID=&CCAddToListLanguageID=LANG2', this)" class="btn btn-default @favorite " type="button"></a> 391 392 } 393 </div> 394 395 </form> 396 397 @if (!hideCart && !GetBoolean("Ecom:Product:Field.productOutlet")) 398 { 399 <div style="margin-top: 3px"> 400 <a href="#" onclick="$('#findStore').modal('show'); gtag('event', 'Konsument Global - Köp i butik');"> 401 @Translate("productBuyInShopButtonText", "KÖP I BUTIK") 402 </a> 403 </div> 404 } 405 406 407 @if (!hideCart && stock <= 2) 408 { 409 410 <div id="priceDetails" class=""> <p class="outOfstocInfoText">@Translate("productButtonOutOfStockContactUS", "Varan är slut på lager - vänligen kontakta oss för mer information")</p></div> 411 412 } 413 414 </div> 415 <div style="margin-bottom: 15px;" class="visible-sm visible-xs clearfix"></div> 416 </div> 417 </div> 418 </div> 419 </div> 420 421 <div class="row tabs"> 422 423 <div class="col-md-10 tab-list"> 424 425 <ul class="nav nav-pills"> 426 427 <li class="active"><a data-toggle="tab" href="#product-description">@Translate("productTabHeaderDescription", "Beskrivning")</a></li> 428 429 <li><a data-toggle="tab" href="#product-tecnical">@Translate("productTabHeaderTechInfo", "Teknisk info")</a></li> 430 431 @if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.guaranteeText"))) 432 { 433 <li><a data-toggle="tab" href="#product-warranty">@Translate("productTabHeaderWarrenty", "Garanti")</a></li> 434 } 435 @if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.CareInstructions1")) || !string.IsNullOrEmpty(GetString("Ecom:Product:Field.CareInstructions2")) || !string.IsNullOrEmpty(GetString("Ecom:Product:Field.CareInstructions3"))) 436 { 437 <li><a data-toggle="tab" href="#product-care">@Translate("productTabHeaderCare", "Skötsel")</a></li> 438 } 439 @{ 440 try 441 { 442 string[] docfiles = System.IO.Directory.GetFiles(System.Web.HttpContext.Current.Server.MapPath(curprodpath + "/docs")); 443 444 if (docfiles.Length > 0) 445 { 446 <li><a data-toggle="tab" href="#product-documents">@Translate("productTabHeaderDocs", "Dokument")</a></li> 447 448 } 449 else 450 { 451 foreach (LoopItem i in GetLoop("Details")) 452 { 453 if (!string.IsNullOrEmpty(@i.GetString("Ecom:Product:Detail.Image.Clean"))) 454 { 455 <li><a data-toggle="tab" href="#product-documents">@Translate("productTabHeaderDocs", "Dokument")</a></li> 456 break; 457 } 458 } 459 } 460 } 461 catch 462 { 463 foreach (LoopItem i in GetLoop("Details")) 464 { 465 if (!string.IsNullOrEmpty(@i.GetString("Ecom:Product:Detail.Image.Clean"))) 466 { 467 468 <li><a data-toggle="tab" href="#product-documents">@Translate("productTabHeaderDocs", "Dokument")</a></li> 469 break; 470 } 471 } 472 } 473 } 474 475 476 </ul> 477 478 <div class="tab-content"> 479 <div id="product-description" class="tab-pane fade in active"> 480 @GetValue("Ecom:Product:Field.DescriptionLong") 481 </div> 482 483 <div id="product-tecnical" class="tab-pane fade"> 484 485 @if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.TechInfo"))) 486 { 487 @GetValue("Ecom:Product:Field.TechInfo") 488 } 489 490 <div class="product-tecnical"> 491 492 @{ 493 if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.productTrademark.Value.Clean"))) 494 { 495 496 <div class="left"><label>@Translate("productTecnicalBrand", "Varumärke")</label></div> 497 <div class="right"><span class="tech-details-value">@GetString("Ecom:Product:Field.productTrademark.Value.Clean")</span></div> 498 499 } 500 if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.productSeries.Value.Clean"))) 501 { 502 503 <div class="left"><label>@Translate("productTecnicalSeries", "Serie")</label></div> 504 <div class="right"><span class="tech-details-value">@GetString("Ecom:Product:Field.productSeries.Value.Clean")</span></div> 505 } 506 if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.ProductColor.Value.Clean"))) 507 { 508 509 <div class="left"><label>@Translate("productTecnicalColor", "Färg")</label></div> 510 <div class="right"><span class="tech-details-value">@GetString("Ecom:Product:Field.ProductColor.Value.Clean")</span></div> 511 512 } 513 if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.productMaterial.Value.Clean"))) 514 { 515 516 <div class="left"><label>@Translate("productTecnicalMaterial", "Material")</label></div> 517 <div class="right"><span class="tech-details-value">@GetString("Ecom:Product:Field.productMaterial.Value.Clean")</span></div> 518 519 520 } 521 if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.productSize.Value.Clean"))) 522 { 523 524 <div class="left"><label>@Translate("productTecnicalSize", "Storlek")</label></div> 525 <div class="right"><span class="tech-details-value">@GetString("Ecom:Product:Field.productSize.Value.Clean")</span></div> 526 } 527 if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.productsVolume.Value.Clean"))) 528 { 529 <div class="left"><label>Volym</label></div> 530 <div class="right"><span class="tech-details-value">@GetString("Ecom:Product:Field.productsVolume.Value.Clean") &nbsp;m&sup3;</span></div> 531 532 } 533 534 if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.produktEAN.Value.Clean"))) 535 { 536 <div class="left"><label>@Translate("productTecnicalEAN", "EAN")</label></div> 537 <div class="right"><span class="tech-details-value">@GetString("Ecom:Product:Field.produktEAN.Value.Clean")</span></div> 538 539 } 540 541 } 542 </div> 543 </div> 544 545 <div id="product-warranty" class="tab-pane fade"> 546 @{ 547 string pageId; 548 int id; 549 550 var path = GetString("Ecom:Product:Field.guaranteeText"); 551 552 if (!string.IsNullOrEmpty(path)) 553 { 554 555 pageId = path.Substring(path.IndexOf('=') + 1); 556 557 if (int.TryParse(pageId, out id)) 558 { 559 // Function that renders either pageItem "General_TextEditor" content OR all content from a regular page 560 @GetPageContent(id) 561 } 562 } 563 } 564 </div> 565 566 <div id="product-care" class="tab-pane fade"> 567 @{ 568 string[] fields = { "Ecom:Product:Field.CareInstructions1", "Ecom:Product:Field.CareInstructions2", "Ecom:Product:Field.CareInstructions3" }; 569 570 foreach (var fieldName in fields) 571 { 572 path = GetString(fieldName); 573 if (!string.IsNullOrEmpty(path)) 574 { 575 576 pageId = path.Substring(path.IndexOf('=') + 1); 577 id = Int32.Parse(pageId); 578 // Function that renders either pageItem "General_TextEditor" content OR all content from a regular page 579 @GetPageContent(id) 580 } 581 } 582 } 583 </div> 584 585 <div id="product-documents" class="tab-pane fade"> 586 <div class="dokument-div"> 587 <ul> 588 @{ 589 //Documents 590 try 591 { 592 string[] docfiles = System.IO.Directory.GetFiles(System.Web.HttpContext.Current.Server.MapPath(curprodpath + "/docs")); 593 594 if (docfiles.Length > 0) 595 { 596 597 for (int i = 0; i < docfiles.Length; i++) 598 { 599 var filename = System.IO.Path.GetFileName(docfiles[i]); 600 string fullpath = curprodpath + "/docs/" + filename; 601 602 <li> 603 <a href="@fullpath" target="_blank"> 604 <i class="fa fa-file-text-o"></i> @filename 605 </a> 606 </li> 607 } 608 } 609 } 610 catch (System.Exception e) 611 { 612 613 } 614 615 foreach (LoopItem i in GetLoop("Details")) 616 { 617 // You can get the details text fields using "Ecom:Product:Detail.Text" 618 if (!string.IsNullOrEmpty(i.GetString("Ecom:Product:Detail.Image.Clean"))) 619 { 620 string fullpath = i.GetString("Ecom:Product:Detail.Image.Clean"); 621 var filename = fullpath.Split('/').Last(); 622 <li> 623 <a href="@fullpath" target="_blank"> 624 <i class="fa fa-file-text-o"></i> @filename 625 </a> 626 </li> 627 } 628 } 629 } 630 </ul> 631 </div> 632 </div> 633 634 </div> <!-- #END Table --> 635 <!-- #END prod-list --> 636 </div> 637 </div> 638 639 @* MODAL CODE HAS BEEN MOVED TO \Files\Templates\Designs\CapoStarter\PageProduct.cshtml *@ 640 641 </div> 642 643 <div class="row"> 644 <div class="div-max1170-centered no-padding"> 645 @if (GetLoop("ProductRelatedGroups").Count() > 0) 646 { 647 <div class="col-md-12 prod-list"> 648 <!-- Prod-list --> 649 650 <h2 class="data-section-header">@Translate("productHeaderSimilarProducts", "Liknande produkter:")</h2> 651 <div class="row"> 652 @foreach (var relatedG in GetLoop("ProductRelatedGroups")) 653 { 654 foreach (var related in relatedG.GetLoop("RelatedProducts")) 655 { 656 657 658 <a href="@related.GetString("Ecom:Product.Link.Clean")"> 659 660 <div class="col-xs-12 col-sm-6 col-md-3"> 661 <div class="thumbnail dropdown-info"> 662 @{ 663 var imgsrc = "/admin/public/getimage.ashx?Image=/Files/Images/productImages/" + related.GetValue("Ecom:Product.Number") + "/" + related.GetValue("Ecom:Product.Number") + "_1.jpg&width=330&height=330&compression=85&Crop=5&Format=jpg&altFmImage_path=/Files/Images/NoImageAvailable.png"; 664 <div class="display-img"> 665 <img alt="@related.GetValue("Ecom:Product.Name")" src="@imgsrc" data-original="@imgsrc" class="img-responsive lazy"> 666 </div> 667 } 668 669 @if (related.GetString("Ecom:Product.MetaDescription").Length > 156) 670 { 671 @related.GetString("Ecom:Product.MetaDescription").Substring(0, 156)<text>...</text> 672 } 673 else 674 { 675 @related.GetValue("Ecom:Product.MetaDescription") 676 } 677 678 <div class="display-name"> 679 <div class="name-info"> 680 681 <div class="itemBrand">@GetValue("Ecom:Product:Field.productTrademark")</div> 682 <div class="itemName">@related.GetString("Ecom:Product.Name")</div> 683 <div class="itemNumber">Art. nr: @related.GetValue("Ecom:Product.Number")</div> 684 <div class="itemPrice" id='id_@related.GetValue("Ecom:Product.Number")'> 685 <b> 686 </b> 687 688 @if (related.GetValue("Ecom:Product.Price.Clean") != related.GetValue("Ecom:Product.ActualPrice.Clean")) 689 { 690 <span>(@related.GetValue("Ecom:Product.ActualPrice"))</span> 691 } 692 </div> 693 </div> 694 </div> 695 696 </div> 697 </div> 698 </a> 699 } 700 } 701 </div> 702 703 </div> 704 705 } 706 </div> 707 </div> 708 709 <!-- Start Flowbox Dynamic Product Flow--> 710 711 @{ 712 var enableFlowBoxScript = Convert.ToBoolean(Pageview.Area.Item["Enable_FlowboxScript"]); 713 var flowKey = Pageview.Area.Item["FlowKeyProductPage"]; 714 var locale = Pageview.Area.Item["FlowLocale"]; 715 var link = Pageview.Area.Item["FlowCarouselButtonLink"]; 716 717 var enableFlowBox = enableFlowBoxScript && !string.IsNullOrEmpty(flowKey.ToString()) && !string.IsNullOrEmpty(locale.ToString()); 718 719 if (enableFlowBox) 720 { 721 722 <div class="flow-text"> 723 <h2>@Translate("FlowboxHeaderText", "DELA DINA BILDER MED GLOBALKNIVAR")</h2> 724 <p>@Translate("FlowboxParagraphText", "Tagga #yesGlobalknivar så kanske dina bilder blir visade här.")</p> 725 </div> 726 727 <div id="js-flowbox-flow"></div> 728 729 <script> 730 window.flowbox('init', { 731 container: '#js-flowbox-flow', 732 key: '@flowKey', 733 locale: '@locale', 734 productId: '@GetValue("Ecom:Product.Number")' 735 }) 736 </script> 737 738 if (link != null) 739 { 740 <div class="button-section"> 741 <a class="inspiration-button" href="@link">@Translate("FlowboxLinkText", "FÅ MER INSPIRATION HÄR")</a> 742 </div> 743 } 744 } 745 } 746 747 748 749 <!-- End Flowbox Dynamic Product Flow--> 750 <!--Start Related catagory --> 751 <div class="row related-catagories-hide-if-empty"> 752 <div class="div-max1170-centered no-padding"> 753 <div class="col-md-12 related-categories"> 754 <h2>@Translate("productHeaderRelatedCategories", "Relaterade kategorier:")</h2> 755 <div class="form-group inline"> 756 757 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 758 759 760 @{ 761 var shopID = "SHOP1"; 762 var langID = "LANG2"; 763 var shop = new Dynamicweb.Ecommerce.Shops.Shop(shopID); 764 765 foreach (var group in shop.get_TopLevelGroups(langID)) 766 { 767 @GroupTemplate(group, 0, "", "") 768 } 769 770 } 771 772 @helper GroupTemplate(Dynamicweb.Ecommerce.Products.Group group, int level, string SubID, string Name) 773 { 774 775 776 var subID = SubID; 777 var name = Name; 778 779 780 foreach (LoopItem item in GetLoop("CustomGroupFields")) 781 { 782 783 if (!string.IsNullOrEmpty(item.GetString("related_Product_Catagories"))) 784 { 785 786 787 string[] listOfCats = item.GetString("related_Product_Catagories").Split(','); 788 789 790 for (int i = 0; i < listOfCats.Length; i++) 791 { 792 var groupId = listOfCats[i]; 793 794 groupId = groupId + "-at-SHOP1"; 795 796 if (subID == groupId) 797 { 798 799 800 <a href="Default.aspx?ID=2&GroupID=@groupId" class="btn btn-categories">@name</a> 801 } 802 803 } 804 } 805 } 806 807 if (group.Subgroups.Count > 0) 808 { 809 810 foreach (var subgroup in group.Subgroups) 811 { 812 @GroupTemplate(subgroup, level + 1, subgroup.Id, subgroup.Name) 813 814 } 815 816 } 817 818 } 819 820 821 </div> 822 </div> 823 </div> 824 </div> 825 <!--End Related catagory --> 826 <!--Start Combined products --> 827 <!--Get the no of combined products to adjust the layout --> 828 <!--if no combined products hide both combined and people also looked at--> 829 830 @{ 831 832 833 //var combinedProduct = true; 834 var headingClass = String.Empty; 835 var headingStyle = String.Empty; 836 837 //combinedProduct = GetBoolean("Ecom:Product:Field.CombinedProducts"); 838 var hasCombinedProducts = !string.IsNullOrEmpty(GetString("Ecom:Product:Field.CombinedProducts")) ? GetString("Ecom:Product:Field.CombinedProducts") : string.Empty; 839 840 841 842 843 if (hasCombinedProducts != string.Empty) 844 { 845 846 string[] getCombinedProducts = hasCombinedProducts.Replace(" ", "").Split(','); 847 848 //If there are combined products show header 849 if (GetString("Ecom:Product:Field.CombinedProducts").Length < 1) 850 { 851 headingStyle = "display:none"; 852 853 } 854 855 var noOfCombinedProducts = getCombinedProducts.Length; 856 857 //change layout per no of products 858 switch (noOfCombinedProducts) 859 { 860 case 1: 861 862 headingClass = "margin-left:-27%"; 863 864 break; 865 case 2: 866 headingClass = "margin-right:4%"; 867 break; 868 case 3: 869 headingClass = "Float:rleft; margin-left:-0%"; 870 break; 871 872 } 873 874 <!--Start Combined products --> 875 if (noOfCombinedProducts <= 2) 876 { 877 <div class="row combinedProducts" style="@headingStyle"> 878 <div class="div-max1170-centered no-padding"> 879 880 <h2 class="combined-products">@Translate("productHeaderCombinedProducts_global", "Kombinera Med:") <span class="hedear-pull-right" style="@headingClass">@Translate("productHeaderAlsoLookedAt", "Andra Har även tittat på:")</span></h2> 881 <!--Start Customers also looked at (Embed in same div as combined products) --> 882 <div class="combined-products"> 883 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 884 @using System 885 @using System.Activities.Expressions 886 @using System.Globalization 887 @using System.Linq 888 @using System.Web.Script.Serialization 889 @using App_Code 890 @using Dynamicweb.Controls 891 @using Dynamicweb.Controls.Extensibility 892 @using Dynamicweb.Ecommerce.Cart 893 @using Dynamicweb.Ecommerce.Notifications 894 @using Dynamicweb.Ecommerce.Products 895 @using Dynamicweb.Management.Ecommerce 896 @using Lucene.Net.Search 897 @using Microsoft.CodeAnalysis.VisualBasic.Syntax 898 @using Newtonsoft.Json 899 900 901 902 903 904 @{ 905 906 907 908 //Get the real data for the combined products 909 var combinedProductString = GetValue("Ecom:Product:Field.CombinedProducts").ToString(); 910 911 //If no products to combine dont continue 912 if (combinedProductString.Length < 1) 913 { 914 return; 915 } 916 917 var productServise = new ProductService(); 918 var baseProductId = prodnumber; 919 var listOfCombinedProducts = new List<string>(); 920 var prodLink = "#"; 921 var columnClass = ""; 922 var wrapperCount = ""; 923 var buyButtonStyle = ""; 924 925 926 // Split the product IDs into array 927 string[] dataSplit = (combinedProductString).Replace(" ", "").Split(','); 928 929 //Add to list 930 foreach (var product in dataSplit) 931 { 932 var productId = product; 933 934 listOfCombinedProducts.Add(productId); 935 } 936 937 //change layout per no of products 938 switch (dataSplit.Length) 939 { 940 case 1: 941 columnClass = "2"; 942 wrapperCount = "6"; 943 buyButtonStyle = "bottom:20px; margin-right:-28px; width:190px; padding-left:15px"; //Use this to add extra style to buy button 944 break; 945 case 2: 946 columnClass = "3"; 947 wrapperCount = "9"; 948 buyButtonStyle = "bottom:20px; margin-right:5px;"; //Use this to add extra style to buy button 949 break; 950 case 3: 951 columnClass = "4"; 952 wrapperCount = "12"; 953 wrapperCount = null; 954 buyButtonStyle = "bottom:-458px"; //Use this to add extra style to buy button 955 break; 956 } 957 958 var listOffProducts = new List<Product>(); 959 960 //Make the base product first item 961 listOffProducts.Add(productServise.GetProductByNumber(baseProductId, true)); 962 //get and and add product price to combined total price 963 964 double combinedPriceTotal = 0; 965 double combinedDiscounts = 0; 966 967 if (Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))) 968 { 969 var baseProductPrice = Convert.ToDouble(productServise.GetProductByNumber(baseProductId, true).GetPrice("SEK", "SE").PriceWithoutVAT); 970 combinedPriceTotal = baseProductPrice; 971 } 972 else 973 { 974 975 var baseProductPrice = Convert.ToDouble(productServise.GetProductByNumber(baseProductId, true).GetPrice("SEK", "SE").PriceWithVAT); 976 combinedPriceTotal = baseProductPrice; 977 } 978 979 var productCount = listOfCombinedProducts.Count; 980 var itemCounter = 0; 981 var listOfIds = new List<string>(); 982 var containsCampaign = false; 983 984 //Add main product to list of ids 985 listOfIds.Add(productServise.GetProductByNumber(baseProductId, true).Id); 986 987 //Add combined products to list of ids 988 foreach (var item in listOfCombinedProducts) 989 { 990 var items = productServise.GetProductByNumber(item, true); 991 992 //If product Id is incorrect do not continue 993 if (items == null) 994 { 995 return; 996 } 997 998 listOffProducts.Add(items); 999 listOfIds.Add(items.Id); 1000 1001 containsCampaign = (bool)productServise.GetProductByNumber(items.Number, false).ProductFieldValues.GetProductFieldValue("productCampaign").Value; 1002 1003 //check if there is a campaign product in the list and add them together 1004 if (containsCampaign == true) 1005 { 1006 // Consumer old price - for campaign price graphics 1007 var test = items.Number.ToString(); 1008 var productConsumerOldPrice = 0.0; 1009 var oldPriceAsString = productServise.GetProductByNumber(items.Number, false).ProductFieldValues.GetProductFieldValue("OldProductPrice").Value.ToString(); 1010 productConsumerOldPrice = Convert.ToDouble(oldPriceAsString, CultureInfo.InvariantCulture); 1011 1012 var productConsumerOldPriceWithVat = productConsumerOldPrice * 1.25; 1013 var productPrice = Convert.ToDouble(productServise.GetProductByNumber(items.Number, false).GetPrice("SEK", "SE").PriceWithVAT); 1014 combinedDiscounts = productConsumerOldPriceWithVat - productPrice; 1015 1016 } 1017 1018 //get and and add each combined products price and add to the combined total price 1019 if (Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))) 1020 { 1021 1022 var productPrice = Convert.ToDouble(productServise.GetProductByNumber(items.Number, false).GetPrice("SEK", "SE").PriceWithoutVAT); 1023 combinedPriceTotal = productPrice + combinedPriceTotal; 1024 } 1025 else 1026 { 1027 var productPrice = Convert.ToDouble(productServise.GetProductByNumber(items.Number, false).GetPrice("SEK", "SE").PriceWithVAT); 1028 combinedPriceTotal = productPrice + combinedPriceTotal; 1029 } 1030 1031 } 1032 1033 1034 1035 if (baseProductId != null) 1036 { 1037 1038 var simProdStock = 0; 1039 1040 <div class="fixed-height-boxes col-md-@wrapperCount"> 1041 1042 @foreach (var i in listOffProducts) 1043 { 1044 itemCounter++; 1045 var showHoverEfect = ""; 1046 if (itemCounter > 1) 1047 { 1048 showHoverEfect = "combinedProductLinkHover"; 1049 } 1050 1051 <div class=" col-md-@columnClass combindeProducts @showHoverEfect"> 1052 1053 @{ 1054 1055 string productNumberClean = i.Number.Replace("/", "-"); 1056 var imgsrc = "/admin/public/getimage.ashx?Image=/Files/Images/ProductImages/" + productNumberClean + "/" + productNumberClean + "_1.jpg&width=250&height=250&compression=85&Crop=5&Format=jpg&altFmImage_path=/Files/Images/NoImageAvailable.png"; 1057 var isCampaigne = (Boolean)i.GetProductFieldValue("productCampaign"); 1058 var isnews = (Boolean)i.GetProductFieldValue("productNews"); 1059 string ProductsPageId = GetPageIdByNavigationTag("ProductsPage").ToString(); 1060 string productId = i.Number + "-at-SHOP1"; 1061 var combindeProductsBuy = ""; 1062 var classAHref = ""; 1063 1064 if (isCampaigne && isnews) 1065 { 1066 <div class="labels"> 1067 <button class="btn btn-small btn-danger product-flag campaign">@Translate("product_Campaign_tag", "Campaign")</button> 1068 1069 <button class="btn btn-small btn-default product-flag news">@Translate("product_News_tag", "News")</button> 1070 </div> 1071 } 1072 1073 else if (isnews) 1074 { 1075 <button class="btn btn-small btn-default product-flag news alone">@Translate("product_News_tag", "News")</button> 1076 } 1077 1078 else if (isCampaigne) 1079 { 1080 <button class="btn btn-small btn-danger product-flag campaign alone">@Translate("product_Campaign_tag", "Campaign")</button> 1081 } 1082 1083 } 1084 1085 @if (itemCounter > 1) 1086 { 1087 1088 1089 prodLink = "/Default.aspx?ID=" + ProductsPageId + "&GroupID=" + GetValue("Ecom:Product.PrimaryOrFirstGroupID") + "&ProductID=" + i.IdUrlEncoded; 1090 1091 combindeProductsBuy = ""; 1092 //showHoverEfect = "combinedProductLinkHover"; 1093 } 1094 else 1095 { 1096 combindeProductsBuy = "combindeProductsBuy"; 1097 } 1098 1099 @if (itemCounter == 1) 1100 { 1101 classAHref = "buyHref"; 1102 } 1103 1104 <div class="thumbnail dropdown-info @showHoverEfect"> 1105 <a href=@prodLink class="@classAHref" > 1106 <div class="display-img"> 1107 <img alt="@i.Name" src="@imgsrc" data-original="@imgsrc" class="img-responsive lazy"> 1108 </div> 1109 1110 <div class="display-name"> 1111 <div class="name-info"> 1112 <div class="itemBrand">@i.GetProductFieldValue("productTrademark")</div> 1113 1114 <div class="itemName">@i.Name</div> 1115 1116 @if (!string.IsNullOrEmpty(i.GetProductFieldValue("productSeries").ToString())) 1117 { 1118 <div class="itemBrand">@Translate("productListSeriesLabel", "Serie:") @i.GetProductFieldValue("productSeries")</div> 1119 } 1120 1121 <div class="itemNumber">@Translate("productListArticleNrLabel", "Art. nr:") @i.Number</div> 1122 1123 </div> 1124 </div> 1125 </a> 1126 </div> 1127 @*//Add the + sign on combined products.*@ 1128 @if (itemCounter > 1) 1129 { 1130 <div class="circle"><h1 class="relatedProduct">+</h1></div> 1131 } 1132 </div> 1133 1134 1135 1136 <div class="@combindeProductsBuy" style="@buyButtonStyle"> 1137 @if (itemCounter <= 1) 1138 { 1139 1140 <div class="itemPrice" id='id_@i.Number'> 1141 1142 @if (Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))) 1143 { 1144 1145 string CustomerPriceFormatted = combinedPriceTotal.ToString("n", new CultureInfo(GetGlobalValue("Global:Area.Culture.Name"))) + GetGlobalValue("Global:eCommerce.Currency.Symbol"); 1146 1147 <span>@CustomerPriceFormatted</span> 1148 1149 } 1150 else 1151 { 1152 1153 var ConsumerPriceWithVatFormatted = combinedPriceTotal.ToString("n0", new CultureInfo(GetGlobalValue("Global:Area.Culture.Name"))) + GetGlobalValue("Global:eCommerce.Currency.Symbol"); 1154 1155 if (combinedDiscounts > 0) 1156 { 1157 1158 var ConsumerOldProductPrice = combinedPriceTotal + combinedDiscounts; 1159 1160 string ConsumerOldProductPriceFormatted = ConsumerOldProductPrice.ToString("n0", new CultureInfo(GetGlobalValue("Global:Area.Culture.Name"))) + GetGlobalValue("Global:eCommerce.Currency.Symbol"); 1161 1162 <div class="item-main-info campaign-price"> 1163 <span class="old-price">@ConsumerOldProductPriceFormatted </span>&nbsp; 1164 <span>@ConsumerPriceWithVatFormatted</span> 1165 </div> 1166 } 1167 else 1168 { 1169 1170 <div class="itemPrice"> 1171 <div class="item-main-info"> 1172 <span>@ConsumerPriceWithVatFormatted</span> 1173 </div> 1174 </div> 1175 } 1176 } 1177 </div> 1178 } 1179 1180 1181 1182 1183 1184 @*//If its the base product add the price and buy button*@ 1185 @if (i.Number == baseProductId) 1186 { 1187 1188 if (!hideCart && itemCounter <= 1) 1189 { 1190 string simProdDisabledState = ""; 1191 var getSimProductId = productId; 1192 1193 simProdStock = HelperClass.StockValue(getSimProductId); 1194 1195 1196 if (simProdStock <= 2) 1197 { 1198 simProdDisabledState = "disabled card"; 1199 } 1200 1201 <form name="multiForm" id="multiForm" method="post" class="form-inline product-card-buy-button relatedProducts @buttonClass @simProdDisabledState "> 1202 1203 @{ 1204 1205 var addedItems = new Dictionary<string, string>(); 1206 1207 addedItems.Add("CartCmd", "addmulti"); 1208 var productLoopCounter = 1; 1209 foreach (var s in listOfIds) 1210 { 1211 1212 var countVal = productLoopCounter.ToString(); 1213 1214 addedItems.Add("ProductLoopCounter" + countVal, countVal); 1215 addedItems.Add("ProductID" + countVal, s); 1216 addedItems.Add("VariantID" + countVal, ""); 1217 addedItems.Add("UnitID" + countVal, ""); 1218 addedItems.Add("Quantity" + countVal, "1"); 1219 1220 productLoopCounter++; 1221 } 1222 1223 } 1224 1225 <span id="multiProductData" data-json=@JsonConvert.SerializeObject(addedItems)> 1226 </span> 1227 <button id="btnBuy" 1228 onclick="Cart.addMultiProduct(@GetValue("Ecom:Product:Page.ID"),this)" 1229 class="btn btn-default" type="button"> 1230 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"> 1231 <polygon class="st0" points="152.8 42.3 57.1 42.3 36.6 -40.7 18.7 -40.7 18.7 -54.7 47.6 -54.7 68 28.3 143 28.3 160.7 -20.7 64.6 -19.9 64.5 -33.9 180.7 -34.9 " /> 1232 <path class="st0" d="M77.1 80.6c-11.9 0-21.6-9.7-21.6-21.6 0-11.9 9.7-21.6 21.6-21.6 11.9 0 21.6 9.7 21.6 21.6C98.7 70.9 89 80.6 77.1 80.6zM77.1 51.5c-4.2 0-7.6 3.4-7.6 7.6 0 4.2 3.4 7.6 7.6 7.6 4.2 0 7.6-3.4 7.6-7.6C84.7 54.9 81.3 51.5 77.1 51.5z" /> 1233 <path class="st0" d="M137.4 80.6c-11.9 0-21.6-9.7-21.6-21.6 0-11.9 9.7-21.6 21.6-21.6S159 47.1 159 59C159 70.9 149.3 80.6 137.4 80.6zM137.4 51.5c-4.2 0-7.6 3.4-7.6 7.6 0 4.2 3.4 7.6 7.6 7.6s7.6-3.4 7.6-7.6C145 54.9 141.6 51.5 137.4 51.5z" /> 1234 <polygon class="st0" points="124.6 -22.6 97.6 -50.9 75.4 -24.5 64.6 -33.5 96.9 -71.9 134.7 -32.3 " /> 1235 <polygon class="st0" points="172.6 -23.6 133.4 -52.5 117 -36.8 107.3 -46.9 132.3 -70.7 180.9 -34.8 " /> 1236 <path d="M19 5.8L19 5.8l-5.4-4 -2 1.9 -1.9-2L6.1 5.9h0l0 1.5 10.7-0.1 -2 5.5H6.5L4.2 3.6H1v1.6h2l2.3 9.2H6c-0.5 0.4-0.9 1.1-0.9 1.9 0 1.3 1.1 2.4 2.4 2.4s2.4-1.1 2.4-2.4c0-0.8-0.3-1.4-0.9-1.9h3.7c-0.5 0.4-0.9 1.1-0.9 1.9 0 1.3 1.1 2.4 2.4 2.4s2.4-1.1 2.4-2.4c0-0.8-0.4-1.4-0.9-1.9h0.2L19 5.8zM8.2 5.9L9.8 4l1.8 1.8L8.2 5.9zM13.7 5.8l-1-1 1-1 2.7 2L13.7 5.8zM7.5 17c-0.5 0-0.8-0.4-0.8-0.8 0-0.5 0.4-0.8 0.8-0.8 0.5 0 0.8 0.4 0.8 0.8C8.3 16.7 7.9 17 7.5 17zM14.2 17c-0.5 0-0.8-0.4-0.8-0.8 0-0.5 0.4-0.8 0.8-0.8 0.5 0 0.8 0.4 0.8 0.8C15 16.7 14.6 17 14.2 17z" /> 1237 <polygon points="19 5.8 19 5.8 19 5.8 " /> 1238 </svg> 1239 <i class="fa fa-refresh"></i> 1240 @if (loggedIn) 1241 { 1242 <span class="buyText">@Translate("productBuyButtonText", "Köp")</span> 1243 } 1244 </button> 1245 1246 </form> 1247 1248 } 1249 1250 } 1251 1252 </div> 1253 } 1254 </div> 1255 1256 } 1257 1258 } 1259 1260 1261 <div class="combined-products alsoLookedAt"> 1262 <h2 class="combined-products-mobile"><span>@Translate("productHeaderAlsoLookedAt", "Andra Har även tittat på:")</span></h2> 1263 <div class="row"> 1264 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 1265 @using System.Activities.Statements 1266 @using Dynamicweb.Ecommerce.Products 1267 @using System.Globalization 1268 @using System.Security.Cryptography 1269 @using App_Code 1270 1271 1272 1273 @{ 1274 1275 // Get and set values 1276 1277 var itemCountToList = 3 - productCount; 1278 var singleItemClass = ""; 1279 1280 if (productCount == 3 || productCount < 1) 1281 { 1282 itemCountToList = 4; 1283 1284 } 1285 1286 if (productCount == 2) 1287 { 1288 singleItemClass = "singleItem"; 1289 1290 } 1291 1292 var customersAlsoLookedAt = GetLoop("eCom:Related.CustomersWhoSawThisAlsoSaw").GetRange(0, itemCountToList); 1293 1294 1295 if (customersAlsoLookedAt != null) 1296 { 1297 1298 var thisProdStock = 0; 1299 1300 1301 foreach (LoopItem loopitem in customersAlsoLookedAt) 1302 { 1303 var product = productServise.GetProductByNumber(loopitem.GetString("Ecom:Product.Number"), false); 1304 1305 <div class="col-md-3"> 1306 1307 @{ 1308 1309 string productNumberClean = product.Number.Replace("/", "-"); 1310 var imgsrc = "/admin/public/getimage.ashx?Image=/Files/Images/ProductImages/" + productNumberClean + "/" + productNumberClean + "_1.jpg&width=250&height=250&compression=85&Crop=5&Format=jpg&altFmImage_path=/Files/Images/NoImageAvailable.png"; 1311 var isCampaigne = (Boolean)product.GetProductFieldValue("productCampaign"); 1312 var isnews = (Boolean)product.GetProductFieldValue("productNews"); 1313 string ProductsPageId = GetPageIdByNavigationTag("ProductsPage").ToString(); 1314 string productId = product.Number + "-at-SHOP1"; 1315 1316 if (isCampaigne && isnews) 1317 { 1318 <div class="labels"> 1319 <button class="btn btn-small btn-danger product-flag campaign">@Translate("product_Campaign_tag", "Campaign")</button> 1320 1321 <button class="btn btn-small btn-default product-flag news">@Translate("product_News_tag", "News")</button> 1322 </div> 1323 } 1324 1325 else if (isnews) 1326 { 1327 <button class="btn btn-small btn-default product-flag news alone">@Translate("product_News_tag", "News")</button> 1328 } 1329 1330 else if (isCampaigne) 1331 { 1332 <button class="btn btn-small btn-danger product-flag campaign alone">@Translate("product_Campaign_tag", "Campaign")</button> 1333 } 1334 1335 } 1336 1337 <div class="thumbnail dropdown-info @singleItemClass"> 1338 <a href="/Default.aspx?ID=@ProductsPageId&GroupID=@GetValue("Ecom:Product.PrimaryOrFirstGroupID")&ProductID=@product.IdUrlEncoded"> 1339 <div class="display-img"> 1340 <img alt="@product.Name" src="@imgsrc" data-original="@imgsrc" class="img-responsive lazy"> 1341 </div> 1342 <div class="display-name"> 1343 <div class="name-info"> 1344 <div class="itemBrand">@product.GetProductFieldValue("productTrademark")</div> 1345 <div class="itemName">@product.Name</div> 1346 @if (!string.IsNullOrEmpty(product.GetProductFieldValue("productSeries").ToString())) 1347 { 1348 <div class="itemBrand">@Translate("productListSeriesLabel", "Serie:") @product.GetProductFieldValue("productSeries")</div> 1349 } 1350 <div class="itemNumber">@Translate("productListArticleNrLabel", "Art. nr:") @product.Number</div> 1351 <div class="itemPrice" id='id_@product.Number'> 1352 1353 @if (Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))) 1354 { 1355 1356 decimal CustomerPrice = Convert.ToDecimal(!string.IsNullOrEmpty(product.Price.PriceWithoutVAT.ToString()) ? product.Price.PriceWithoutVAT.ToString() : "0"); 1357 string CustomerPriceFormatted = CustomerPrice.ToString("n", new CultureInfo(GetGlobalValue("Global:Area.Culture.Name"))) + GetGlobalValue("Global:eCommerce.Currency.Symbol"); 1358 1359 1360 1361 <span>@CustomerPriceFormatted</span> 1362 1363 } 1364 else 1365 { 1366 decimal ConsumnerPriceWithVat = Convert.ToDecimal(!string.IsNullOrEmpty(product.Price.PriceWithVAT.ToString()) ? product.Price.PriceWithVAT.ToString() : "0"); 1367 var ConsumnerPriceWithVatFormatted = ConsumnerPriceWithVat.ToString("n0", new CultureInfo(GetGlobalValue("Global:Area.Culture.Name"))) + GetGlobalValue("Global:eCommerce.Currency.Symbol"); 1368 1369 //Campaign price graphics 1370 double ConsumerOldProductPrice = double.Parse(product.GetProductFieldValue("OldProductPrice").ToString(), CultureInfo.InvariantCulture); 1371 ConsumerOldProductPrice = ConsumerOldProductPrice * 1.25; 1372 1373 if (isCampaigne && ConsumerOldProductPrice > 0) 1374 { 1375 string ConsumerOldProductPriceFormatted = ConsumerOldProductPrice.ToString("n0", new CultureInfo(GetGlobalValue("Global:Area.Culture.Name"))) + GetGlobalValue("Global:eCommerce.Currency.Symbol"); 1376 1377 <div class="item-main-info campaign-price"> 1378 <span class="old-price">@ConsumerOldProductPriceFormatted </span>&nbsp; 1379 <span>@ConsumnerPriceWithVatFormatted </span> 1380 </div> 1381 1382 } 1383 else 1384 { 1385 1386 <div class="itemPrice"> 1387 1388 <div class="item-main-info"> 1389 <span>@ConsumnerPriceWithVatFormatted</span> 1390 </div> 1391 1392 </div> 1393 1394 1395 1396 1397 } 1398 1399 } 1400 </div> 1401 </div> 1402 </div> 1403 </a> 1404 1405 @if (!hideCart) 1406 { 1407 string simProdDisabledState = ""; 1408 var thisProductId = productId; 1409 1410 thisProdStock = HelperClass.StockValue(thisProductId); 1411 1412 1413 if (thisProdStock <= 2) 1414 { 1415 simProdDisabledState = "disabled card"; 1416 } 1417 1418 1419 1420 <form class="form-inline product-card-buy-button @buttonClass @simProdDisabledState "> 1421 <span> 1422 <button id="btnBuy" 1423 onclick="Cart.addToBasket(@ProductsPageId, '@productId', '@productNumberClean', this);" 1424 class="btn btn-default @buttonClass" type="button" style="float: right; margin-top: -35px;"> 1425 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"> 1426 <polygon class="st0" points="152.8 42.3 57.1 42.3 36.6 -40.7 18.7 -40.7 18.7 -54.7 47.6 -54.7 68 28.3 143 28.3 160.7 -20.7 64.6 -19.9 64.5 -33.9 180.7 -34.9 " /> 1427 <path class="st0" d="M77.1 80.6c-11.9 0-21.6-9.7-21.6-21.6 0-11.9 9.7-21.6 21.6-21.6 11.9 0 21.6 9.7 21.6 21.6C98.7 70.9 89 80.6 77.1 80.6zM77.1 51.5c-4.2 0-7.6 3.4-7.6 7.6 0 4.2 3.4 7.6 7.6 7.6 4.2 0 7.6-3.4 7.6-7.6C84.7 54.9 81.3 51.5 77.1 51.5z" /> 1428 <path class="st0" d="M137.4 80.6c-11.9 0-21.6-9.7-21.6-21.6 0-11.9 9.7-21.6 21.6-21.6S159 47.1 159 59C159 70.9 149.3 80.6 137.4 80.6zM137.4 51.5c-4.2 0-7.6 3.4-7.6 7.6 0 4.2 3.4 7.6 7.6 7.6s7.6-3.4 7.6-7.6C145 54.9 141.6 51.5 137.4 51.5z" /> 1429 <polygon class="st0" points="124.6 -22.6 97.6 -50.9 75.4 -24.5 64.6 -33.5 96.9 -71.9 134.7 -32.3 " /> 1430 <polygon class="st0" points="172.6 -23.6 133.4 -52.5 117 -36.8 107.3 -46.9 132.3 -70.7 180.9 -34.8 " /> 1431 <path d="M19 5.8L19 5.8l-5.4-4 -2 1.9 -1.9-2L6.1 5.9h0l0 1.5 10.7-0.1 -2 5.5H6.5L4.2 3.6H1v1.6h2l2.3 9.2H6c-0.5 0.4-0.9 1.1-0.9 1.9 0 1.3 1.1 2.4 2.4 2.4s2.4-1.1 2.4-2.4c0-0.8-0.3-1.4-0.9-1.9h3.7c-0.5 0.4-0.9 1.1-0.9 1.9 0 1.3 1.1 2.4 2.4 2.4s2.4-1.1 2.4-2.4c0-0.8-0.4-1.4-0.9-1.9h0.2L19 5.8zM8.2 5.9L9.8 4l1.8 1.8L8.2 5.9zM13.7 5.8l-1-1 1-1 2.7 2L13.7 5.8zM7.5 17c-0.5 0-0.8-0.4-0.8-0.8 0-0.5 0.4-0.8 0.8-0.8 0.5 0 0.8 0.4 0.8 0.8C8.3 16.7 7.9 17 7.5 17zM14.2 17c-0.5 0-0.8-0.4-0.8-0.8 0-0.5 0.4-0.8 0.8-0.8 0.5 0 0.8 0.4 0.8 0.8C15 16.7 14.6 17 14.2 17z" /> 1432 <polygon points="19 5.8 19 5.8 19 5.8 " /> 1433 </svg> 1434 @if (loggedIn) 1435 { 1436 @Translate("productBuyButtonText", "Köp"); 1437 } 1438 <i class="fa fa-refresh"></i> 1439 </span> 1440 </form> 1441 1442 1443 } 1444 1445 </div> 1446 1447 </div> 1448 1449 } 1450 } 1451 } 1452 1453 1454 1455 </div> 1456 </div> 1457 </div> 1458 <!--End Start Customers also looked at --> 1459 </div> 1460 </div> 1461 1462 } 1463 if (noOfCombinedProducts >= 3) 1464 { 1465 <div class="row combinedProducts"> 1466 <div class="div-max1170-centered no-padding"> 1467 1468 <h2>@Translate("productHeaderCombinedProducts_global", "Kombinera Med:")</h2> 1469 <!--Start Customers also looked at --> 1470 <div class="combined-products"> 1471 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 1472 @using System 1473 @using System.Activities.Expressions 1474 @using System.Globalization 1475 @using System.Linq 1476 @using System.Web.Script.Serialization 1477 @using App_Code 1478 @using Dynamicweb.Controls 1479 @using Dynamicweb.Controls.Extensibility 1480 @using Dynamicweb.Ecommerce.Cart 1481 @using Dynamicweb.Ecommerce.Notifications 1482 @using Dynamicweb.Ecommerce.Products 1483 @using Dynamicweb.Management.Ecommerce 1484 @using Lucene.Net.Search 1485 @using Microsoft.CodeAnalysis.VisualBasic.Syntax 1486 @using Newtonsoft.Json 1487 1488 1489 1490 1491 1492 @{ 1493 1494 1495 1496 //Get the real data for the combined products 1497 var combinedProductString = GetValue("Ecom:Product:Field.CombinedProducts").ToString(); 1498 1499 //If no products to combine dont continue 1500 if (combinedProductString.Length < 1) 1501 { 1502 return; 1503 } 1504 1505 var productServise = new ProductService(); 1506 var baseProductId = prodnumber; 1507 var listOfCombinedProducts = new List<string>(); 1508 var prodLink = "#"; 1509 var columnClass = ""; 1510 var wrapperCount = ""; 1511 var buyButtonStyle = ""; 1512 1513 1514 // Split the product IDs into array 1515 string[] dataSplit = (combinedProductString).Replace(" ", "").Split(','); 1516 1517 //Add to list 1518 foreach (var product in dataSplit) 1519 { 1520 var productId = product; 1521 1522 listOfCombinedProducts.Add(productId); 1523 } 1524 1525 //change layout per no of products 1526 switch (dataSplit.Length) 1527 { 1528 case 1: 1529 columnClass = "2"; 1530 wrapperCount = "6"; 1531 buyButtonStyle = "bottom:20px; margin-right:-28px; width:190px; padding-left:15px"; //Use this to add extra style to buy button 1532 break; 1533 case 2: 1534 columnClass = "3"; 1535 wrapperCount = "9"; 1536 buyButtonStyle = "bottom:20px; margin-right:5px;"; //Use this to add extra style to buy button 1537 break; 1538 case 3: 1539 columnClass = "4"; 1540 wrapperCount = "12"; 1541 wrapperCount = null; 1542 buyButtonStyle = "bottom:-458px"; //Use this to add extra style to buy button 1543 break; 1544 } 1545 1546 var listOffProducts = new List<Product>(); 1547 1548 //Make the base product first item 1549 listOffProducts.Add(productServise.GetProductByNumber(baseProductId, true)); 1550 //get and and add product price to combined total price 1551 1552 double combinedPriceTotal = 0; 1553 double combinedDiscounts = 0; 1554 1555 if (Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))) 1556 { 1557 var baseProductPrice = Convert.ToDouble(productServise.GetProductByNumber(baseProductId, true).GetPrice("SEK", "SE").PriceWithoutVAT); 1558 combinedPriceTotal = baseProductPrice; 1559 } 1560 else 1561 { 1562 1563 var baseProductPrice = Convert.ToDouble(productServise.GetProductByNumber(baseProductId, true).GetPrice("SEK", "SE").PriceWithVAT); 1564 combinedPriceTotal = baseProductPrice; 1565 } 1566 1567 var productCount = listOfCombinedProducts.Count; 1568 var itemCounter = 0; 1569 var listOfIds = new List<string>(); 1570 var containsCampaign = false; 1571 1572 //Add main product to list of ids 1573 listOfIds.Add(productServise.GetProductByNumber(baseProductId, true).Id); 1574 1575 //Add combined products to list of ids 1576 foreach (var item in listOfCombinedProducts) 1577 { 1578 var items = productServise.GetProductByNumber(item, true); 1579 1580 //If product Id is incorrect do not continue 1581 if (items == null) 1582 { 1583 return; 1584 } 1585 1586 listOffProducts.Add(items); 1587 listOfIds.Add(items.Id); 1588 1589 containsCampaign = (bool)productServise.GetProductByNumber(items.Number, false).ProductFieldValues.GetProductFieldValue("productCampaign").Value; 1590 1591 //check if there is a campaign product in the list and add them together 1592 if (containsCampaign == true) 1593 { 1594 // Consumer old price - for campaign price graphics 1595 var test = items.Number.ToString(); 1596 var productConsumerOldPrice = 0.0; 1597 var oldPriceAsString = productServise.GetProductByNumber(items.Number, false).ProductFieldValues.GetProductFieldValue("OldProductPrice").Value.ToString(); 1598 productConsumerOldPrice = Convert.ToDouble(oldPriceAsString, CultureInfo.InvariantCulture); 1599 1600 var productConsumerOldPriceWithVat = productConsumerOldPrice * 1.25; 1601 var productPrice = Convert.ToDouble(productServise.GetProductByNumber(items.Number, false).GetPrice("SEK", "SE").PriceWithVAT); 1602 combinedDiscounts = productConsumerOldPriceWithVat - productPrice; 1603 1604 } 1605 1606 //get and and add each combined products price and add to the combined total price 1607 if (Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))) 1608 { 1609 1610 var productPrice = Convert.ToDouble(productServise.GetProductByNumber(items.Number, false).GetPrice("SEK", "SE").PriceWithoutVAT); 1611 combinedPriceTotal = productPrice + combinedPriceTotal; 1612 } 1613 else 1614 { 1615 var productPrice = Convert.ToDouble(productServise.GetProductByNumber(items.Number, false).GetPrice("SEK", "SE").PriceWithVAT); 1616 combinedPriceTotal = productPrice + combinedPriceTotal; 1617 } 1618 1619 } 1620 1621 1622 1623 if (baseProductId != null) 1624 { 1625 1626 var simProdStock = 0; 1627 1628 <div class="fixed-height-boxes col-md-@wrapperCount"> 1629 1630 @foreach (var i in listOffProducts) 1631 { 1632 itemCounter++; 1633 var showHoverEfect = ""; 1634 if (itemCounter > 1) 1635 { 1636 showHoverEfect = "combinedProductLinkHover"; 1637 } 1638 1639 <div class=" col-md-@columnClass combindeProducts @showHoverEfect"> 1640 1641 @{ 1642 1643 string productNumberClean = i.Number.Replace("/", "-"); 1644 var imgsrc = "/admin/public/getimage.ashx?Image=/Files/Images/ProductImages/" + productNumberClean + "/" + productNumberClean + "_1.jpg&width=250&height=250&compression=85&Crop=5&Format=jpg&altFmImage_path=/Files/Images/NoImageAvailable.png"; 1645 var isCampaigne = (Boolean)i.GetProductFieldValue("productCampaign"); 1646 var isnews = (Boolean)i.GetProductFieldValue("productNews"); 1647 string ProductsPageId = GetPageIdByNavigationTag("ProductsPage").ToString(); 1648 string productId = i.Number + "-at-SHOP1"; 1649 var combindeProductsBuy = ""; 1650 var classAHref = ""; 1651 1652 if (isCampaigne && isnews) 1653 { 1654 <div class="labels"> 1655 <button class="btn btn-small btn-danger product-flag campaign">@Translate("product_Campaign_tag", "Campaign")</button> 1656 1657 <button class="btn btn-small btn-default product-flag news">@Translate("product_News_tag", "News")</button> 1658 </div> 1659 } 1660 1661 else if (isnews) 1662 { 1663 <button class="btn btn-small btn-default product-flag news alone">@Translate("product_News_tag", "News")</button> 1664 } 1665 1666 else if (isCampaigne) 1667 { 1668 <button class="btn btn-small btn-danger product-flag campaign alone">@Translate("product_Campaign_tag", "Campaign")</button> 1669 } 1670 1671 } 1672 1673 @if (itemCounter > 1) 1674 { 1675 1676 1677 prodLink = "/Default.aspx?ID=" + ProductsPageId + "&GroupID=" + GetValue("Ecom:Product.PrimaryOrFirstGroupID") + "&ProductID=" + i.IdUrlEncoded; 1678 1679 combindeProductsBuy = ""; 1680 //showHoverEfect = "combinedProductLinkHover"; 1681 } 1682 else 1683 { 1684 combindeProductsBuy = "combindeProductsBuy"; 1685 } 1686 1687 @if (itemCounter == 1) 1688 { 1689 classAHref = "buyHref"; 1690 } 1691 1692 <div class="thumbnail dropdown-info @showHoverEfect"> 1693 <a href=@prodLink class="@classAHref" > 1694 <div class="display-img"> 1695 <img alt="@i.Name" src="@imgsrc" data-original="@imgsrc" class="img-responsive lazy"> 1696 </div> 1697 1698 <div class="display-name"> 1699 <div class="name-info"> 1700 <div class="itemBrand">@i.GetProductFieldValue("productTrademark")</div> 1701 1702 <div class="itemName">@i.Name</div> 1703 1704 @if (!string.IsNullOrEmpty(i.GetProductFieldValue("productSeries").ToString())) 1705 { 1706 <div class="itemBrand">@Translate("productListSeriesLabel", "Serie:") @i.GetProductFieldValue("productSeries")</div> 1707 } 1708 1709 <div class="itemNumber">@Translate("productListArticleNrLabel", "Art. nr:") @i.Number</div> 1710 1711 </div> 1712 </div> 1713 </a> 1714 </div> 1715 @*//Add the + sign on combined products.*@ 1716 @if (itemCounter > 1) 1717 { 1718 <div class="circle"><h1 class="relatedProduct">+</h1></div> 1719 } 1720 </div> 1721 1722 1723 1724 <div class="@combindeProductsBuy" style="@buyButtonStyle"> 1725 @if (itemCounter <= 1) 1726 { 1727 1728 <div class="itemPrice" id='id_@i.Number'> 1729 1730 @if (Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))) 1731 { 1732 1733 string CustomerPriceFormatted = combinedPriceTotal.ToString("n", new CultureInfo(GetGlobalValue("Global:Area.Culture.Name"))) + GetGlobalValue("Global:eCommerce.Currency.Symbol"); 1734 1735 <span>@CustomerPriceFormatted</span> 1736 1737 } 1738 else 1739 { 1740 1741 var ConsumerPriceWithVatFormatted = combinedPriceTotal.ToString("n0", new CultureInfo(GetGlobalValue("Global:Area.Culture.Name"))) + GetGlobalValue("Global:eCommerce.Currency.Symbol"); 1742 1743 if (combinedDiscounts > 0) 1744 { 1745 1746 var ConsumerOldProductPrice = combinedPriceTotal + combinedDiscounts; 1747 1748 string ConsumerOldProductPriceFormatted = ConsumerOldProductPrice.ToString("n0", new CultureInfo(GetGlobalValue("Global:Area.Culture.Name"))) + GetGlobalValue("Global:eCommerce.Currency.Symbol"); 1749 1750 <div class="item-main-info campaign-price"> 1751 <span class="old-price">@ConsumerOldProductPriceFormatted </span>&nbsp; 1752 <span>@ConsumerPriceWithVatFormatted</span> 1753 </div> 1754 } 1755 else 1756 { 1757 1758 <div class="itemPrice"> 1759 <div class="item-main-info"> 1760 <span>@ConsumerPriceWithVatFormatted</span> 1761 </div> 1762 </div> 1763 } 1764 } 1765 </div> 1766 } 1767 1768 1769 1770 1771 1772 @*//If its the base product add the price and buy button*@ 1773 @if (i.Number == baseProductId) 1774 { 1775 1776 if (!hideCart && itemCounter <= 1) 1777 { 1778 string simProdDisabledState = ""; 1779 var getSimProductId = productId; 1780 1781 simProdStock = HelperClass.StockValue(getSimProductId); 1782 1783 1784 if (simProdStock <= 2) 1785 { 1786 simProdDisabledState = "disabled card"; 1787 } 1788 1789 <form name="multiForm" id="multiForm" method="post" class="form-inline product-card-buy-button relatedProducts @buttonClass @simProdDisabledState "> 1790 1791 @{ 1792 1793 var addedItems = new Dictionary<string, string>(); 1794 1795 addedItems.Add("CartCmd", "addmulti"); 1796 var productLoopCounter = 1; 1797 foreach (var s in listOfIds) 1798 { 1799 1800 var countVal = productLoopCounter.ToString(); 1801 1802 addedItems.Add("ProductLoopCounter" + countVal, countVal); 1803 addedItems.Add("ProductID" + countVal, s); 1804 addedItems.Add("VariantID" + countVal, ""); 1805 addedItems.Add("UnitID" + countVal, ""); 1806 addedItems.Add("Quantity" + countVal, "1"); 1807 1808 productLoopCounter++; 1809 } 1810 1811 } 1812 1813 <span id="multiProductData" data-json=@JsonConvert.SerializeObject(addedItems)> 1814 </span> 1815 <button id="btnBuy" 1816 onclick="Cart.addMultiProduct(@GetValue("Ecom:Product:Page.ID"),this)" 1817 class="btn btn-default" type="button"> 1818 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"> 1819 <polygon class="st0" points="152.8 42.3 57.1 42.3 36.6 -40.7 18.7 -40.7 18.7 -54.7 47.6 -54.7 68 28.3 143 28.3 160.7 -20.7 64.6 -19.9 64.5 -33.9 180.7 -34.9 " /> 1820 <path class="st0" d="M77.1 80.6c-11.9 0-21.6-9.7-21.6-21.6 0-11.9 9.7-21.6 21.6-21.6 11.9 0 21.6 9.7 21.6 21.6C98.7 70.9 89 80.6 77.1 80.6zM77.1 51.5c-4.2 0-7.6 3.4-7.6 7.6 0 4.2 3.4 7.6 7.6 7.6 4.2 0 7.6-3.4 7.6-7.6C84.7 54.9 81.3 51.5 77.1 51.5z" /> 1821 <path class="st0" d="M137.4 80.6c-11.9 0-21.6-9.7-21.6-21.6 0-11.9 9.7-21.6 21.6-21.6S159 47.1 159 59C159 70.9 149.3 80.6 137.4 80.6zM137.4 51.5c-4.2 0-7.6 3.4-7.6 7.6 0 4.2 3.4 7.6 7.6 7.6s7.6-3.4 7.6-7.6C145 54.9 141.6 51.5 137.4 51.5z" /> 1822 <polygon class="st0" points="124.6 -22.6 97.6 -50.9 75.4 -24.5 64.6 -33.5 96.9 -71.9 134.7 -32.3 " /> 1823 <polygon class="st0" points="172.6 -23.6 133.4 -52.5 117 -36.8 107.3 -46.9 132.3 -70.7 180.9 -34.8 " /> 1824 <path d="M19 5.8L19 5.8l-5.4-4 -2 1.9 -1.9-2L6.1 5.9h0l0 1.5 10.7-0.1 -2 5.5H6.5L4.2 3.6H1v1.6h2l2.3 9.2H6c-0.5 0.4-0.9 1.1-0.9 1.9 0 1.3 1.1 2.4 2.4 2.4s2.4-1.1 2.4-2.4c0-0.8-0.3-1.4-0.9-1.9h3.7c-0.5 0.4-0.9 1.1-0.9 1.9 0 1.3 1.1 2.4 2.4 2.4s2.4-1.1 2.4-2.4c0-0.8-0.4-1.4-0.9-1.9h0.2L19 5.8zM8.2 5.9L9.8 4l1.8 1.8L8.2 5.9zM13.7 5.8l-1-1 1-1 2.7 2L13.7 5.8zM7.5 17c-0.5 0-0.8-0.4-0.8-0.8 0-0.5 0.4-0.8 0.8-0.8 0.5 0 0.8 0.4 0.8 0.8C8.3 16.7 7.9 17 7.5 17zM14.2 17c-0.5 0-0.8-0.4-0.8-0.8 0-0.5 0.4-0.8 0.8-0.8 0.5 0 0.8 0.4 0.8 0.8C15 16.7 14.6 17 14.2 17z" /> 1825 <polygon points="19 5.8 19 5.8 19 5.8 " /> 1826 </svg> 1827 <i class="fa fa-refresh"></i> 1828 @if (loggedIn) 1829 { 1830 <span class="buyText">@Translate("productBuyButtonText", "Köp")</span> 1831 } 1832 </button> 1833 1834 </form> 1835 1836 } 1837 1838 } 1839 1840 </div> 1841 } 1842 </div> 1843 1844 } 1845 1846 } 1847 1848 1849 </div> 1850 <!--End Start Customers also looked at --> 1851 </div> 1852 </div> 1853 1854 <!--If its new row(3 combined products then use normal styling) for the others have also looked at--> 1855 <div class="row similar-Products-hide-if-empty"> 1856 <div class="div-max1170-centered no-padding"> 1857 <div class="similar-products alsoLookedAt"> 1858 <h2>@Translate("productHeaderAlsoLookedAt_global", "Andra Har även tittat på:")</h2> 1859 <div class="form-group inline"> 1860 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 1861 @using System.Activities.Statements 1862 @using Dynamicweb.Ecommerce.Products 1863 @using System.Globalization 1864 @using System.Security.Cryptography 1865 @using App_Code 1866 1867 1868 1869 @{ 1870 1871 // Get and set values 1872 1873 var itemCountToList = 3 - productCount; 1874 var singleItemClass = ""; 1875 1876 if (productCount == 3 || productCount < 1) 1877 { 1878 itemCountToList = 4; 1879 1880 } 1881 1882 if (productCount == 2) 1883 { 1884 singleItemClass = "singleItem"; 1885 1886 } 1887 1888 var customersAlsoLookedAt = GetLoop("eCom:Related.CustomersWhoSawThisAlsoSaw").GetRange(0, itemCountToList); 1889 1890 1891 if (customersAlsoLookedAt != null) 1892 { 1893 1894 var thisProdStock = 0; 1895 1896 1897 foreach (LoopItem loopitem in customersAlsoLookedAt) 1898 { 1899 var product = productServise.GetProductByNumber(loopitem.GetString("Ecom:Product.Number"), false); 1900 1901 <div class="col-md-3"> 1902 1903 @{ 1904 1905 string productNumberClean = product.Number.Replace("/", "-"); 1906 var imgsrc = "/admin/public/getimage.ashx?Image=/Files/Images/ProductImages/" + productNumberClean + "/" + productNumberClean + "_1.jpg&width=250&height=250&compression=85&Crop=5&Format=jpg&altFmImage_path=/Files/Images/NoImageAvailable.png"; 1907 var isCampaigne = (Boolean)product.GetProductFieldValue("productCampaign"); 1908 var isnews = (Boolean)product.GetProductFieldValue("productNews"); 1909 string ProductsPageId = GetPageIdByNavigationTag("ProductsPage").ToString(); 1910 string productId = product.Number + "-at-SHOP1"; 1911 1912 if (isCampaigne && isnews) 1913 { 1914 <div class="labels"> 1915 <button class="btn btn-small btn-danger product-flag campaign">@Translate("product_Campaign_tag", "Campaign")</button> 1916 1917 <button class="btn btn-small btn-default product-flag news">@Translate("product_News_tag", "News")</button> 1918 </div> 1919 } 1920 1921 else if (isnews) 1922 { 1923 <button class="btn btn-small btn-default product-flag news alone">@Translate("product_News_tag", "News")</button> 1924 } 1925 1926 else if (isCampaigne) 1927 { 1928 <button class="btn btn-small btn-danger product-flag campaign alone">@Translate("product_Campaign_tag", "Campaign")</button> 1929 } 1930 1931 } 1932 1933 <div class="thumbnail dropdown-info @singleItemClass"> 1934 <a href="/Default.aspx?ID=@ProductsPageId&GroupID=@GetValue("Ecom:Product.PrimaryOrFirstGroupID")&ProductID=@product.IdUrlEncoded"> 1935 <div class="display-img"> 1936 <img alt="@product.Name" src="@imgsrc" data-original="@imgsrc" class="img-responsive lazy"> 1937 </div> 1938 <div class="display-name"> 1939 <div class="name-info"> 1940 <div class="itemBrand">@product.GetProductFieldValue("productTrademark")</div> 1941 <div class="itemName">@product.Name</div> 1942 @if (!string.IsNullOrEmpty(product.GetProductFieldValue("productSeries").ToString())) 1943 { 1944 <div class="itemBrand">@Translate("productListSeriesLabel", "Serie:") @product.GetProductFieldValue("productSeries")</div> 1945 } 1946 <div class="itemNumber">@Translate("productListArticleNrLabel", "Art. nr:") @product.Number</div> 1947 <div class="itemPrice" id='id_@product.Number'> 1948 1949 @if (Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))) 1950 { 1951 1952 decimal CustomerPrice = Convert.ToDecimal(!string.IsNullOrEmpty(product.Price.PriceWithoutVAT.ToString()) ? product.Price.PriceWithoutVAT.ToString() : "0"); 1953 string CustomerPriceFormatted = CustomerPrice.ToString("n", new CultureInfo(GetGlobalValue("Global:Area.Culture.Name"))) + GetGlobalValue("Global:eCommerce.Currency.Symbol"); 1954 1955 1956 1957 <span>@CustomerPriceFormatted</span> 1958 1959 } 1960 else 1961 { 1962 decimal ConsumnerPriceWithVat = Convert.ToDecimal(!string.IsNullOrEmpty(product.Price.PriceWithVAT.ToString()) ? product.Price.PriceWithVAT.ToString() : "0"); 1963 var ConsumnerPriceWithVatFormatted = ConsumnerPriceWithVat.ToString("n0", new CultureInfo(GetGlobalValue("Global:Area.Culture.Name"))) + GetGlobalValue("Global:eCommerce.Currency.Symbol"); 1964 1965 //Campaign price graphics 1966 double ConsumerOldProductPrice = double.Parse(product.GetProductFieldValue("OldProductPrice").ToString(), CultureInfo.InvariantCulture); 1967 ConsumerOldProductPrice = ConsumerOldProductPrice * 1.25; 1968 1969 if (isCampaigne && ConsumerOldProductPrice > 0) 1970 { 1971 string ConsumerOldProductPriceFormatted = ConsumerOldProductPrice.ToString("n0", new CultureInfo(GetGlobalValue("Global:Area.Culture.Name"))) + GetGlobalValue("Global:eCommerce.Currency.Symbol"); 1972 1973 <div class="item-main-info campaign-price"> 1974 <span class="old-price">@ConsumerOldProductPriceFormatted </span>&nbsp; 1975 <span>@ConsumnerPriceWithVatFormatted </span> 1976 </div> 1977 1978 } 1979 else 1980 { 1981 1982 <div class="itemPrice"> 1983 1984 <div class="item-main-info"> 1985 <span>@ConsumnerPriceWithVatFormatted</span> 1986 </div> 1987 1988 </div> 1989 1990 1991 1992 1993 } 1994 1995 } 1996 </div> 1997 </div> 1998 </div> 1999 </a> 2000 2001 @if (!hideCart) 2002 { 2003 string simProdDisabledState = ""; 2004 var thisProductId = productId; 2005 2006 thisProdStock = HelperClass.StockValue(thisProductId); 2007 2008 2009 if (thisProdStock <= 2) 2010 { 2011 simProdDisabledState = "disabled card"; 2012 } 2013 2014 2015 2016 <form class="form-inline product-card-buy-button @buttonClass @simProdDisabledState "> 2017 <span> 2018 <button id="btnBuy" 2019 onclick="Cart.addToBasket(@ProductsPageId, '@productId', '@productNumberClean', this);" 2020 class="btn btn-default @buttonClass" type="button" style="float: right; margin-top: -35px;"> 2021 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"> 2022 <polygon class="st0" points="152.8 42.3 57.1 42.3 36.6 -40.7 18.7 -40.7 18.7 -54.7 47.6 -54.7 68 28.3 143 28.3 160.7 -20.7 64.6 -19.9 64.5 -33.9 180.7 -34.9 " /> 2023 <path class="st0" d="M77.1 80.6c-11.9 0-21.6-9.7-21.6-21.6 0-11.9 9.7-21.6 21.6-21.6 11.9 0 21.6 9.7 21.6 21.6C98.7 70.9 89 80.6 77.1 80.6zM77.1 51.5c-4.2 0-7.6 3.4-7.6 7.6 0 4.2 3.4 7.6 7.6 7.6 4.2 0 7.6-3.4 7.6-7.6C84.7 54.9 81.3 51.5 77.1 51.5z" /> 2024 <path class="st0" d="M137.4 80.6c-11.9 0-21.6-9.7-21.6-21.6 0-11.9 9.7-21.6 21.6-21.6S159 47.1 159 59C159 70.9 149.3 80.6 137.4 80.6zM137.4 51.5c-4.2 0-7.6 3.4-7.6 7.6 0 4.2 3.4 7.6 7.6 7.6s7.6-3.4 7.6-7.6C145 54.9 141.6 51.5 137.4 51.5z" /> 2025 <polygon class="st0" points="124.6 -22.6 97.6 -50.9 75.4 -24.5 64.6 -33.5 96.9 -71.9 134.7 -32.3 " /> 2026 <polygon class="st0" points="172.6 -23.6 133.4 -52.5 117 -36.8 107.3 -46.9 132.3 -70.7 180.9 -34.8 " /> 2027 <path d="M19 5.8L19 5.8l-5.4-4 -2 1.9 -1.9-2L6.1 5.9h0l0 1.5 10.7-0.1 -2 5.5H6.5L4.2 3.6H1v1.6h2l2.3 9.2H6c-0.5 0.4-0.9 1.1-0.9 1.9 0 1.3 1.1 2.4 2.4 2.4s2.4-1.1 2.4-2.4c0-0.8-0.3-1.4-0.9-1.9h3.7c-0.5 0.4-0.9 1.1-0.9 1.9 0 1.3 1.1 2.4 2.4 2.4s2.4-1.1 2.4-2.4c0-0.8-0.4-1.4-0.9-1.9h0.2L19 5.8zM8.2 5.9L9.8 4l1.8 1.8L8.2 5.9zM13.7 5.8l-1-1 1-1 2.7 2L13.7 5.8zM7.5 17c-0.5 0-0.8-0.4-0.8-0.8 0-0.5 0.4-0.8 0.8-0.8 0.5 0 0.8 0.4 0.8 0.8C8.3 16.7 7.9 17 7.5 17zM14.2 17c-0.5 0-0.8-0.4-0.8-0.8 0-0.5 0.4-0.8 0.8-0.8 0.5 0 0.8 0.4 0.8 0.8C15 16.7 14.6 17 14.2 17z" /> 2028 <polygon points="19 5.8 19 5.8 19 5.8 " /> 2029 </svg> 2030 @if (loggedIn) 2031 { 2032 @Translate("productBuyButtonText", "Köp"); 2033 } 2034 <i class="fa fa-refresh"></i> 2035 </span> 2036 </form> 2037 2038 2039 } 2040 2041 </div> 2042 2043 </div> 2044 2045 } 2046 } 2047 } 2048 2049 2050 2051 </div> 2052 </div> 2053 </div> 2054 </div> 2055 2056 } 2057 2058 } 2059 <!--End Combined products --> 2060 <!--Start Similar products --> 2061 <div class="row similar-Products-hide-if-empty"> 2062 <div class="div-max1170-centered no-padding"> 2063 <div class="similar-products"> 2064 <h2>@Translate("productHeaderSimilarProducts_global", "Liknande produkter:")</h2> 2065 <div class="form-group inline"> 2066 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2067 @using System.Activities.Statements 2068 @using Dynamicweb.Ecommerce.Products 2069 @using System.Globalization 2070 @using System.Security.Cryptography 2071 @using App_Code 2072 2073 @*Liknande produkter yta - speciell urvalslogik 2074 Dessa ska sökas fram enligt följande logik: 2075 Produkter i samma kategori 2076 Ta 2 som ligger närmast i pris uppåt 2077 Ta 2 som ligger närmast i pris nedåt*@ 2078 2079 @{ 2080 bool isGlobal = Convert.ToBoolean(Pageview.Area.Item["FilterGlobalProductsOnly"]); 2081 2082 // Get and set values 2083 var groupID = GetString("Ecom:Group.ID"); 2084 var productID = GetString("Ecom:Product.ID"); 2085 if (groupID == null & productID == null) 2086 { 2087 return; 2088 } 2089 var similarProducts = new SimilarProducts().GetSimilarProducts(groupID, productID, isGlobal); 2090 2091 if (similarProducts != null) 2092 { 2093 Dynamicweb.Ecommerce.LiveIntegration.Products.ProductManager.FetchProductInfos(similarProducts); 2094 var simProdStock = 0; 2095 2096 <div class="fixed-height-boxes"> 2097 2098 2099 @foreach (var i in similarProducts) 2100 { 2101 2102 <div class="col-md-3"> 2103 2104 @{ 2105 2106 string productNumberClean = i.Number.Replace("/", "-"); 2107 var imgsrc = "/admin/public/getimage.ashx?Image=/Files/Images/ProductImages/" + productNumberClean + "/" + productNumberClean + "_1.jpg&width=250&height=250&compression=85&Crop=5&Format=jpg&altFmImage_path=/Files/Images/NoImageAvailable.png"; 2108 var isCampaigne = (Boolean)i.GetProductFieldValue("productCampaign"); 2109 var isnews = (Boolean)i.GetProductFieldValue("productNews"); 2110 string ProductsPageId = GetPageIdByNavigationTag("ProductsPage").ToString(); 2111 string productId = i.Number + "-at-SHOP1"; 2112 2113 if (isCampaigne && isnews) 2114 { 2115 <div class="labels"> 2116 <button class="btn btn-small btn-danger product-flag campaign">@Translate("product_Campaign_tag", "Campaign")</button> 2117 2118 <button class="btn btn-small btn-default product-flag news">@Translate("product_News_tag", "News")</button> 2119 </div> 2120 } 2121 2122 else if (isnews) 2123 { 2124 <button class="btn btn-small btn-default product-flag news alone">@Translate("product_News_tag", "News")</button> 2125 } 2126 2127 else if (isCampaigne) 2128 { 2129 <button class="btn btn-small btn-danger product-flag campaign alone">@Translate("product_Campaign_tag", "Campaign")</button> 2130 } 2131 2132 } 2133 2134 <div class="thumbnail dropdown-info"> 2135 <a href="/Default.aspx?ID=@ProductsPageId&GroupID=@GetValue("Ecom:Product.PrimaryOrFirstGroupID")&ProductID=@i.IdUrlEncoded"> 2136 <div class="display-img"> 2137 <img alt="@i.Name" src="@imgsrc" data-original="@imgsrc" class="img-responsive lazy"> 2138 </div> 2139 <div class="display-name"> 2140 <div class="name-info"> 2141 <div class="itemBrand">@i.GetProductFieldValue("productTrademark")</div> 2142 <div class="itemName">@i.Name</div> 2143 @if (!string.IsNullOrEmpty(i.GetProductFieldValue("productSeries").ToString())) 2144 { 2145 <div class="itemBrand">@Translate("productListSeriesLabel", "Serie:") @i.GetProductFieldValue("productSeries")</div> 2146 } 2147 <div class="itemNumber">@Translate("productListArticleNrLabel", "Art. nr:") @i.Number</div> 2148 <div class="itemPrice" id='id_@i.Number'> 2149 2150 @if (Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))) 2151 { 2152 2153 decimal CustomerPrice = Convert.ToDecimal(!string.IsNullOrEmpty(i.Price.PriceWithoutVAT.ToString()) ? i.Price.PriceWithoutVAT.ToString() : "0"); 2154 string CustomerPriceFormatted = CustomerPrice.ToString("n", new CultureInfo(GetGlobalValue("Global:Area.Culture.Name"))) + GetGlobalValue("Global:eCommerce.Currency.Symbol"); 2155 2156 2157 2158 <span>@CustomerPriceFormatted</span> 2159 2160 } 2161 else 2162 { 2163 decimal ConsumnerPriceWithVat = Convert.ToDecimal(!string.IsNullOrEmpty(i.Price.PriceWithVAT.ToString()) ? i.Price.PriceWithVAT.ToString() : "0"); 2164 var ConsumnerPriceWithVatFormatted = ConsumnerPriceWithVat.ToString("n0", new CultureInfo(GetGlobalValue("Global:Area.Culture.Name"))) + GetGlobalValue("Global:eCommerce.Currency.Symbol"); 2165 2166 //Campaign price graphics 2167 double ConsumerOldProductPrice = double.Parse(i.GetProductFieldValue("OldProductPrice").ToString(), CultureInfo.InvariantCulture); 2168 ConsumerOldProductPrice = ConsumerOldProductPrice * 1.25; 2169 2170 if (isCampaigne && ConsumerOldProductPrice > 0) 2171 { 2172 string ConsumerOldProductPriceFormatted = ConsumerOldProductPrice.ToString("n0", new CultureInfo(GetGlobalValue("Global:Area.Culture.Name"))) + GetGlobalValue("Global:eCommerce.Currency.Symbol"); 2173 2174 <div class="item-main-info campaign-price"> 2175 <span class="old-price">@ConsumerOldProductPriceFormatted </span>&nbsp; 2176 <span>@ConsumnerPriceWithVatFormatted </span> 2177 </div> 2178 2179 } 2180 else 2181 { 2182 2183 <div class="itemPrice"> 2184 2185 <div class="item-main-info"> 2186 <span>@ConsumnerPriceWithVatFormatted</span> 2187 </div> 2188 2189 </div> 2190 2191 2192 2193 2194 } 2195 2196 } 2197 </div> 2198 </div> 2199 </div> 2200 </a> 2201 2202 @if (!hideCart) 2203 { 2204 string simProdDisabledState = ""; 2205 var getSimProductId = productId; 2206 2207 simProdStock = HelperClass.StockValue(getSimProductId); 2208 2209 2210 if (simProdStock <= 2) 2211 { 2212 simProdDisabledState = "disabled card"; 2213 } 2214 2215 2216 2217 <form class="form-inline product-card-buy-button @buttonClass @simProdDisabledState "> 2218 <span> 2219 <button id="btnBuy" 2220 onclick="Cart.addToBasket(@ProductsPageId, '@productId', '@productNumberClean', this);" 2221 class="btn btn-default @buttonClass" type="button" style="float: right; margin-top: -35px;"> 2222 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"> 2223 <polygon class="st0" points="152.8 42.3 57.1 42.3 36.6 -40.7 18.7 -40.7 18.7 -54.7 47.6 -54.7 68 28.3 143 28.3 160.7 -20.7 64.6 -19.9 64.5 -33.9 180.7 -34.9 " /> 2224 <path class="st0" d="M77.1 80.6c-11.9 0-21.6-9.7-21.6-21.6 0-11.9 9.7-21.6 21.6-21.6 11.9 0 21.6 9.7 21.6 21.6C98.7 70.9 89 80.6 77.1 80.6zM77.1 51.5c-4.2 0-7.6 3.4-7.6 7.6 0 4.2 3.4 7.6 7.6 7.6 4.2 0 7.6-3.4 7.6-7.6C84.7 54.9 81.3 51.5 77.1 51.5z" /> 2225 <path class="st0" d="M137.4 80.6c-11.9 0-21.6-9.7-21.6-21.6 0-11.9 9.7-21.6 21.6-21.6S159 47.1 159 59C159 70.9 149.3 80.6 137.4 80.6zM137.4 51.5c-4.2 0-7.6 3.4-7.6 7.6 0 4.2 3.4 7.6 7.6 7.6s7.6-3.4 7.6-7.6C145 54.9 141.6 51.5 137.4 51.5z" /> 2226 <polygon class="st0" points="124.6 -22.6 97.6 -50.9 75.4 -24.5 64.6 -33.5 96.9 -71.9 134.7 -32.3 " /> 2227 <polygon class="st0" points="172.6 -23.6 133.4 -52.5 117 -36.8 107.3 -46.9 132.3 -70.7 180.9 -34.8 " /> 2228 <path d="M19 5.8L19 5.8l-5.4-4 -2 1.9 -1.9-2L6.1 5.9h0l0 1.5 10.7-0.1 -2 5.5H6.5L4.2 3.6H1v1.6h2l2.3 9.2H6c-0.5 0.4-0.9 1.1-0.9 1.9 0 1.3 1.1 2.4 2.4 2.4s2.4-1.1 2.4-2.4c0-0.8-0.3-1.4-0.9-1.9h3.7c-0.5 0.4-0.9 1.1-0.9 1.9 0 1.3 1.1 2.4 2.4 2.4s2.4-1.1 2.4-2.4c0-0.8-0.4-1.4-0.9-1.9h0.2L19 5.8zM8.2 5.9L9.8 4l1.8 1.8L8.2 5.9zM13.7 5.8l-1-1 1-1 2.7 2L13.7 5.8zM7.5 17c-0.5 0-0.8-0.4-0.8-0.8 0-0.5 0.4-0.8 0.8-0.8 0.5 0 0.8 0.4 0.8 0.8C8.3 16.7 7.9 17 7.5 17zM14.2 17c-0.5 0-0.8-0.4-0.8-0.8 0-0.5 0.4-0.8 0.8-0.8 0.5 0 0.8 0.4 0.8 0.8C15 16.7 14.6 17 14.2 17z" /> 2229 <polygon points="19 5.8 19 5.8 19 5.8 " /> 2230 </svg> 2231 @if (loggedIn) 2232 { 2233 @Translate("productBuyButtonText", "Köp"); 2234 } 2235 <i class="fa fa-refresh"></i> 2236 </span> 2237 </form> 2238 2239 2240 } 2241 2242 </div> 2243 2244 </div> 2245 2246 } 2247 2248 2249 </div> 2250 2251 } 2252 } 2253 2254 2255 2256 </div> 2257 </div> 2258 </div> 2259 </div> 2260 <!--End Similar products --> 2261 } 2262 </div> 2263 2264 </section> 2265 2266 2267 @if (imgFunctions) 2268 { 2269 <div class="modal fade y-modalCarousel" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> 2270 <div class="modal-dialog"> 2271 2272 <button class="close" type="button" data-dismiss="modal"> 2273 <i class="fa fa-close"></i> 2274 </button> 2275 2276 <div id="modalCarousel" class="carousel slide"> 2277 <div class="carousel-inner"> 2278 </div> 2279 2280 @if (imgControl) 2281 { 2282 <a class="left carousel-control" href="#modalCarousel" data-slide="prev"> 2283 <i class="fa fa-angle-left"></i> 2284 </a> 2285 <a class="right carousel-control" href="#modalCarousel" data-slide="next"> 2286 <i class="fa fa-angle-right"></i> 2287 </a> 2288 } 2289 <span class="cl-area" data-dismiss="modal"></span> 2290 </div> 2291 </div> 2292 </div> 2293 } 2294 2295 2296 2297 2298 2299 @functions { 2300 string GetPageContent(int pageId) 2301 { 2302 2303 try 2304 { 2305 string output = null; 2306 2307 var page = ServiceLocator.Current.GetPageService().GetPage(pageId); 2308 2309 if (!string.IsNullOrEmpty(page.ItemType) && !string.IsNullOrEmpty(page.ItemId)) 2310 { 2311 var item = Dynamicweb.Content.Items.Item.GetItemById(page.ItemType, page.ItemId); 2312 output = "<div>" + item["General_TextEditor"] + "</div>"; 2313 } 2314 else 2315 { 2316 var contentPageView = Dynamicweb.Frontend.PageView.GetPageviewByPageID(pageId); 2317 output = contentPageView.Output(); 2318 2319 // Remove everything but the actual page content 2320 var startTag = "<!--PageContentStart-->"; 2321 var endTag = "<!--PageContentEnd-->"; 2322 int startIndex = output.IndexOf(startTag) + startTag.Length; 2323 int endIndex = output.IndexOf(endTag, startIndex); 2324 output = output.Substring(startIndex, endIndex - startIndex); 2325 } 2326 2327 return output; 2328 } 2329 catch { } 2330 return null; 2331 } 2332 2333 } 2334 2335 <!-- Modals --> 2336 2337 @using Dynamicweb.Rendering.Translation 2338 @using System; 2339 2340 2341 @{ var LinkText = Translate("retail_search_webshop_button", "Webshop"); 2342 //var EAN = GetString("Ecom:Product:Field.produktEAN"); 2343 2344 } 2345 2346 2347 @*<input type="hidden" id="EAN" value="@EAN" />*@ 2348 2349 <div class="modal fade" id="findStore" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> 2350 <div class="modal-dialog" role="document"> 2351 <div class="modal-content"> 2352 <div class="modal-header"> 2353 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> 2354 <h1 class="modal-title" id="myModalLabel">@Translate("ProductlistBuy", "Buy")</h1> 2355 </div> 2356 <div class="modal-body col-sm-12"> 2357 <div class="col-lg-6 col-md-12 modal-search-form"> 2358 <form class="search-form"> 2359 <div class="row"> 2360 <button type="submit" class="button-primary"><i class="fa fa-search"></i></button> 2361 <input type="text" class="u-full-width search-field" autofocus placeholder="@Translate("reseller_post_number", "Enter postal number")" value=""> 2362 </div> 2363 <div class="row address"> 2364 <small class="formatted-address"></small> 2365 </div> 2366 </form> 2367 @*<ul class="search-filter"> 2368 @{ 2369 2370 var BrandlistListId = (int) Pageview.Area.Item["BrandList"]; 2371 var BrandlistItemList = Dynamicweb.Content.Items.ItemList.GetItemListById(BrandlistListId); 2372 var Brandlsloop = BrandlistItemList.Relations.Cast<Dynamicweb.Content.Items.Item>(); 2373 2374 foreach (var i in Brandlsloop) 2375 { 2376 2377 string brand = ""; 2378 try 2379 { 2380 string nameId = i["NameID"].ToString(); 2381 2382 2383 if (!String.IsNullOrEmpty(nameId)) 2384 { 2385 brand = nameId; 2386 2387 <li><label for="@brand"><input type="checkbox" id="@brand"><icon class="check"></icon>@brand</label></li> 2388 } 2389 2390 } 2391 catch (Exception ex) 2392 { 2393 Console.WriteLine(ex.ToString()); 2394 } 2395 2396 2397 } 2398 } 2399 </ul>*@ 2400 <div class="stores-list"></div> 2401 </div> 2402 <div class="col-lg-6 col-md-12 webshops"> 2403 <h2>@Translate("retail_search_webshop", "Online shops")</h2> 2404 2405 <div class="links"> 2406 <ul> 2407 @{ 2408 var ResellersListId = (int) Pageview.Area.Item["Resellers_List"]; 2409 var ResellersItemList = Dynamicweb.Content.Items.ItemList.GetItemListById(ResellersListId); 2410 var Resellersloop = ResellersItemList.Relations.Cast<Dynamicweb.Content.Items.Item>(); 2411 string curentBrand = GetString("Ecom:Product:Field.productTrademark"); 2412 2413 2414 foreach (var c in Resellersloop) 2415 { 2416 string linkText = c["LinkText"].ToString(); 2417 string landinpageLink = String.Empty; 2418 try 2419 { 2420 landinpageLink = c[curentBrand].ToString(); 2421 //landinpageLink = c["Chasseur"].ToString(); 2422 2423 2424 if (!String.IsNullOrEmpty(landinpageLink)) 2425 { 2426 2427 <li> 2428 @linkText 2429 <a href="@landinpageLink" target="_blank" title="@linkText" class="button">@Translate("retail_search_webshop_button", "Webshop")</a> 2430 </li> 2431 2432 } 2433 2434 2435 } 2436 catch (Exception ex) 2437 { 2438 2439 Console.WriteLine(ex.ToString()); 2440 } 2441 2442 } 2443 2444 } 2445 2446 2447 </ul> 2448 </div> 2449 </div> 2450 </div> 2451 </div> 2452 </div> 2453 </div> 2454 2455 2456 2457 @{ 2458 var hostUrl = GetGlobalValue("Global:Request.Host"); 2459 } 2460 2461 @SnippetStart("FacebookOGProductMeta") 2462 2463 <meta property='og:type' content='website' /> 2464 <meta property='og:title' content='@GetString("Ecom:Product.Name")' /> 2465 <meta property='og:image' content='@GetGlobalValue("Global:Request.Scheme")://@hostUrl/Admin/Public/GetImage.ashx?image=@curprodpath/@GetString("Ecom:Product.Number")_1.jpg&Compression=85&width=400&height=400&Crop=5&altFmImage_path=/Files/Images/NoImageAvailable.png' /> 2466 <meta property='og:description' content='@GetString("Ecom:Product:Field.DescriptionLong")'/> 2467 <meta property='og:url' content='@GetGlobalValue("Global:Request.Scheme")://@GetGlobalValue("Global:Request.Host")@GetGlobalValue("Global:Pageview.Url")' /> 2468 2469 @SnippetEnd("FacebookOGProductMeta")

Meny

Cookies på sidan

Denna webbplats använder cookies (kakor) för statistik, anpassat innehåll och annonser.

Du kan alltid ta bort sparade kakor genom de avancerade inställningarna i din webbläsare.

Visa detaljer
F