Error executing template "Designs/Fysiodema/eCom/Product/ProductClean1GTM.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_51c8f6a6fe0c408faf666f6578e66159.Execute() in E:\dynamicweb.net\solutions\FlexMedia\fysiodema.dw9.dynamicweb-cms.com\files\Templates\Designs\Fysiodema\eCom\Product\ProductClean1GTM.cshtml:line 65
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
   at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2 3 @{ 4 int VariantGroupsCnt=0; 5 var PricesQuantity = 0.0; 6 var PricesPrice = 0.0; 7 var PricesQuantityPrice = 0.0; 8 var hidePrice = GetBoolean("Ecom:Product:Field.HidePrice"); 9 10 var oneRow = GetBoolean("Ecom:Product:Field.OneRowOptions"); 11 var addClass =""; 12 if (GetBoolean("Ecom:Product:Field.OneRowOptions")){ 13 addClass = "oneRow"; 14 } 15 16 foreach(LoopItem i in GetLoop("Product.Prices")){if(i.GetInteger("Ecom:Product.Prices.Quantity")>1){ 17 if(i.GetDouble("Ecom:Product.Prices.Quantity")>PricesQuantity){ 18 PricesQuantity = i.GetDouble("Ecom:Product.Prices.Quantity"); 19 PricesPrice = i.GetDouble("Ecom:Product.Prices.Price"); 20 PricesQuantityPrice = @PricesQuantity*@PricesPrice; 21 } 22 }} 23 24 } 25 26 27 <!--$$SnippetStart(MetaDescription)--> 28 <title>@Dynamicweb.Frontend.PageView.Current().Meta.Title</title> 29 <base href='@GetGlobalValue("Global:Area.Primarydomain")'> 30 <meta property="og:title" content="@Dynamicweb.Frontend.PageView.Current().Meta.Title" /> 31 <meta property="og:site_name" content="Produkter" /> 32 <meta property="og:url" content='@GetGlobalValue("Global:Request.AbsoluteUri")' /> 33 @if(!string.IsNullOrWhiteSpace(GetString("Ecom:Product.MetaDescription"))){ 34 <meta name="description" content="@(GetString("Ecom:Product.MetaDescription"))" /> 35 <meta name="og:description" content="@(GetString("Ecom:Product.MetaDescription"))" /> 36 }else{ 37 <meta name="description" content="@GetValue("Ecom:Product.Name") - @(System.Web.HttpContext.Current.Server.HtmlDecode(Dynamicweb.Core.Helpers.StringHelper.StripHtml(GetString("Ecom:Product.ShortDescription"))))" /> 38 <meta name="og:description" content="@GetValue("Ecom:Product.Name") - @(System.Web.HttpContext.Current.Server.HtmlDecode(Dynamicweb.Core.Helpers.StringHelper.StripHtml(GetString("Ecom:Product.ShortDescription"))))" /> 39 } 40 41 <meta property="og:image" content="@GetGlobalValue("Global:Area.Primarydomain")@GetString("Ecom:Product.ImageDefault.Clean")" /> 42 <meta property="og:type" content="Website" /> 43 44 <!--$$SnippetEnd(MetaDescription)--> 45 46 47 48 </script> 49 50 51 52 @{ 53 var groupObject = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(GetString("Ecom:Product.PrimaryOrFirstGroupID")); 54 string prodManufacturerName = GetString("Ecom:Manufacturer.Name"); 55 string prodName = GetString("Ecom:Product.Name").Replace("\"", "\\\""); 56 string prodDescription = GetString("Ecom:Product.MetaDescription").Replace("\"", "\\\""); 57 string prodImage = GetString("Ecom:Product.ImageLarge.Default.Clean"); 58 59 // string prodPrice = GetDouble("Ecom:Product.Discount.Price.PriceWithVAT") != GetDouble("Ecom:Product.Price.PriceWithVAT") ? GetDouble("Ecom:Product.Discount.Price.PriceWithVAT").ToString().Replace(",", ".") : GetDouble("Ecom:Product.Price.PriceWithVAT").ToString().Replace(",", "."); 60 Double dPriceWithVat = GetDouble("Ecom:Product.Price.PriceWithoutVAT.Value")*(GetDouble("Ecom:Product.Price.VATPercent")+100)/100; 61 string prodPrice = dPriceWithVat.ToString().Replace(",", "."); 62 string prodPriceCurrency = GetString("Ecom:Product.Currency.Code"); 63 string exclLevering = ""; 64 65 if (groupObject.Id == "GROUP17"){ 66 exclLevering = ", " + Translate("ekskl. levering"); 67 } 68 69 } 70 <script type="application/ld+json"> 71 { 72 "@@context": "http://schema.org", 73 "@@type": "Product", 74 "category": "@(groupObject != null ? groupObject.Name : "")", 75 "manufacturer": "@prodManufacturerName", 76 "name": "@prodName", 77 "description": "@prodDescription", 78 "image": "@prodImage", 79 "offers": { 80 "@@type": "Offer", 81 "availability": "http://schema.org/InStock", 82 "price": "@prodPrice", 83 "priceCurrency": "@prodPriceCurrency" 84 } 85 } 86 </script> 87 88 89 90 @{ 91 int VariantCombinationsLoop=0;foreach (LoopItem v in GetLoop("VariantCombinations")){VariantCombinationsLoop=1;} 92 bool IsService = GetString("Ecom:Product.Type")=="1" ? true:false; 93 94 } 95 96 @SnippetStart("EcomProductTitle")@GetValue("Ecom:Product.Name")@SnippetEnd("EcomProductTitle") 97 98 <div class="single-product container"> 99 100 101 102 <div class="images-column"> 103 104 @if (GetBoolean("Ecom:Product:Field.LimitedOffer")){ 105 <span class="limited-offer">Tidsbegrænset tilbud</span> 106 } 107 108 @if (@GetValue("Ecom:Product.ImageLarge.Default.Clean")!="" && !GetString("Ecom:Product.ImageLarge.Default.Clean").Contains("Lighthouse.jpg") ){ 109 <div class="main-image"> 110 <a data-fancybox="product" href='@GetValue("Ecom:Product.ImageLarge.Default.Clean")'> 111 112 <img src='/admin/public/getimage.ashx?Image=@GetString("Ecom:Product.ImageMedium.Clean")&amp;Format=jpg&amp;Width=600&amp;Height=600&amp;Compression=66&amp;Crop=0&amp;Background=f5f5f5&amp;' alt='@GetValue("Ecom:Product.Name")'> 113 </a> 114 @foreach (LoopItem i in GetLoop("Details")){ 115 116 <a data-fancybox="product" href='@i.GetValue("Ecom:Product:Detail.Image.Clean")'> 117 118 <img src='/admin/public/getimage.ashx?Image=@i.GetString("Ecom:Product:Detail.Image.Clean")&amp;Format=jpg&amp;Width=600&amp;Height=600&amp;Compression=66&amp;Crop=0&amp;Background=f5f5f5&amp;' alt='@GetValue("Ecom:Product.Name")'> 119 </a> 120 } 121 </div> 122 } 123 124 else{ 125 <div class="main-image"> 126 <a data-fancybox="product" href='@GetValue("Ecom:Product.ImageMedium.Default.Clean")'> 127 <img src='/admin/public/getimage.ashx?Image=@GetString("Ecom:Product.ImageMedium.Clean")&amp;Format=jpg&amp;Width=600&amp;Height=600&amp;Compression=66&amp;Crop=0&amp;Background=f5f5f5&amp;' alt='@GetValue("Ecom:Product.Name")'> 128 </a> 129 @{int iCnt = 0;} 130 @foreach (LoopItem i in GetLoop("Details")){ 131 iCnt++; 132 if (@i.GetString("Ecom:Product:Detail.Image.Clean").Contains("youtube")){ 133 var youtube = i.GetString("Ecom:Product:Detail.Image.Clean"); 134 youtube = youtube.Substring(youtube.LastIndexOf('=') + 1); 135 136 <a class="youtube" data-fancybox="product" href='@i.GetValue("Ecom:Product:Detail.Image.Clean")'> 137 138 <img class="youtube" src='https://img.youtube.com/vi/@youtube/mqdefault.jpg'> 139 </a> 140 } else { 141 142 143 144 <a data-fancybox="product" href='@i.GetValue("Ecom:Product:Detail.Image.Clean")'> 145 146 <img src='/admin/public/getimage.ashx?Image=@i.GetString("Ecom:Product:Detail.Image.Clean")&amp;Format=jpg&amp;Width=600&amp;Height=600&amp;Compression=66&amp;Crop=0&amp;Background=f5f5f5&amp;' alt='@GetValue("Ecom:Product.Name") @iCnt'> 147 </a> 148 } 149 } 150 </div> 151 } 152 153 </div> 154 155 <div class="product-data-column"> 156 157 <h1>@GetValue("Ecom:Product.Name")</h1> 158 @if (@GetValue("Ecom:Product:Field.HeaderSubtitle.Value.Clean")!=""){ 159 @GetValue("Ecom:Product:Field.HeaderSubtitle.Value.Clean") 160 } 161 162 163 164 165 166 167 <span class="descrip">@GetValue("Ecom:Product.ShortDescription")</span> 168 169 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.SizeGuide"))) { 170 <span class="guide-link"><a onclick="$('html, body').animate({scrollTop: $(`#sizeguide`).offset().top -120},750)">@Translate("Størrelsesguide")</a></span> 171 } 172 173 174 175 176 177 @if (!hidePrice){ 178 179 <span class="form"> 180 181 182 183 <form id="Add2Cart" class="Add2Cart @addClass" method="post" onsubmit="return Add2Cart(this)"> 184 @if(VariantCombinationsLoop==1){ 185 if(!IsService){ 186 187 foreach (LoopItem vg in GetLoop("VariantGroups")){VariantGroupsCnt++; 188 189 var groupName = vg.GetString("Ecom:VariantGroup.Name"); 190 if (vg.GetString("Ecom:VariantGroup.Name") == "Size" || vg.GetString("Ecom:VariantGroup.Name") == "Size."){ 191 groupName = Translate("Size", "Size"); 192 } 193 194 195 <div> 196 <span class="select"><select name="SelectVariantID" onchange="ocsel2(this)"> 197 @foreach (LoopItem vao in vg.GetLoop("VariantAvailableOptions")){ 198 <option value="@vao.GetValue("Ecom:VariantOption.ID")" text="@vao.GetValue("Ecom:VariantOption.Name")" @if(vao.GetBoolean("Ecom:VariantOption.Selected")){<text>selected=true</text>}>@groupName @vao.GetValue("Ecom:VariantOption.Name")</option> 199 } 200 </select></span> 201 </div> 202 } 203 204 205 } 206 } 207 208 209 @if(VariantCombinationsLoop==1){ 210 211 if(IsService){ 212 <div><span class="select"><select name="SelectVariantID" onchange="ocsel2(this)"> 213 @foreach (LoopItem vc in GetLoop("VariantCombinations")){ 214 <option value="@vc.GetValue("Ecom:VariantCombination.VariantID")" text="@vc.GetValue("Ecom:VariantCombination.VariantText")" @if(vc.GetBoolean("Ecom:VariantCombination.Selected")){<text>selected=true</text>}>@vc.GetValue("Ecom:VariantCombination.VariantText")</option> 215 } 216 </select></span></div> 217 } 218 219 <div id="VariantPrice"> 220 @foreach (LoopItem v in GetLoop("VariantCombinations")){ 221 222 223 <h3 class="price" show="@v.GetValue("Ecom:VariantCombination.VariantID")"> 224 <span class="amount" pri="variant"> 225 226 @if (!string.IsNullOrWhiteSpace(v.GetString("Ecom:Product.HaveDiscount"))) { 227 228 229 230 <span class="price old"> 231 <span class="amount" pri="variant"> 232 <span pri="no-old yes-disc"> 233 @v.GetString("Ecom:VariantCombination.Product.Price.CurrencyCode") 234 @v.GetValue("Ecom:VariantCombination.Product.Price.PriceWithoutVAT") 235 236 </span> 237 238 </span> 239 </span> 240 241 <span class="price new"> 242 <span class="amount" pri="variant"> 243 <span pri="no-old yes-disc"> 244 @v.GetString("Ecom:VariantCombination.Product.Price.CurrencyCode") 245 @v.GetValue("Ecom:Product.Discount.Price.PriceWithoutVAT") 246 <div>@Translate("ekskl. moms", "ekskl. moms")@exclLevering</div> 247 </span> 248 249 </span> 250 </span> 251 252 253 <span class="price old"> 254 <span class="amount" pri="variant"> 255 <span pri="no-old yes-disc"> 256 @v.GetString("Ecom:VariantCombination.Product.Price.CurrencyCode") 257 @v.GetValue("Ecom:VariantCombination.Product.Price.PriceWithVAT") 258 259 </span> 260 261 </span> 262 </span> 263 264 <span class="price new"> 265 <span class="amount" pri="variant"> 266 <span pri="no-old yes-disc"> 267 @v.GetString("Ecom:VariantCombination.Product.Price.CurrencyCode") 268 @v.GetValue("Ecom:Product.Discount.Price.PriceWithVAT") 269 <div>@Translate("inkl. moms", "inkl. moms")@exclLevering</div> 270 </span> 271 272 </span> 273 </span> 274 275 276 277 278 279 }else{ 280 281 <span pri="no-old no-disc"> 282 @if(v.GetDouble("Ecom:Product.DBPrice")>v.GetDouble("Ecom:VariantCombination.Product.Price.PriceWithoutVAT")){ 283 var DBPriceWhitVAT=v.GetDouble("Ecom:Product.DBPrice")*((v.GetDouble("Ecom:VariantCombination.Product.Price.VATPercent")/100)+1); 284 var SaveWhitVAT=DBPriceWhitVAT-v.GetDouble("Ecom:VariantCombination.Product.Price.Price"); 285 <span class="spar"><span class="oldPrice">Før @DBPriceWhitVAT.ToString("N")</span> Spar @SaveWhitVAT.ToString("N")</span> 286 <text>Nu</text> 287 } 288 289 <span class="incl-moms"> 290 @v.GetValue("Ecom:VariantCombination.Product.Price.PriceWithVAT") 291 <div>@Translate("inkl. moms", "inkl. moms")@exclLevering</div> 292 </span> 293 294 <span class="excl-moms"> 295 @v.GetValue("Ecom:VariantCombination.Product.Price.PriceWithoutVAT") 296 <div>@Translate("ekskl. moms", "ekskl. moms")@exclLevering</div> 297 </span> 298 299 300 301 302 303 </span> 304 305 } 306 </span> 307 </h3> 308 309 } 310 </div> 311 312 313 314 }else{ 315 316 if (!string.IsNullOrWhiteSpace(GetString("Ecom:Product.HaveDiscount"))) { 317 318 <h3 class="price old"> 319 <span class="amount" pri="variant"> 320 <span pri="no-old yes-disc"> 321 322 <div> 323 @GetValue("Ecom:Product.Price.CurrencyCode") 324 @GetValue("Ecom:Product.Price.PriceWithVAT") 325 </div> 326 327 <div> 328 @GetValue("Ecom:Product.Price.CurrencyCode") 329 @GetValue("Ecom:Product.Price.PriceWithoutVAT") 330 </div> 331 332 </span> 333 334 </span> 335 </h3> 336 337 <h3 class="price new"> 338 <span class="amount" pri="variant"> 339 <span pri="no-old yes-disc"> 340 <div> 341 @GetValue("Ecom:Product.Price.CurrencyCode") 342 @GetValue("Ecom:Product.Discount.Price.PriceWithoutVAT") 343 <div>@Translate("ekskl. moms", "ekskl. moms")@exclLevering</div> 344 </div> 345 <br> 346 <div> 347 @GetValue("Ecom:Product.Price.CurrencyCode") 348 @GetValue("Ecom:Product.Discount.Price.PriceWithVAT") 349 <div>@Translate("inkl. moms", "inkl. moms")@exclLevering</div> 350 </div> 351 352 353 </span> 354 355 </span> 356 </h3> 357 358 } else { 359 360 361 <h3 class="price"> 362 <span class="amount" pri="variant"> 363 <span pri="no-old no-disc"> 364 365 <div> 366 @GetValue("Ecom:Product.Price.CurrencyCode") 367 @GetValue("Ecom:Product.Discount.Price.PriceWithoutVAT") 368 <div>@Translate("ekskl. moms", "ekskl. moms")@exclLevering</div> 369 </div><br> 370 <div> 371 @GetValue("Ecom:Product.Price.CurrencyCode") 372 @GetValue("Ecom:Product.Discount.Price.PriceWithVAT") 373 <div>@Translate("inkl. moms", "inkl. moms")@exclLevering</div> 374 </div> 375 376 377 378 </span> 379 </span> 380 </h3> 381 } 382 383 384 385 } 386 387 388 <input type="hidden" id="VariantID" name="VariantID" value="" /> 389 <input type="hidden" name="cartcmd" value="add" /> 390 <input type="hidden" name="ProductID" value="@GetValue("Ecom:Product.ID")" /> 391 <input type="hidden" name="OrderContext" value='@Pageview.Area.Item["ORDERCONTEXT"]' /> 392 <input type="hidden" name="UnitID" value="@GetValue("Ecom:Product.DefaultUnitID")" /> 393 <div class="quantity"> 394 395 <input class="qty" type="number" name="Quantity" value="1" max="999" min="1" maxlength="3" /> 396 397 </div> 398 <button type="submit" class="addToCart">@Translate("Add2Cart", "Tilføj kurv")</button> 399 400 401 </form> 402 </span> 403 404 } 405 406 <div id="ProductCartList"> 407 @RenderSnippet("cardsList") 408 </div> 409 410 </div> 411 <div class="tabs-container"> 412 413 <ul id="TabSelect"> 414 <li item="Fane1" class="activ" onclick="ProductTab(this)">@Translate("Description", "Beskrivelse")</li> 415 416 @if(@GetString("Ecom:Product.Weight") != "0" || @GetValue("Ecom:Product:Field.Dimensions.Value.Clean") != "" || @GetValue("Ecom:Product:Field.Dimensions.Value.Clean") != "" ){ 417 <li item="Fane2" onclick="ProductTab(this)">@Translate("AdditionalInformation", "Yderligere information")</li> 418 } 419 420 </ul> 421 422 <div id="TabItems"> 423 <div id="Fane1" class="TabItem ShowThis"> 424 425 @GetValue("Ecom:Product.LongDescription") 426 427 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.BorderDesignBlock"))) { 428 429 <span id="borderdesign"> 430 @GetValue("Ecom:Product:Field.BorderDesignBlock") 431 </span> 432 } 433 434 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.SizeGuide"))) { 435 436 <span id="sizeguide"> 437 @GetValue("Ecom:Product:Field.SizeGuide") 438 </span> 439 } 440 </div> 441 442 @if(@GetString("Ecom:Product.Weight") != "0" || @GetValue("Ecom:Product:Field.Dimensions.Value.Clean") != "" || @GetValue("Ecom:Product:Field.Dimensions.Value.Clean") != "" ){ 443 <div id="Fane2" class="TabItem"> 444 <table class="shop_attributes"> 445 <tbody> 446 @if (@GetString("Ecom:Product.Weight") != "0"){ 447 <tr class=""> 448 <th>Weight</th> 449 <td class="product_weight">@GetValue("Ecom:Product.Weight") lbs</td> 450 </tr> 451 } 452 @if (@GetValue("Ecom:Product:Field.Dimensions.Value.Clean")!=""){ 453 <tr class="alt"> 454 <th>@GetValue("Ecom:Product:Field.Dimensions.Name")</th> 455 <td class="product_dimensions">@GetValue("Ecom:Product:Field.Dimensions.Value.Clean")</td> 456 </tr>} 457 @if (@GetValue("Ecom:Product:Field.SIZE")!=""){ 458 <tr class=""> 459 <th>@GetValue("Ecom:Product:Field.SIZE.Name")</th> 460 <td> 461 <p>@GetValue("Ecom:Product:Field.SIZE")</p> 462 </td> 463 </tr>} 464 </tbody> 465 </table> 466 </div> 467 } 468 469 470 471 472 473 </div> 474 475 476 477 478 479 480 @{ 481 int RelatedProducts = 0; 482 var groupname = ""; 483 foreach (var g in GetLoop("ProductRelatedGroups")){ 484 485 g.GetValue("Ecom:Product:RelatedGroup.GroupID"); 486 487 foreach (var i in g.GetLoop("RelatedProducts")){RelatedProducts++;}} 488 } 489 @if(RelatedProducts>0){ 490 491 492 493 494 495 496 foreach (var g in GetLoop("ProductRelatedGroups")) { 497 groupname = g.GetString("Ecom:Product:RelatedGroup.Name"); 498 499 500 <h2>@groupname</h2> 501 <ul class="related-products"> 502 @foreach (var i in g.GetLoop("RelatedProducts")) { 503 var imageClean = @i.GetString("Ecom:Product.ImageSmall.Clean"); 504 var rName = @i.GetValue("Ecom:Product.Name"); 505 506 <li> 507 <a href="@i.GetValue("Ecom:Product.Link.Clean")"> 508 <img src="@imageClean" alt="@rName"> 509 </a> 510 511 <h3>@i.GetValue("Ecom:Product.Name")</h3> 512 513 @{ 514 int vc = 0; 515 var vcFra = ""; 516 if(i.Loops.Contains("VariantCombinations")){ 517 int vcPrice = 0; 518 int vcPriceHigh = 0; 519 foreach (var v in i.GetLoop("VariantCombinations")){ 520 if(vcPrice >= v.GetInteger("Ecom:VariantCombination.Product.Price.PricePIP") || vcPrice==0){ 521 vcPrice = v.GetInteger("Ecom:VariantCombination.Product.Price.PricePIP"); 522 vc = v.GetInteger("Ecom:Product.LoopCounter"); 523 524 } 525 if(v.GetInteger("Ecom:VariantCombination.Product.Price.PricePIP") > vcPriceHigh){ 526 vcPriceHigh = v.GetInteger("Ecom:VariantCombination.Product.Price.PricePIP"); 527 } 528 } 529 if(vcPriceHigh>vcPrice){vcFra = "Fra";} 530 } 531 532 533 if(vc>0){ 534 535 536 <span class="price"> 537 <span class="amount"> 538 From @i.GetString("Ecom:Product.Price") 539 </span> 540 </span> 541 542 543 <a rel="nofollow" href='@i.GetString("Ecom:Product.Link.Clean")' class="product_type_simple add_to_cart_button ajax_add_to_cart">@Translate("SELECTOPTIONS","SELECT OPTIONS")</a> 544 545 } 546 547 else{ 548 549 <span class="price"> 550 <span class="amount"> 551 @i.GetString("Ecom:Product.Price") 552 </span> 553 </span> 554 555 <a rel="nofollow" onclick='setCook("showMinicart", "true", 86400);' href='@i.GetString("Ecom:Product:SavedForLater.AddToBasketLink")' class="product_type_simple add_to_cart_button ajax_add_to_cart">@Translate("AddToCart","Add to cart")</a> 556 557 } 558 } 559 560 561 562 563 564 565 566 567 </li> 568 }</ul> 569 } 570 571 } 572 </div> 573 574 </div> 575 576 <script type="text/javascript"> 577 function Add2Cart(self){if(isInt(self.Quantity.value)&&self.Quantity.value>0){self.className+=" Adding";setCook("showMinicart", "true", 86400);return GTMAddToCart2(self);}else{return false;}} 578 function isInt(n){return n>>>0===parseFloat(n);} 579 </script> 580 581 582 <script type="text/javascript"> 583 584 function ocsel2(self){ 585 console.log('test'); 586 ocInputs=self.form.elements[self.name]; 587 names=[].map.call(ocInputs,function(input){return input.value;}).join('.'); 588 if(@VariantGroupsCnt==1){names=self.value} 589 document.getElementById("VariantID").value=names; 590 591 592 593 594 595 //alert(document.getElementById("VariantID").value) 596 setVariantPrice(names); 597 console.log(names); 598 // ocsel(self); 599 600 SelList=document.getElementsByName(self.name); 601 if(SelList.length>1){ 602 slstr="";slrstr=""; 603 for(i=0;i<SelList.length;i++){ 604 slstr+="."+SelList[i].options[SelList[i].selectedIndex].value;slrstr="."+SelList[i].options[SelList[i].selectedIndex].value+slrstr; 605 } 606 607 if(VariantPriceFound(slstr.substring(1))){ 608 setVariantPrice(slstr.substring(1)); 609 document.getElementById("VariantID").value=slstr.substring(1); 610 }else if(VariantPriceFound(slrstr.substring(1))){ 611 setVariantPrice(slrstr.substring(1)) 612 document.getElementById("VariantID").value=slrstr.substring(1); 613 } 614 615 } 616 617 618 //alert(noget.length) 619 620 //alert(noget[0].selectedIndex) 621 622 //alert(noget[0].options) 623 624 //alert(noget[0].value) 625 626 //alert(document.getElementsByName(self.name).selectedIndex ) 627 628 } 629 630 631 function VariantPriceFound(Names){ 632 isFound=false; 633 VP=document.getElementById("VariantPrice"); 634 VPp=VP.getElementsByClassName("price"); 635 for(i=0;i<VPp.length;i++){ 636 if(VPp[i].getAttribute("show")==Names){isFound=true;} 637 } 638 return isFound; 639 } 640 641 642 function setVariantPrice(Names){ 643 VP=document.getElementById("VariantPrice"); 644 VPp=VP.getElementsByClassName("price"); 645 for(i=0;i<VPp.length;i++){ 646 VPp[i].className=VPp[i].className.replace(/ ShowThis/g,""); 647 if(VPp[i].getAttribute("show")==Names){VPp[i].className+=" ShowThis";} 648 } 649 } 650 651 function startVariantPrice(){ 652 ocInputs=document.getElementById("Add2Cart").elements["SelectVariantID"]; 653 654 if (typeof ocInputs !== 'undefined') { 655 656 names=[].map.call(ocInputs,function(input){return input.value;}).join('.') 657 if(@VariantGroupsCnt==1){names=ocInputs.value} 658 document.getElementById("VariantID").value=names; 659 setVariantPrice(names); 660 661 } 662 663 SelList=document.getElementsByName("SelectVariantID"); 664 if(SelList.length>1){ 665 slstr="";slrstr=""; 666 for(i=0;i<SelList.length;i++){ 667 slstr+="."+SelList[i].options[SelList[i].selectedIndex].value;slrstr="."+SelList[i].options[SelList[i].selectedIndex].value+slrstr; 668 } 669 if(VariantPriceFound(slstr.substring(1))){ 670 setVariantPrice(slstr.substring(1)); 671 document.getElementById("VariantID").value=slstr.substring(1); 672 }else if(VariantPriceFound(slrstr.substring(1))){ 673 setVariantPrice(slrstr.substring(1)) 674 document.getElementById("VariantID").value=slrstr.substring(1); 675 } 676 } 677 678 679 } 680 681 startVariantPrice(); 682 683 684 685 686 </script> 687 688 689 690 <link rel="stylesheet" type="text/css" href="/files/Templates/Designs/Fysiodema/slick/slick.css"/> 691 <link rel="stylesheet" type="text/css" href="/files/Templates/Designs/Fysiodema/slick/slick-theme.css"/> 692 <link rel="stylesheet" type="text/css" href="/files/Templates/Designs/Fysiodema/fancybox/jquery.fancybox.min.css"/> 693 694 <script type="text/javascript" src="/files/Templates/Designs/Fysiodema/fancybox/jquery.fancybox.min.js"></script> 695 <script type="text/javascript" src="/files/Templates/Designs/Fysiodema/slick/slick.js"></script> 696 697 698 <script type="text/javascript"> 699 jQuery('.main-image').slick({ 700 slidesToShow: 1, 701 slidesToScroll: 1, 702 arrows: false, 703 swipe: true, 704 fade: true, 705 initialSlide: 0, 706 infinite: true, 707 lazyLoad: 'ondemand', 708 customPaging: 709 function(slider, i) { 710 var imgSrc = $(slider.$slides[i]).find('img').attr('src'); 711 var imgAlt = $(slider.$slides[i]).find('img').attr('alt'); 712 var imgClass = $(slider.$slides[i]).find('img').attr('class'); 713 return $('<img src="' + imgSrc + '" alt="' + imgAlt + '" class="' + imgClass + '"><span></span>'); 714 }, 715 dots: true 716 }) 717 .on('setPosition', function (event, slick) { 718 slick.$slides.css('height', slick.$slideTrack.children('.slick-slide').outerWidth() + 'px'); 719 }); 720 721 722 </script> 723 724 <script type="text/javascript"> 725 function ProductTab(self){ 726 a=self.getAttribute('item'); 727 c=document.getElementById('TabSelect').getElementsByTagName('LI'); 728 for(i=0;i<c.length;i++){if(c[i].getAttribute('item')==a){c[i].className="activ"}else{c[i].className=""}} 729 b=document.getElementById('TabItems').getElementsByClassName('TabItem'); 730 for(i=0;i<b.length;i++){b[i].className="TabItem";if(b[i].id==a){b[i].className+=" ShowThis";}} 731 $('html, body').animate({scrollTop: $("#"+a).offset().top -120},750); 732 } 733 734 </script> 735 736 737 <script type="text/javascript"> 738 var IsUser = ""; 739 740 dataLayer.push({ 741 'ecommerce': { 742 'detail': { 743 'products': [{ 744 'id': '@GetValue("Ecom:Product.ID")', // Product ID (string). 745 'name': '@GetValue("Ecom:Product.Name")', // Product name (string). 746 @if(!string.IsNullOrWhiteSpace(GetString("Ecom:Product.HaveDiscount"))){<text> 747 'price': '@GetDouble("Ecom:Product.Discount.Price.PriceWithVAT.Value").ToString().Replace(",",".")', 748 </text>}else{<text> 749 'price': '@GetDouble("Ecom:Product.Price.PriceWithVAT.Value").ToString().Replace(",",".")', 750 </text>} 751 'category': '@GetValue("Ecom:Group.Name")', // Product category (string). 752 'brand': '@GetString("Ecom:Manufacturer.Name")', // Product brand (string). 753 'list': 'Product Detail'+IsUser, // Product list (string). 754 'position': 1 // Product position (number). 755 }] 756 } 757 } 758 }); 759 760 function GTMAddToCart2(a){ 761 f=document.forms[a.id]; 762 763 764 Fvariant=f.VariantID.value; 765 //Fvariant=f.SelectVariantID.options[f.SelectVariantID.selectedIndex].getAttribute("text"); 766 767 768 Fquantity=f.Quantity.value; 769 770 771 dataLayer.push({ 772 'event': 'ProductAddToCart', 773 'ecommerce': { 774 'add': { // 'add' actionFieldObject measures. 775 'products': [{ // adding a product to a shopping cart. 776 'id': '@GetValue("Ecom:Product.ID")', // Product ID (string). 777 'name': '@GetValue("Ecom:Product.Name")', // Product name (string). 778 @if(!string.IsNullOrWhiteSpace(GetString("Ecom:Product.HaveDiscount"))){<text> 779 'price': '@GetDouble("Ecom:Product.Discount.Price.PriceWithVAT.Value").ToString().Replace(",",".")', 780 </text>}else{<text> 781 'price': '@GetDouble("Ecom:Product.Price.PriceWithVAT.Value").ToString().Replace(",",".")', 782 </text>} 783 'category': '@GetValue("Ecom:Group.Name")', // Product category (string). 784 'brand': '@GetString("Ecom:Manufacturer.Name")', // Product brand (string). 785 'list': 'Product Detail'+IsUser, // Product list (string). 786 'variant': Fvariant, // Product variant (string). 787 'quantity': Fquantity // Product position (number). 788 }] 789 } 790 } 791 }); 792 return true; 793 } 794 </script>