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