EIVA A/S

To use this site, please enable javascript

Error executing template "Designs/Eiva/eCom/Product/Details.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_7fdf3d45407a459ea9d2466bfbc900b8.Execute() in E:\Webroot\Eiva.com\Web\Files\Templates\Designs\Eiva\eCom\Product\Details.cshtml:line 47
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 @using Dynamicweb.Content 2 @using Eiva.CustomModules.Helpers 3 @using Dynamicweb.Content.Items 4 @using Dynamicweb.Ecommerce 5 @using Eiva.CustomModules.Helpers 6 @using Dynamicweb.Content; 7 @using Dynamicweb.Ecommerce.Products 8 9 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 10 11 @{ 12 string productPageId = Pageview.Area.Item["Productpage_Id"].ToString(); 13 var productPageUrl = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("Default.aspx?ID=" + productPageId); 14 15 } 16 17 @if (GetBoolean("Ecom:Product:Field.IsMyEivaProduct")) 18 { 19 var baseUrl = System.Web.HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority); 20 <script> 21 window.location.href = '@baseUrl' + '@productPageUrl'; 22 </script> 23 } 24 25 @{ 26 var prod = Dynamicweb.Ecommerce.Services.Products.GetProductById(GetString("Ecom:Product.ID"), "", true); 27 string allProductPageId = Pageview.Area.Item["AllProductsPage"].ToString(); 28 string rentalPageId = Pageview.Area.Item["RentalPage"].ToString(); 29 var alsoAvailableProduct = prod.RelatedGroups.Where(rg => rg.Name.ToLower() == "also available for").SelectMany(rp => rp.Products.Where(p => p.Active)).FirstOrDefault(); 30 var alsoAvailableLink = ""; 31 if (alsoAvailableProduct != null) 32 { 33 if (alsoAvailableProduct.ProductFieldValues.GetProductFieldValue("SaleOrRental").Value != null && alsoAvailableProduct.ProductFieldValues.GetProductFieldValue("SaleOrRental").Value.ToString() == "Rental") 34 { 35 alsoAvailableLink = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("default.aspx?id=" + rentalPageId + "&groupId=" + alsoAvailableProduct.PrimaryGroupId + "&productId=" + alsoAvailableProduct.Id); 36 } 37 else 38 { 39 alsoAvailableLink = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("default.aspx?id=" + productPageId + "&groupId=" + alsoAvailableProduct.PrimaryGroupId + "&productId=" + alsoAvailableProduct.Id); 40 } 41 } 42 43 Char delimiter = '='; 44 string productNumber = GetString("Ecom:Product.Number"); 45 string image = "/Files/Images/Products/" + productNumber + ".jpg"; 46 bool first = true; 47 string productProductCategory = Helpers.getCategory(prod).Name; 48 49 double stockCount = GetDouble("Ecom:Product.Stock"); 50 51 string amountDisabled = ""; 52 bool soldout = false; 53 if (stockCount == 0) 54 { 55 amountDisabled = "disabled"; 56 soldout = true; 57 } 58 59 string productName = GetValue("Ecom:Product.Name").ToString(); 60 61 int countExtraImages = 0; 62 for (int i = 1; i <= 5; i++) 63 { 64 string thumbnailImg = GetString("Ecom:Product:Field.AdditionalImage" + i + ".Clean"); 65 if (!string.IsNullOrWhiteSpace(thumbnailImg)) 66 { 67 countExtraImages++; 68 } 69 } 70 string sliderHiddenClass = countExtraImages > 0 ? "m-productImageSlider__list--isHidden" : "m-productImageSlider__list--show"; 71 72 73 var singleImageClass = countExtraImages == 0 ? "m-productImageSlider__list--single" : string.Empty; 74 } 75 @helper RenderMyEIVASection(string parameter = "", string url = "", bool fullWidth = false, bool floatRight = false) 76 { 77 var myEivaInfo = Dynamicweb.Frontend.PageView.Current().Area.Item["My_EIVAInfo"]; 78 var myEivaLink = Dynamicweb.Frontend.PageView.Current().Area.Item["My_EIVALink"]; 79 var myEivaLinkText = Dynamicweb.Frontend.PageView.Current().Area.Item["My_EIVALinkText"]; 80 var licenseInfoLink = Dynamicweb.Frontend.PageView.Current().Area.Item["LicenseInfoLink"]; 81 var licenseInfoLinkText = Dynamicweb.Frontend.PageView.Current().Area.Item["LicenseInfoLinkText"]; 82 var myEivaLinkParameter = string.IsNullOrEmpty(parameter) ? "" : "?" + parameter; 83 if (!string.IsNullOrEmpty(url)) 84 { 85 myEivaLink = url; 86 } 87 <div class="container-fluid o-checkout__my-eiva-info"> 88 <section class="o-text-element row @(floatRight ? "float-right" : "")"> 89 <div class="o-text-element__col col-xs-12 @(fullWidth ? "" : "col-sm-10 col-md-8")"> 90 <div class="m-text-element"> 91 <p> 92 @myEivaInfo 93 <a href="@myEivaLink@myEivaLinkParameter"> 94 @myEivaLinkText 95 </a> 96 </p> 97 </div> 98 </div> 99 </section> 100 </div> 101 @*<p>@myEivaInfo <a href="@myEivaLink@myEivaLinkParameter">@myEivaLinkText</a><a href="@licenseInfoLink">@licenseInfoLinkText</a></p>*@ 102 } 103 @* Product details *@ 104105 @helper RenderMyEivaLinkOverlay() 106 { 107 var myEivaInfo = Pageview.AreaSettings.GetString("My_EIVAInfo"); 108 var myEivaLink = Pageview.AreaSettings.GetString("My_EIVALink"); 109 var myEivaLinkText = Pageview.AreaSettings.GetString("My_EIVALinkText"); 110111 <!-- Popup for normal orders --> 112 <div class="novi-backdrop novi-backdrop--my-eiva-info" id="js-novi-backdrop--my-eiva-link-info"> 113 <div class="novi-overlay novi-overlay--my-eiva-info" id="js-novi-overlay--my-eiva-info"> 114 <div class="novi-overlay__container"> 115 <div class="novi-overlay__content"> 116 <div class="container-fluid"> 117 <section class="o-text-element row "> 118 <div class="o-text-element__col col-xs-12"> 119 <div class="m-text-element"> 120 <h3>@Translate("Already a NaviSuite User", "Already a NaviSuite user?")</h3> 121 <p> 122 @myEivaInfo 123 </p> 124 <div class="novi-overlay__buttons text-center"> 125 @* Dynamic data-attribute for this button values set in novicell.productPagePrices.setSoftwareHiddenValues() *@ 126 <a class="a-button a-button--l a-button--cta" href="#" id="add-to-my-eiva-link" onclick="novicell.cart.addToMyEiva(event, this);" data-href="@myEivaLink" data-product-id="@GetString("Ecom:Product.ID")"> 127 @myEivaLinkText 128 </a> 129 <button class="a-button a-button--l a-button--white" type="submit"> 130 @Translate("Proceed as new customer", "Proceed as new customer") 131 </button> 132 </div> 133 </div> 134 </div> 135 </section> 136 </div> 137138 </div> 139 </div> 140 </div> 141 </div> 142 } 143144 @helper RenderMyEivaInfoOverlay() 145 { 146 var myEivaCheckoutPageId = Pageview.AreaSettings.GetString("My_EIVACheckoutPage"); 147 var myEivaCheckoutLink = "Default.aspx?ID=" + myEivaCheckoutPageId; 148149 <!-- Popup for My EIVA orders --> 150 <div class="novi-backdrop novi-backdrop--my-eiva-info" id="js-novi-backdrop--my-eiva-order-info"> 151 <div class="novi-overlay novi-overlay--my-eiva-info" id="js-novi-overlay--my-eiva-info"> 152 <div class="novi-overlay__container"> 153 <div class="novi-overlay__content"> 154 <div class="container-fluid"> 155 <section class="o-text-element row "> 156 <div class="o-text-element__col col-xs-12"> 157 <div class="m-text-element"> 158 <h3>@Translate("My EIVA | Product page | Popup heading", "You already have products in your My EIVA basket")</h3> 159 <p> 160 @Translate("My EIVA | Product page | Popup body text", "This product cannot be added to your basket as you already have products in your My EIVA basket.") 161 </p> 162 <div class="novi-overlay__buttons text-center"> 163 <a class="a-button a-button--l a-button--cta" href="@myEivaCheckoutLink"> 164 @Translate("My EIVA | Product page | Popup left button text", "Proceed to My EIVA checkout") 165 </a> 166 <button class="a-button a-button--l a-button--white" onclick="novicell.helpers.closeOverlay(this, event)"> 167 @Translate("My EIVA | Product page | Popup right button text", "Continue browsing") 168 </button> 169 <input type="submit" class="hidden" name="js-submit-button" id="js-submit-button" /> 170 </div> 171 </div> 172 </div> 173 </section> 174 </div> 175 </div> 176 </div> 177 </div> 178 </div> 179 } 180181 <div class="container"> 182 <div class="o-productDetails"> 183 <div class="o-productDetails__slider"> 184 <span class="o-productDetails__temp" id="o-productDetails__temp"></span> 185 <div class="m-productImageSlider"> 186 <ul class="m-productImageSlider__list @sliderHiddenClass @singleImageClass"> 187 @sliderLargeItem(image, productName, null) 188 @for (int i = 1; i <= 5; i++) 189 { 190 string thumbnailImg = GetString("Ecom:Product:Field.AdditionalImage" + i + ".Clean"); 191 if (!string.IsNullOrWhiteSpace(thumbnailImg)) 192 { 193 string videoId = GetString("Ecom:Product:Field.AdditionalVideoID" + i); 194 if (!string.IsNullOrWhiteSpace(videoId)) 195 { 196 @sliderLargeItem(thumbnailImg, productName, videoId) 197 } 198 else 199 { 200 @sliderLargeItem(thumbnailImg, productName, null) 201 } 202 } 203 } 204 </ul> 205 @if (countExtraImages > 0) 206 { 207 <ul class="m-productImageSlider__listSmall m-productImageSlider__listSmall--isHidden"> 208209 @sliderSmallItem(image, productName, null) 210 @for (int i = 1; i <= 5; i++) 211 { 212 string thumbnailImg = GetString("Ecom:Product:Field.AdditionalImage" + i + ".Clean"); 213 if (!string.IsNullOrWhiteSpace(thumbnailImg)) 214 { 215 string videoId = GetString("Ecom:Product:Field.AdditionalVideoID" + i); 216 if (!string.IsNullOrWhiteSpace(videoId)) 217 { 218 @sliderSmallItem(thumbnailImg, productName, videoId) 219 } 220 else 221 { 222 @sliderSmallItem(thumbnailImg, productName, null) 223 } 224 } 225226 } 227 <li class="m-productImageSlider__itemSmall m-productImageSlider__itemSmall--invisible"></li> 228 <li class="m-productImageSlider__itemSmall m-productImageSlider__itemSmall--invisible"></li> 229 <li class="m-productImageSlider__itemSmall m-productImageSlider__itemSmall--invisible"></li> 230 <li class="m-productImageSlider__itemSmall m-productImageSlider__itemSmall--invisible"></li> 231 <li class="m-productImageSlider__itemSmall m-productImageSlider__itemSmall--invisible"></li> 232 </ul> 233 } 234235236 <div class="overlayContent" id="overlayContent--productImageSlider"> 237 <ul class="m-productImageSlider__listOverlay"> 238 @sliderOverlayItem(image, productName, null) 239 @for (int i = 1; i <= 5; i++) 240 { 241 string thumbnailImg = GetString("Ecom:Product:Field.AdditionalImage" + i + ".Clean"); 242 if (!string.IsNullOrWhiteSpace(thumbnailImg)) 243 { 244 string videoId = GetString("Ecom:Product:Field.AdditionalVideoID" + i); 245 if (!string.IsNullOrWhiteSpace(videoId)) 246 { 247 @sliderOverlayItem(thumbnailImg, productName, videoId) 248 } 249 else 250 { 251 @sliderOverlayItem(thumbnailImg, productName, null) 252 } 253 } 254255 } 256 </ul> 257 </div> 258259260 </div> 261262 </div> 263 <div class="o-productDetails__top"> 264 <h1 class="a-header">@productName</h1> 265 <dl class="m-productMainFacts"> 266 @*Supplier/Conducted by*@ 267 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:Manufacturer.Name"))) 268 { 269 <dt class="m-productMainFacts__elem m-productMainFacts__elem--term"> 270 @if (productProductCategory == "Class room training") 271 { 272 @Translate("Conducted by", "Conducted by:") 273 } 274 else 275 { 276 @Translate("Supplier", "Supplier:") 277 } 278 </dt> 279 <dd class="m-productMainFacts__elem m-productMainFacts__elem--data"> 280 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:Manufacturer.Web"))) 281 { 282 <a href="@GetString("Ecom:Manufacturer.Web")" target="_blank">@GetString("Ecom:Manufacturer.Name")</a> 283 } 284 else 285 { 286 @GetString("Ecom:Manufacturer.Name") 287 } 288 </dd> 289 } 290 @*Productnumber*@ 291 <dt class="m-productMainFacts__elem m-productMainFacts__elem--term"> 292 @Translate("Product nr.", "Product nr.") : 293 </dt> 294 <dd class="m-productMainFacts__elem m-productMainFacts__elem--data"> 295 @productNumber 296 </dd> 297 </dl> 298 <ul class="m-productTags"> 299 @*Segments*@ 300301 @foreach (var segment in GetLoop("Segments.Options")) 302 { 303 string segmentLink = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("default.aspx?id=" + allProductPageId); 304 if (segment.GetString("Segments.Option.IsSelected") == "true") 305 { 306 <li class="m-productTags__item"><a href="@(segmentLink)?TypeOfWork=@segment.GetString("Segments.Option.Value")">@segment.GetString("Segments.Option.Name")</a></li> 307 } 308 } 309 </ul> 310311312313 @*Date & Location*@ 314 @if (productProductCategory == "Class room training") 315 { 316 DateTime courseStart = GetDate("Ecom:Product.CategoryField.Class_room_training.Course_date_start.Value"); 317 DateTime courseEnd = GetDate("Ecom:Product.CategoryField.Class_room_training.Course_date_end.Value"); 318 <p class="o-productDetails__timeAndPlace"> 319 <span class="o-productDetails__date"> 320 @if (courseStart.Year == courseEnd.Year && courseStart.Month == courseEnd.Month) 321 { 322 @: @courseStart.ToString("%d")-@courseEnd.ToString("d MMM yyyy") 323 } 324 else 325 { 326 @courseStart.ToString("d MMM")<text> &ndash; </text>@courseEnd.ToString("d MMM yyyy") 327 } 328 </span> 329330 <span class="o-productDetails__place">@GetString("Ecom:Product.CategoryField.Class_room_training.Location.Value")</span> 331 </p> 332 } 333334335 </div> 336 <div class="o-productDetails__content"> 337 <section class="o-text-element"> 338 <div class="o-text-element__col o-text-element__col--embeddedOneCol"> 339 <div class="o-text-element__content o-text-element__content--left"> 340 <div class="m-rich-text-editor o-text-element__rte"> 341 @*Description*@ 342 @GetValue("Ecom:Product.LongDescription") 343 </div> 344 </div> 345 </div> 346 </section> 347348 </div> 349 </div> 350 </div> 351352353354 @*Render Price*@ 355 @if (productProductCategory == "Class room training") 356 { 357 if (stockCount < 1) 358 { 359 @RenderTrainingPriceSoldout(productProductCategory, alsoAvailableLink) 360 } 361 else if (GetInteger("Ecom:Product.Price.PricePIP") == 0) 362 { 363 @RenderTrainingPriceNoPrice(productProductCategory, alsoAvailableLink) 364 } 365 else 366 { 367 @RenderTrainingPrice(productProductCategory, alsoAvailableLink, stockCount) 368 } 369 if (!string.IsNullOrWhiteSpace(GetString("Additional_description"))) 370 { 371 <div class="container"> 372 <section class="o-text-element"> 373 <div class="o-text-element__col o-text-element__col--oneColFullWidth col-xs-12 col-sm-10 col-md-8"> 374 <div class="o-text-element__content o-text-element__content--left"> 375 <div class="m-rich-text-editor o-text-element__rte"> 376 @GetValue("Additional_description") 377 </div> 378 </div> 379 </div> 380 </section> 381 </div> 382 } 383 } 384 else if (productProductCategory == "Software" && GetString("Rack_software") != "True") 385 { 386387 if (GetBoolean("Ecom:Product:Field.RequestPrice")) 388 { 389 @RenderPriceRequest(productProductCategory, productName, alsoAvailableLink) 390 } 391 else 392 { 393 @RenderSoftwarePrice(productProductCategory, prod, alsoAvailableLink) 394 } 395 } 396 else if (productProductCategory == "Hardware" || productProductCategory == "E-learning" || (productProductCategory == "Software" && GetString("Rack_software") == "True")) 397 { 398 if (GetBoolean("Ecom:Product:Field.RequestPrice")) 399 { 400 @RenderPriceRequest(productProductCategory, productName, alsoAvailableLink) 401 } 402 else 403 { 404 @RenderHardwarePrice(soldout, stockCount, productProductCategory, alsoAvailableLink) 405 } 406 } 407408409410 @* Features *@ 411 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.FeaturesHeader"))) 412 { 413 <div class="container helperProductPageExtraItems"> 414 <div class="o-highlightedFeatures"> 415 <div class="base-accordion base-accordion--mobileOnly"> 416 <h2 class="a-heading a-heading--productPage base-accordion__header ">@GetString("Ecom:Product:Field.FeaturesHeader")</h2> 417 <div class="base-accordion__content js-accordion"> 418 <ul class="row o-highlightedFeatures__list"> 419 @{ 420 for (int i = 1; i <= 20; i++) 421 { 422 string featureLink = GetString("Ecom:Product:Field.Feature" + i); 423 if (!string.IsNullOrWhiteSpace(featureLink)) 424 { 425 String[] featureId = featureLink.Split(delimiter); 426 @RenderFeature(featureId[1]) 427 } 428 } 429 } 430 </ul> 431 </div> 432 </div> 433 </div> 434 </div> 435 } 436 @* Specifications *@ 437 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.SpecificationsHeader"))) 438 { 439440 string specificationsLink = GetString("Ecom:Product:Field.Specifications"); 441 if (!string.IsNullOrWhiteSpace(specificationsLink)) 442 { 443 String[] specsId = specificationsLink.Split(delimiter); 444 @RenderSpecifications(specsId[1]) 445 } 446447 } 448 @* Product comparison *@ 449 @{string productComparisonLink = GetString("Ecom:Product:Field.ProductComparison"); 450 if (!string.IsNullOrWhiteSpace(productComparisonLink)) 451 { 452 <div class="o-featureComparison helperProductPageExtraItems"> 453 <div class="container"> 454 <div class="base-accordion base-accordion--mobileOnly"> 455 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.ProductComparisonHeader"))) 456 { 457 <h2 class="a-heading a-heading--productPage base-accordion__header ">@GetString("Ecom:Product:Field.ProductComparisonHeader")</h2> 458 } 459 <div class="base-accordion__content js-accordion"> 460 <section class="o-text-element"> 461 <div class="o-text-element__col o-text-element__col--embeddedOneCol"> 462 <div class="o-text-element__content o-text-element__content--left"> 463 @{ 464 String[] pcId = productComparisonLink.Split(delimiter); 465 @RenderProductComparison(pcId[1]) 466 } 467 </div> 468 </div> 469 </section> 470 </div> 471 </div> 472 </div> 473 </div> 474 } 475 } 476477 @* Related products *@ 478 @{ 479 var relatedProductList = prod.RelatedGroups.Where(rg => rg.Name.ToLower() == "related products").SelectMany(rp => rp.Products.Where(p => p.Active)); 480 if (relatedProductList.Any()) 481 { 482 <div class="container o-relatedProducts__outer"> 483 <div class="o-relatedProducts"> 484 <h2 class="a-heading a-heading--productPage ">@Translate("Related products", "Related products")</h2> 485 <ul class="row o-relatedProducts__list"> 486487 @*@foreach (var product in productList.Select(p => p.Product).Where(p => p.Active))*@ 488 @foreach (var product in relatedProductList) 489 { 490 string prodId = product.Id; 491492 string prodName = product.Name; 493 string prodNumber = product.Number; 494 string prodImage = "/Files/Images/Products/" + prodNumber + ".jpg".Replace(" ", "%20"); 495496 string prodDesc = product.ShortDescription; 497 string prodLink = ""; 498499 if (product.ProductFieldValues.GetProductFieldValue("SaleOrRental").Value != null && product.ProductFieldValues.GetProductFieldValue("SaleOrRental").Value.ToString() == "Rental") 500 { 501 prodLink = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("default.aspx?id=" + rentalPageId + "&groupId=" + product.PrimaryGroupId + "&productId=" + prodId); 502 } 503 else 504 { 505 prodLink = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("default.aspx?id=" + productPageId + "&groupId=" + product.PrimaryGroupId + "&productId=" + prodId); 506 } 507508 <li class="col-xs-12 col-sm-6 col-md-3 o-relatedProducts__item"> 509 <a href="@prodLink" title="" property="url" class="m-product-card m-product-card--3prices"> 510 <div class="m-product-card__image-holder"> 511512 <img class="lazyload lazyload-measure lazyload-bg a-image m-cardImageText__image" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="@prodName" property="contentUrl" data-src="@prodImage" 513 data-query-obj='{ "mode":"crop" , "quality":"80", "upscale":false }'> 514 <noscript> 515 <img src="@prodImage?mode=crop&width=400" 516 alt="@prodName"> 517 </noscript> 518 </div> 519 <div class="m-product-card__content"> 520 <h4 class="m-product-card__header">@prodName</h4> 521 <p class="m-product-card__subheader">@prodDesc</p> 522 </div> 523524 <div class="m-product-card__btnPriceHolder"> 525 <div class="m-product-card__btn-holder"> 526 <span class="a-button a-button--s a-button--green m-product-card__btn"> 527 @Translate("More info", "More info") 528 </span> 529 </div> 530 <div class="m-product-card__priceHolder"> 531 @Helpers.GetListPrice(product) 532 </div> 533 </div> 534 </a> 535536 </li> 537 } 538 </ul> 539 </div> 540 </div> 541 } 542 } 543544 @* News *@ 545 @{ 546 IEnumerable<string> list = new string[] { "NewsPage" }; 547 var pageList = Dynamicweb.Extensibility.ServiceLocator.Current.GetPageService().GetPagesForItems(list); 548549550 List<Dynamicweb.Content.Page> relatedNewsList = new List<Dynamicweb.Content.Page>(); 551552 foreach (var segment in GetLoop("Segments.Options")) 553 { 554555 if (segment.GetString("Segments.Option.IsSelected") == "true" && pageList.Any()) 556 { 557 var SOName = segment.GetString("Segments.Option.Name"); 558 var newsList = pageList.Where( 559 p => p.Item.FirstOrDefault( 560 v => v.Key == "Categories" 561 ).Value != null && 562 p.Item.FirstOrDefault( 563 v => v.Key == "Categories" 564 ).Value.ToString().Split(',').ToList().Any(st => Translate(st) == SOName) 565 && p.Item.FirstOrDefault(d => d.Key == "Date").Value != null 566 ); 567 relatedNewsList.AddRange(newsList); 568 } 569 } 570 relatedNewsList = relatedNewsList.Distinct().Where(x => x.Published).OrderByDescending(p => DateTime.Parse(p.Item.FirstOrDefault(iv => iv.Key == "Date").Value.ToString())).Take(3).ToList(); 571572 if (relatedNewsList.Any()) 573 { 574 <div class="container o-news-list"> 575 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.RelatedNewsHeader"))) 576 { 577 <h2 class="a-heading a-heading--productPage">@GetString("Ecom:Product:Field.RelatedNewsHeader")</h2> 578 } 579 <div class="o-news-list__listHolder"> 580 @foreach (var ni in relatedNewsList) 581 { 582 var page = Dynamicweb.Services.Pages.GetPage(ni.ID); 583 string relatedLink = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("default.aspx?id=" + ni.ID); 584 string teasertext = ""; 585586 if (!string.IsNullOrWhiteSpace(ni.Item["Teaser"].ToString())) 587 { 588 teasertext = ni.Item["Teaser"].ToString(); 589 } 590 else 591 { 592 teasertext = page.Description; 593 } 594 string date = ni.Item["Date"].ToString(); 595 DateTime dt = DateTime.ParseExact(date, "dd/MM/yyyy HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture); 596597598 string imageAltText = Dynamicweb.Content.Items.Item.GetItemById("Image", ni.Item["Image"].ToString())["AltText"].ToString(); 599 string imageLink = Dynamicweb.Content.Items.Item.GetItemById("Image", ni.Item["Image"].ToString())["Image"].ToString(); 600601 <div class="o-news-list__item"> 602 <div class="m-cardImageText "> 603 <a href="@relatedLink" class="m-cardImageText__link"> 604 <figure class="m-cardImageText__figure"> 605 <img class="lazyload lazyload-measure a-image m-cardImageText__image" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" 606 alt="@imageAltText" 607 property="contentUrl" 608 data-src="@imageLink?mode=crop" 609 data-query-obj='{ }'> 610 <noscript> 611 <img src="@imageLink?mode=crop&width=" 612 alt="@imageAltText"> 613 </noscript> 614 </figure> 615 <h3 class="m-cardImageText__header">@ni.Item["Header"]</h3> 616 <div class="m-cardImageText__body"> 617 <p class="m-cardImageText__facts"> 618 <span class="m-cardImageText__date">@dt.ToString("d MMMM yyyy")</span> 619 </p> 620 <p class="m-cardImageText__teaser">@teasertext</p> 621 </div> 622 <span class="m-cardImageText__linkFake"> 623 <span class="m-cardImageText__linkArrow"> 624 &rsaquo; 625 </span> @Translate("Read more", "Read more") 626 </span> 627 </a> 628 </div> 629 </div> 630631 } 632 </div> 633 </div> 634 } 635636637638 } 639640 @* HELPERS *@ 641642 @helper RenderHardwarePrice(bool soldout, double stockCount, string productProductCategory, string alsoAvailableLink) 643 { 644 string inputDisabled = ""; 645 string priceDisabledClass = ""; 646 string buttonDisabledClass = ""; 647648 if (soldout) 649 { 650 //inputDisabled = "disabled"; 651 //priceDisabledClass = "m-price--disabled"; 652 //buttonDisabledClass = "a-button--disabled"; 653 } 654655 <form method="post" role="form"> 656 @RenderMyEivaInfoOverlay() 657 <div class="container"> 658 <div class="o-priceBar o-priceBar--hardware"> 659 @if (!(productProductCategory == "E-learning" && GetDouble("Ecom:Product.Price.Price") == 0)) 660 { 661 <div class="o-priceBar__item o-priceBar__item--amount "> 662 <div class="m-amountInputArrows m-amountInputArrows--withLabel"> 663 <div class="m-amountInputArrows__inputHolder"> 664 <input data-stock="@stockCount" @inputDisabled max="9999" value="1" class="a-input m-amountInputArrows--withLabel m-amountInputArrows__input" type="number" name="quantity" id="amountHardware" placeholder="" /> 665 <label for="amountHardware" class="m-amountInputArrows__label">@(GetString("Ecom:Product:Field.ProductUnit").Replace("license", "licence"))</label> 666 <button type="button" class="m-amountInputArrows__button m-amountInputArrows__button--prodDetailStdJs m-amountInputArrows__button--up"></button> 667 <button type="button" class="m-amountInputArrows__button m-amountInputArrows__button--prodDetailStdJs m-amountInputArrows__button--down"></button> 668 </div> 669 </div> 670 </div> 671 } 672673 <div class="o-priceBar__item o-priceBar__item--link"> 674 <div class="o-priceBar__link"> 675 @if (!string.IsNullOrEmpty(alsoAvailableLink) && !string.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.AlsoAvailableText"))) 676 { 677 <a href="@alsoAvailableLink"> 678 @GetString("Ecom:Product:Field.AlsoAvailableText") 679 </a> 680 } 681 </div> 682 </div> 683684 <div class="o-priceBar__item o-priceBar__item--price"> 685 @if (GetBoolean("Ecom:Product.CategoryField.Hardware.Price_Tooltip.Value")) 686 { 687 <div class="m-tooltip"> 688 <input type="checkbox" class="m-tooltip__checkbox" id="m-tooltip-1"> 689 <label for="m-tooltip-1"> 690 <svg class="a-svgIcon m-tooltip__svg"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/frontend/dist/icons/icons.svg#info"></use></svg> 691 </label> 692 <div class="m-tooltip__text"> 693 <p>@Translate("Nordic Region", "Only for sale in the Nordic Region")</p> 694 </div> 695 </div> 696 } 697 @if (!(productProductCategory == "E-learning" && GetDouble("Ecom:Product.Price.Price") == 0)) 698 { 699 <div class="m-price"> 700 <span class="m-price__price @priceDisabledClass"><span class="m-price__unit">@GetValue("Ecom:Product.Price.Currency.Symbol")</span><span id="hardwarePrice" data-price-var="@GetValue("Ecom:Product.Price.PricePIP")">@GetValue("Ecom:Product.Price.Price")</span></span> 701 <span class="m-price__vat">@Translate("ExclVAT" + productProductCategory, "excl VAT, excl shipping fee")</span> 702 </div> 703 } 704 </div> 705 <div class="o-priceBar__item o-priceBar__item--buttons"> 706 <span class="hidden stock-limit js-stock-limit">@Translate("Stock limit", "Stock limit")</span> 707 <input id="oPriceBarHardwareID" type="hidden" name="ID" value="@GetValue("Ecom:Product:Page.ID")" /> 708 <input id="oPriceBarHardwareProductID" type="hidden" name="ProductID" value="@GetValue("Ecom:Product.ID")" /> 709 <input id="oPriceBarHardwareCartCmd" type="hidden" name="CartCmd" value="add" /> 710 <button type="submit" onclick="novicell.cart.addToCart(event, 'hardware');" @inputDisabled class="a-button a-button--l a-button--green o-priceBar__button @buttonDisabledClass"> 711 @Translate("Add to basket", "Add to basket") 712 </button> 713 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.MoreInfoText"))) 714 { 715 var moreInfoLink = GetString("Ecom:Product:Field.MoreInfoLink.Value.Clean"); 716 if (moreInfoLink.IndexOf("/Files") > -1 && moreInfoLink.IndexOf(".") < 0) 717 { 718 moreInfoLink = moreInfoLink.Substring("/Files".Length); 719 } 720 <a href="@moreInfoLink" @(GetBoolean("Ecom:Product:Field.moreInfoNoNewTab") ? "" : "target=\"blank\"") title="@GetString("Ecom:Product:Field.MoreInfoText")" property="url" class="a-button a-button--l a-button--white o-priceBar__button "> 721 @GetString("Ecom:Product:Field.MoreInfoText") 722 </a> 723 } 724 </div> 725 @{ 726 string stockColor = "green"; 727 if (stockCount < 1) 728 { 729 stockColor = "red"; 730 } 731 } 732 <div class="o-priceBar__item o-priceBar__item--inStock o-priceBar__item--outside"> 733 <div class="m-inStock m-inStock--@stockColor"> 734 @if (productProductCategory != "E-learning") 735 { 736 <span class="m-inStock__inStock"> 737 @if (stockCount < 1) 738 { 739 //@Translate("Out of stock", "Out of stock") 740 } 741 else 742 { 743 @: @Translate("In stock", "In stock") &#8210; 744 } 745 </span> 746 } 747 <span class="m-inStock__additionalText"> 748 @*Deliverytime*@ 749 @if (productProductCategory == "E-learning") 750 { 751 <div class="m-inStock__subscription"> 752 @Translate("Deliverytime:", "Deliverytime: ") 753 @Translate("DeliverytimeElearningInStock", "1-4 working days") 754 <div class="m-tooltip m-tooltip--productPageDeliveryTime"> 755 <input type="checkbox" class="m-tooltip__checkbox" id="m-tooltip-1"> 756 <label for="m-tooltip-1"> 757 <svg class="a-svgIcon m-tooltip__svg"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/frontend/dist/icons/icons.svg#info"></use></svg> 758 </label> 759 <div class="m-tooltip__text"> 760 <p>@Pageview.Area.Item["Delivery_Tooltip_eLearning"].ToString()</p> 761 </div> 762 </div> 763 </div> 764 } 765 else if (stockCount < 1) 766 { 767 @Translate("Deliverytime:", "Deliverytime: ") 768 @Translate("DeliverytimeHardwareOutOfStock", "4-10 weeks") 769 } 770 else 771 { 772 @Translate("Deliverytime:", "Deliverytime: ") 773 @Translate("DeliverytimeHardwareInStock", "2-6 working days") 774 } 775 </span> 776 </div> 777 </div> 778779 </div> 780 </div> 781 </form> 782 } 783784785 @helper RenderSoftwarePrice(string productProductCategory, Product product, string alsoAvailableLink) 786 { 787 string licensetypes = Pageview.Area.Item["LicenseTypes"].ToString(); 788 var licensetypesLinkItem = Dynamicweb.Extensibility.ServiceLocator.Current.GetItemService().GetItem("Link", licensetypes); 789 string licensetypesLinkValue = licensetypesLinkItem["Link"].ToString(); 790 string licensetypesLinkTextValue = licensetypesLinkItem["Title"].ToString(); 791 var variants = GetLoop("VariantCombinations").Where(n => n.GetString("Ecom:VariantCombination.VariantText") != "Permanent license"); 792 var variantPermanent = GetLoop("VariantCombinations").Where(n => n.GetString("Ecom:VariantCombination.VariantText") == "Permanent license"); 793 string variantPermanentId = ""; 794 int defaultMinimumAmount = 5; 795796 double permanentPrice = 0; 797798 if (variantPermanent.Any()) 799 { 800 if (product.Prices.Any(p => p.VariantId == variantPermanent.First().GetString("Ecom:VariantCombination.VariantID"))) 801 { 802 permanentPrice = product.Prices.First(p => p.VariantId == variantPermanent.First().GetString("Ecom:VariantCombination.VariantID")).Amount; 803 variantPermanentId = variantPermanent.First().GetString("Ecom:VariantCombination.VariantID"); 804 } 805 } 806807 <form method="post" role="form"> 808 @RenderMyEivaInfoOverlay() 809 @RenderMyEivaLinkOverlay() 810 <input type="hidden" name="quantity" id="quantity" value="@defaultMinimumAmount" /> 811 @if (variants.Any()) 812 { 813 <input type="hidden" name="VariantID" id="VariantID" value="@variants.FirstOrDefault().GetString("Ecom:VariantCombination.VariantID")" /> 814 } 815 else if (variantPermanent.Any()) 816 { 817 <input type="hidden" name="VariantID" id="VariantID" value="@variantPermanent.FirstOrDefault().GetString("Ecom:VariantCombination.VariantID")" /> 818 } 819 <div class="container"> 820 <div class="o-priceBar o-priceBar--software"> 821 <div class="o-priceBar__item o-priceBar__item--amount "> 822823 <div class="o-priceBar__item o-priceBar__item--licenseOrSubscription"> 824 <a href="@licensetypesLinkValue" class="o-priceBar__link o-priceBar__link--licenseSubscriptionLink"> 825 <span class="o-priceBar__fakeLink">@licensetypesLinkTextValue</span> 826 </a> 827828829 <div class="m-amountInputArrows m-amountInputArrows--withLabel"> 830 <div class="m-amountInputArrows__inputHolder"> 831832 <input max="9999" value="1" class="a-input m-amountInputArrows__input" type="number" name="EcomOrderLineFieldInput_Licenses" id="EcomOrderLineFieldInput_Licenses" placeholder="" /> 833 <label for="EcomOrderLineFieldInput_Licenses" class="m-amountInputArrows__label">@Translate("license", "licence")</label> 834 <button type="button" class="m-amountInputArrows__button m-amountInputArrows__button--prodDetailJs m-amountInputArrows__button--up"></button> 835 <button type="button" class="m-amountInputArrows__button m-amountInputArrows__button--prodDetailJs m-amountInputArrows__button--down"></button> 836 </div> 837 </div> 838839 <div class="m-radioCustom"> 840 @if (variants.Any()) 841 { 842 <input class="m-radioCustom__input" type="radio" id="subscriptionOrPermanent--subscription" name="subscriptionOrPermanent" checked> 843 <label class="m-radioCustom__label" for="subscriptionOrPermanent--subscription">Subscription</label> 844 } 845 @if (variantPermanent.Any()) 846 { 847848 string permanentChecked = ""; 849 if (!variants.Any()) 850 { 851 permanentChecked = "checked"; 852 } 853854 <input class="m-radioCustom__input" type="radio" id="subscriptionOrPermanent--permanent" value="@variantPermanentId" name="subscriptionOrPermanent" data-price="@permanentPrice" @permanentChecked> 855 <label class="m-radioCustom__label" for="subscriptionOrPermanent--permanent">Permanent</label> 856 } 857 </div> 858 </div> 859 </div> 860 <div class="o-priceBar__item o-priceBar__item--link o-priceBar__item--outside"> 861 @if (!string.IsNullOrEmpty(alsoAvailableLink) && !string.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.AlsoAvailableText"))) 862 { 863 <div class="o-priceBar__link"> 864 <a href="@alsoAvailableLink"> 865 @GetString("Ecom:Product:Field.AlsoAvailableText") 866 </a> 867 </div> 868 } 869 </div> 870 <div id="o-priceBar__item--price-software" class="o-priceBar__item o-priceBar__item--price"> 871 <div class="m-price"> 872873 <span class="m-price__price"><span class="m-price__unit">@GetValue("Ecom:Product.Price.Currency.Symbol")</span><span id="softwarePrice" data-price-var="@GetValue("Ecom:Product.Price.PricePIP")"></span></span> 874 <span class="m-price__vat">@Translate("ExclVAT" + productProductCategory, "excl VAT, excl shipping fee")</span> 875 </div> 876 </div> 877 @{ 878 var extraButtonItemClass = !string.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.MoreInfoText")) ? "o-priceBar__item--2buttons" : ""; 879 } 880 <div class="o-priceBar__item o-priceBar__item--buttons @extraButtonItemClass"> 881882 <input type="hidden" name="ID" value="@GetValue("Ecom:Product:Page.ID")" /> 883 <input type="hidden" id="softwareProductId" name="ProductID" value="@GetValue("Ecom:Product.ID")" /> 884 <input type="hidden" name="CartCmd" value="add" /> 885 <button onclick="novicell.cart.addToCart(event, 'software');" type="submit" class="a-button a-button--l a-button--green o-priceBar__button">@Translate("Add to basket", "Add to basket")</button> 886887 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.MoreInfoText"))) 888 { 889 var moreInfoLink = GetString("Ecom:Product:Field.MoreInfoLink.Value.Clean"); 890 if (moreInfoLink.IndexOf("/Files") > -1 && moreInfoLink.IndexOf(".") < 0) 891 { 892 moreInfoLink = moreInfoLink.Substring("/Files".Length); 893 } 894 <a href="@moreInfoLink" @(GetBoolean("Ecom:Product:Field.moreInfoNoNewTab") ? "" : "target=\"blank\"") title="@GetString("Ecom:Product:Field.MoreInfoText")" property="url" class="a-button a-button--l a-button--white o-priceBar__button "> 895 @GetString("Ecom:Product:Field.MoreInfoText") 896 </a> 897 } 898899 </div> 900901 @if (variants.Any()) 902 { 903 <div class="o-priceBar__item o-priceBar__item--extraStuff"> 904 <div class="m-amountInputArrows m-amountInputArrows--withLabel"> 905 <div class="m-amountInputArrows__inputHolder"> 906 <input max="9999" data-min="@defaultMinimumAmount" value="1" class="a-input m-amountInputArrows__input" type="number" name="EcomOrderLineFieldInput_SubscriptionQuantity" id="selectId2" placeholder="" /> 907 <div class="m-amountInputArrows__label"></div> 908 <button type="button" class="m-amountInputArrows__button m-amountInputArrows__button--prodDetailJs m-amountInputArrows__button--up"></button> 909 <button type="button" class="m-amountInputArrows__button m-amountInputArrows__button--prodDetailJs m-amountInputArrows__button--down"></button> 910 </div> 911 </div> 912913 <div class="o-priceBar__item o-priceBar__item--licenseOrSubscription"> 914 <div class="m-radioCustom"> 915 @{ 916 int variantCount = 1; 917 foreach (LoopItem i in variants.OrderByDescending(n => n.GetString("Ecom:VariantCombination.VariantText"))) 918 { 919 if (product.Prices.Any(p => p.VariantId == i.GetString("Ecom:VariantCombination.VariantID"))) 920 { 921 string variantChecked = ""; 922 if (variantCount == 1) 923 { 924 variantChecked = "checked=\"checked\""; 925 } 926 double variantPrice = 0; 927 string fieldExtraClass = "daysOrWeeks__" + i.GetString("Ecom:VariantCombination.VariantText"); 928929 variantPrice = product.Prices.First(p => p.VariantId == i.GetString("Ecom:VariantCombination.VariantID")).Amount; 930 <input class="m-radioCustom__input @fieldExtraClass" data-price="@variantPrice" type="radio" id="@(i.GetString("Ecom:VariantCombination.VariantID"))" name="daysOrWeeks" @variantChecked> 931 <label class="m-radioCustom__label" for="@(i.GetString("Ecom:VariantCombination.VariantID"))">@(i.GetString("Ecom:VariantCombination.VariantText") + "s")</label> 932 variantCount++; 933 } 934 } 935 } 936 </div> 937 </div> 938 </div> 939 } 940941 <div class="o-priceBar__item o-priceBar__item--inStock o-priceBar__item--outside"> 942 <div class="m-inStock"> 943 <span class="m-inStock__additionalText"> 944 @*Deliverytime*@ 945 @if (GetString("Rack_software") == "True") 946 { 947 @Translate("Deliverytime:", "Deliverytime: ") 948 @Translate("DeliverytimeRack", "4-10 weeks")<br /> 949 } 950 else 951 { 952 if (variants.Any()) 953 { 954 <div class="m-inStock__subscription"> 955 @{ 956 var variantName = GetString("Ecom:Product.ProductVariantText"); 957 } 958959 @Translate("Deliverytime:", "Delivery time: ")<span>&nbsp;</span> 960 <span id="subscription-delivery-time" class="@(variantName == "Permanent license" ? "hidden" : "")"> 961 @Translate("DeliverytimeSubscription", "A few hours") 962 </span> 963964 <span id="permanent-delivery-time" class="@(variantName == "Permanent license" ? "" : "hidden")"> 965 @Translate("DeliverytimePermanentLicense", "2-6 working days") 966 </span> 967968 <div class="m-tooltip m-tooltip--productPageDeliveryTime"> 969 <input type="checkbox" class="m-tooltip__checkbox" id="m-tooltip-1"> 970 <label for="m-tooltip-1"> 971 <svg class="a-svgIcon m-tooltip__svg"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/frontend/dist/icons/icons.svg#info"></use></svg> 972 </label> 973 <div class="m-tooltip__text"> 974 <p>@Translate("InStockTooltipInfoText:", "Tooltip for in stock text")</p> 975 </div> 976 </div> 977 </div> 978 } 979 @*if (variantPermanent.Any()) 980 { 981 @Translate("Deliverytime permanent license:", "Deliverytime permanent license: ") 982 @Translate("DeliverytimePermanentLicense", "2-6 working days") 983 }*@ 984 } 985 </span> 986 </div> 987 </div> 988 </div> 989 </div> 990 </form> 991 } 992993 @helper RenderPriceRequest(string productCategory, string productName, string alsoAvailableLink) 994 { 995 <!--RenderPriceRequest--> 996 Dynamicweb.Ecommerce.Products.Group parentgrp = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(GetString("Ecom:Product.PrimaryOrFirstGroupID")); 997 if (!parentgrp.IsTopGroup) 998 { 999 do 1000 { 10011002 parentgrp = parentgrp.ParentGroups.FirstOrDefault(); 10031004 } while (parentgrp != null && !parentgrp.IsTopGroup); 1005 } 10061007 string requestPriceFormPageId = Pageview.Area.Item["RequestPriceFormPageId"].ToString(); 1008 string requestLink = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("default.aspx?id=" + requestPriceFormPageId); 10091010 //Rental 1011 string requestRentalPriceFormPageId = Pageview.Area.Item["RequestRentalPriceFormPageId"].ToString(); 1012 string requestRentalLink = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("default.aspx?id=" + requestRentalPriceFormPageId); 10131014 <div class="container"> 1015 <div class="o-priceBar o-priceBar--softwareRequestPrice"> 1016 <div class="o-priceBar__item o-priceBar__item--link"> 1017 @if (!string.IsNullOrEmpty(alsoAvailableLink) && !string.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.AlsoAvailableText"))) 1018 { 1019 <div class="o-priceBar__link"> 1020 <a href="@alsoAvailableLink"> 1021 @GetString("Ecom:Product:Field.AlsoAvailableText") 1022 </a> 1023 </div> 1024 } 1025 </div> 1026 <div class="o-priceBar__item o-priceBar__item--buttons"> 1027 @if (!(productCategory == "E-learning" && GetDouble("Ecom:Product.Price.Price") == 0)) 1028 { 1029 if (GetString("Ecom:Product:Field.SaleOrRental") == "Rental") 1030 { 1031 <a href="@requestRentalLink?NoviRequestQuote_Product=@productName&NoviRequestQuote_Supplier=@GetString("Ecom:Manufacturer.Name")" title="Request price" property="url" class="a-button a-button--l a-button--green o-priceBar__button "> 1032 @Translate("Request rental price", "Request rental price") 1033 </a> 1034 } 1035 else 1036 { 1037 <a href="@requestLink?NoviRequestQuote_Product=@productName&NoviRequestQuote_Supplier=@GetString("Ecom:Manufacturer.Name")" title="Request price" property="url" class="a-button a-button--l a-button--green o-priceBar__button "> 1038 @Translate("Request price", "Request price") 1039 </a> 1040 } 1041 } 104210431044 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.MoreInfoText"))) 1045 { 1046 var moreInfoLink = GetString("Ecom:Product:Field.MoreInfoLink.Value.Clean"); 1047 if (moreInfoLink.IndexOf("/Files") > -1 && moreInfoLink.IndexOf(".") < 0) 1048 { 1049 moreInfoLink = moreInfoLink.Substring("/Files".Length); 1050 } 1051 <a href="@moreInfoLink" @(GetBoolean("Ecom:Product:Field.moreInfoNoNewTab") ? "" : "target=\"blank\"") title="@GetString("Ecom:Product:Field.MoreInfoText")" property="url" class="a-button a-button--l a-button--white o-priceBar__button "> 1052 @GetString("Ecom:Product:Field.MoreInfoText") 1053 </a> 1054 } 10551056 </div> 10571058 </div> 1059 </div> 1060 } 10611062 @helper RenderTrainingPriceNoPrice(string productProductCategory, string alsoAvailableLink) 1063 { 1064 <div class="container"> 1065 <div class="o-priceBar o-priceBar--training"> 1066 <div class="o-priceBar__item"> 1067 <div class="m-seatsAvailable m-seatsAvailable--soldOut"> 1068 <svg class="a-svgIcon m-seatsAvailable__iconHolder"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/frontend/dist/icons/icons.svg#info"></use></svg> 1069 <span class="m-seatsAvailable__text"> 1070 @Translate("For further information, please contact ", "For further information, please contact ") <a href="mailto:@GetString("Further_contact_Email")">@GetString("Further_contact_Email")</a> 1071 </span> 1072 </div> 1073 </div> 1074 @if (!string.IsNullOrEmpty(alsoAvailableLink) && !string.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.AlsoAvailableText"))) 1075 { 1076 <div class="o-priceBar__item o-priceBar__item--link2 o-priceBar__item--outside"> 1077 <div class="o-priceBar__link"> 1078 <a href="@alsoAvailableLink"> 1079 @GetString("Ecom:Product:Field.AlsoAvailableText") 1080 </a> 1081 </div> 1082 </div> 1083 } 1084 </div> 1085 </div> 1086 } 10871088 @helper RenderTrainingPrice(string productProductCategory, string alsoAvailableLink, double stockCount) 1089 { 1090 <form method="post" role="form"> 10911092 <input type="hidden" name="ID" value="@GetValue("Ecom:Product:Page.ID")" /> 10931094 <input type="hidden" id="ProductID" name="ProductID" value="@GetValue("Ecom:Product.ID")" /> 10951096 <input type="hidden" name="CartCmd" value="add" /> 10971098 @RenderMyEivaInfoOverlay() 10991100 <div class="container"> 1101 <div class="o-priceBar o-priceBar--training"> 1102 <div class="o-priceBar__item o-priceBar__item--seatsAvailable"> 1103 <div class="m-seatsAvailable "> 1104 <svg class="a-svgIcon m-seatsAvailable__iconHolder"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/frontend/dist/icons/icons.svg#checkmark"></use></svg> 1105 <span class="m-seatsAvailable__text"> 1106 @Translate("seats available", "seats available") 1107 </span> 1108 </div> 1109 </div> 1110 <div class="o-priceBar__item o-priceBar__item--amount "> 1111 <div class="m-amountInputArrows m-amountInputArrows--withLabel"> 1112 <div class="m-amountInputArrows__inputHolder"> 11131114 <input data-stock="@stockCount" max="9999" value="1" class="a-input m-amountInputArrows--withLabel m-amountInputArrows__input" type="number" name="quantity" id="amountTraining" placeholder="" /> 1115 <label for="amountTraining" class="m-amountInputArrows__label">@Translate("seat", "seat")</label> 1116 <button type="button" class="m-amountInputArrows__button m-amountInputArrows__button--prodDetailStdJs m-amountInputArrows__button--up"></button> 1117 <button type="button" class="m-amountInputArrows__button m-amountInputArrows__button--prodDetailStdJs m-amountInputArrows__button--down"></button> 1118 </div> 1119 </div> 1120 </div> 1121 <div class="o-priceBar__item o-priceBar__item--price"> 1122 <div class="m-price"> 1123 <span class="m-price__price"><span class="m-price__unit">@GetValue("Ecom:Product.Price.Currency.Symbol")</span><span id="trainingPriceNormal" data-price-var="@GetValue("Ecom:Product.Price.PricePIP")">@GetValue("Ecom:Product.Price.Price")</span></span> 1124 <span class="m-price__vat">@Translate("ExclVAT" + productProductCategory, "excl VAT")</span> 1125 </div> 1126 </div> 1127 <div class="o-priceBar__item o-priceBar__item--buttons"> 1128 <span class="hidden stock-limit js-stock-limit">@Translate("Seat stock limit", "Seat stock limit")</span> 1129 <button type="submit" onclick="novicell.cart.addToCart(event, 'training');" property="url" class="a-button a-button--l a-button--green o-priceBar__button "> 1130 @Translate("Add to basket", "Add to basket") 1131 </button> 1132 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.MoreInfoText"))) 1133 { 1134 var moreInfoLink = GetString("Ecom:Product:Field.MoreInfoLink.Value.Clean"); 1135 if (moreInfoLink.IndexOf("/Files") > -1 && moreInfoLink.IndexOf(".") < 0) 1136 { 1137 moreInfoLink = moreInfoLink.Substring("/Files".Length); 1138 } 1139 <a href="@moreInfoLink" @(GetBoolean("Ecom:Product:Field.moreInfoNoNewTab") ? "" : "target=\"blank\"") title="@GetString("Ecom:Product:Field.MoreInfoText")" property="url" class="a-button a-button--l a-button--white o-priceBar__button "> 1140 @GetString("Ecom:Product:Field.MoreInfoText") 1141 </a> 1142 } 1143 </div> 1144 @if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.AlsoAvailableLink")) && !string.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.AlsoAvailableText"))) 1145 { 1146 <div class="o-priceBar__item o-priceBar__item--link2 o-priceBar__item--outside"> 1147 <div class="o-priceBar__link"><a href="@GetString("Ecom:Product:Field.AlsoAvailableLink")">@GetString("Ecom:Product:Field.AlsoAvailableText")</a></div> 1148 </div> 1149 } 1150 </div> 1151 </div> 1152 </form> 1153 } 1154 @helper RenderTrainingPriceSoldout(string productProductCategory, string alsoAvailableLink) 1155 { 1156 <div class="container"> 1157 <div class="o-priceBar o-priceBar--training o-priceBar--training-soldout"> 1158 <div class="o-priceBar__item o-priceBar__item--seatsAvailable o-priceBar__item--seatsAvailableSoldout"> 1159 <div class="m-seatsAvailable m-seatsAvailable--soldOut"> 1160 <svg class="a-svgIcon m-seatsAvailable__iconHolder"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/frontend/dist/icons/icons.svg#info"></use></svg> 1161 <span class="m-seatsAvailable__text"> 1162 @Translate("No seats available at the moment", "No seats available at the moment. Contact mai@eiva.com to get on the list.") 1163 </span> 1164 </div> 1165 </div> 1166 <div class="o-priceBar__item o-priceBar__item--amount "> 1167 <div class="m-amountInputArrows m-amountInputArrows--withLabel m-amountInputArrows--disabled"> 1168 <label class="a-label m-amountInputArrows--withLabel m-amountInputArrows__labelBefore" for="amountTraining"> 1169 </label> 1170 <div class="m-amountInputArrows__inputHolder"> 1171 <input max="9999" value="1" class="a-input m-amountInputArrows--withLabel m-amountInputArrows__input" type="number" name="quantity" id="amountTraining" placeholder="" disabled /> 1172 <label for="amountTraining" class="m-amountInputArrows__label">@Translate("seat", "seat")</label> 1173 <button type="button" class="m-amountInputArrows__button m-amountInputArrows__button--prodDetailStdJs m-amountInputArrows__button--up"></button> 1174 <button type="button" class="m-amountInputArrows__button m-amountInputArrows__button--prodDetailStdJs m-amountInputArrows__button--down"></button> 1175 </div> 1176 </div> 1177 </div> 1178 <div class="o-priceBar__item o-priceBar__item--price"> 1179 <div class="m-price m-price--disabled"> 11801181 <span class="m-price__price"><span class="m-price__unit">@GetValue("Ecom:Product.Price.Currency.Symbol")</span><span id="trainingPriceSoldOut" data-price-var="@GetValue("Ecom:Product.Price.PricePIP")">@GetValue("Ecom:Product.Price.Price")</span></span> 1182 <span class="m-price__vat">@Translate("ExclVAT" + productProductCategory, "excl VAT, excl shipping fee")</span> 1183 </div> 1184 </div> 1185 <div class="o-priceBar__item o-priceBar__item--buttons"> 1186 <button type="submit" disabled property="url" class="a-button a-button--l a-button--green o-priceBar__button a-button--disabled"> 1187 @Translate("Add to basket", "Add to basket") 1188 </button> 1189 </div> 1190 @if (!string.IsNullOrEmpty(alsoAvailableLink) && !string.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.AlsoAvailableText"))) 1191 { 1192 <div class="o-priceBar__item o-priceBar__item--link2 o-priceBar__item--outside"> 1193 <div class="o-priceBar__link"> 1194 <a href="@alsoAvailableLink"> 1195 @GetString("Ecom:Product:Field.AlsoAvailableText") 1196 </a> 1197 </div> 1198 </div> 1199 } 1200 </div> 1201 </div> 1202 } 1203 @helper RenderAlsoAvailableForLink(Product prod) 1204 { 1205 @* Also available for *@ 1206 if (!string.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.AlsoAvailableText"))) 1207 { 1208 <div class="o-priceBar__item o-priceBar__item--link2 o-priceBar__item--outside"> 1209 <div class="o-priceBar__link">@GetString("Ecom:Product:Field.AlsoAvailableText")</div> 1210 </div> 1211 } 1212 } 121312141215 @helper RenderFeature(string pageId) 1216 { 1217 int id = Int32.Parse(pageId); 121812191220 if (Dynamicweb.Services.Pages.GetPage(id) != null) 1221 { 1222 var paragraphs = Dynamicweb.Services.Paragraphs.GetParagraphsByPageId(id); 1223 var pageItem = Dynamicweb.Services.Items.GetItemByPageId(id, false); 12241225 <li class="col-xs-12 col-sm-6 col-md-3 o-highlightedFeatures__item"> 1226 <a href="#" title="" property="url" class="m-product-card m-product-card--highlightedFeature m-product-card__btn--openFeatureOverlay" data-feature-overlay-id="overlay@(id)"> 1227 <div class="m-product-card__image-holder"> 12281229 <img class="lazyload lazyload-measure lazyload-bg a-image m-cardImageText__image" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="@pageItem["ListHeader"]" property="contentUrl" data-src="@pageItem["ListImage"]" 1230 data-query-obj='{ "mode":"crop" , "quality":"80", "upscale":false }'> 1231 <noscript> 1232 <img src="@pageItem["ListImage"]?mode=crop&width=400" alt="@pageItem["ListHeader"]"> 1233 </noscript> 1234 </div> 12351236 <div class="m-product-card__content"> 1237 <h4 class="m-product-card__header">@pageItem["ListHeader"]</h4> 1238 <p class="m-product-card__subheader">@pageItem["ListTeaser"]</p> 1239 </div> 12401241 <div class="m-product-card__btnPriceHolder"> 1242 <div class="m-product-card__btn-holder"> 1243 <span class="a-button a-button--s a-button--green m-product-card__btn"> 1244 @pageItem["ListButtonText"] 1245 </span> 1246 </div> 1247 </div> 1248 </a> 1249 <div class="m-product-card__featureOverlayContentHolder" id="overlay@(id)"> 1250 @foreach (var pi in paragraphs) 1251 { 1252 if (pi.GlobalID == default(int)) 1253 { 1254 @RenderParagraphContent(pi.ID) 1255 } 1256 else 1257 { 1258 @RenderParagraphContent(pi.GlobalID) 1259 } 12601261 } 1262 </div> 12631264 </li> 1265 } 1266 } 12671268 @helper RenderSpecifications(string pageId) 1269 { 1270 int id = Int32.Parse(pageId); 1271 var mainItem = Dynamicweb.Services.Items.GetItemByPageId(id, false); 1272 int iid = 0; 1273 var specsType = mainItem["Specifications"] != null && int.TryParse(mainItem["Specifications"].ToString(), out iid) ? "specifications" : "comparisonTable"; 1274 var mainClass = specsType == "specifications" ? "o-productSpecifications" : "o-featureComparison o-featureComparison--noVisibleScroll"; 12751276 <div class="@mainClass helperProductPageExtraItems"> 1277 <div class="container"> 1278 <div class="base-accordion base-accordion--mobileOnly"> 1279 <h2 class="a-heading a-heading--productPage base-accordion__header ">@GetString("Ecom:Product:Field.SpecificationsHeader")</h2> 1280 <div class="base-accordion__content js-accordion"> 12811282 @if (specsType == "specifications") 1283 { 1284 var itemList = ItemList.GetItemListById(iid).Relations; 1285 <dl class="o-productSpecifications__list"> 12861287 @foreach (var item in itemList.ToList()) 1288 { 1289 var i = Dynamicweb.Services.Items.GetItem("SpecificationItem", item.Id.ToString()); 1290 <dt class="o-productSpecifications__item o-productSpecifications__item--term"> 1291 @i["LeftColumn"] 1292 </dt> 1293 <dd class="o-productSpecifications__item o-productSpecifications__item--data"> 1294 @i["RightColumn"] 1295 </dd> 1296 } 1297 </dl> 1298 } 1299 else 1300 { 1301 @RenderProductComparison(pageId) 1302 } 1303 </div> 1304 </div> 1305 </div> 1306 </div> 13071308 } 13091310 @helper RenderProductComparison(string pageId) 1311 { 1312 int id = Int32.Parse(pageId); 1313 var item = Dynamicweb.Services.Items.GetItemByPageId(id, false); 13141315 <section class="o-text-element"> 1316 <div class="o-text-element__col o-text-element__col--embeddedOneCol"> 1317 <div class="o-text-element__content o-text-element__content--left"> 1318 <div class="m-rich-text-editor o-text-element__rte"> 1319 @item["ProductComparison"] 1320 </div> 1321 </div> 1322 </div> 1323 </section> 1324 } 13251326132713281329 @helper sliderOverlayItem(string image, string altText, string videoId) 1330 { 1331 <li class="m-productImageSlider__itemOverlay"> 1332 <div class="m-productImageSlider__slideHolder overlay-slideHolder@(!string.IsNullOrEmpty(videoId) ? " video-slide" : "")"> 1333 @if (!string.IsNullOrEmpty(videoId)) 1334 { 1335 <iframe data-src="https://www.youtube.com/embed/@videoId?autoplay=true&amp;rel=0" class="m-productImageSlider__videoIframe" frameborder="0" allowfullscreen="" width="100%" height="100%"></iframe> 1336 } 1337 else 1338 { 1339 <img class="slide-image" src="@image?mode=crop&quality=100&upscale=false" alt="@altText" /> 1340 } 1341 </div> 1342 </li> 1343 } 13441345 @helper sliderLargeItem(string image, string altText, string videoId) 1346 { 1347 <li class="m-productImageSlider__item"> 1348 <div class="m-productImageSlider__slideHolder"> 13491350 <img class="lazyload lazyload-measure lazyload-bg a-image m-productImageSlider__image" 1351 src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" 1352 alt="@altText" 1353 property="contentUrl" 1354 data-src="@image" 1355 data-query-obj='{ "mode":"crop" , "quality":"100", "upscale":false }'> 1356 <noscript> 1357 <img src="@image?mode=crop&width=500" 1358 alt="@altText"> 1359 </noscript> 1360 @if (!string.IsNullOrEmpty(videoId)) 1361 { 1362 <button class="m-productImageSlider__videoButton" data-videoid="@videoId"> 1363 <div class="a-videoPlayIcon "></div> 1364 </button> 1365 } 1366 </div> 1367 </li> 1368 } 13691370 @helper sliderSmallItem(string image, string altText, string videoId) 1371 { 1372 <li class="m-productImageSlider__itemSmall"> 1373 <img class="lazyload a-image" 1374 src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" 1375 alt="@altText" 1376 property="contentUrl" 1377 data-src="@image?mode=crop&width=62&Height=35" 1378 data-query-obj='{ "mode":"crop" , "quality":"80", "upscale":false }'> 1379 <noscript> 1380 <img src="@image?mode=crop&width=62&Height=35" 1381 alt="@altText"> 1382 </noscript> 1383 @if (!string.IsNullOrEmpty(videoId)) 1384 { 1385 <div class="a-videoPlayIcon a-videoPlayIcon--small js-a-videoPlayIcon--noPlay"></div> 1386 } 1387 </li> 1388 } 1389
EIVA LIVE - Dive into EIVA's software and hardware solutions for the maritime industry

Want to attend free webinars?

The ongoing EIVA LIVE webinar series keeps you up to date on our latest software and hardware developments – with the possibility to dive deeper and ask our experts questions. Past webinars have showcased solutions such as our autopilot and software for autonomous hydrographic surveys, as well as new automated ROV inspection modes.