Error executing template "Designs/CapoStarter/eCom/Product/M_Product.cshtml"
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at App_Code.SimilarProducts.GetSimilarProducts(String groupId, String productId)
at CompiledRazorTemplates.Dynamic.RazorEngine_8898cccdecdb4d689c551a854f208c14.Execute() in E:\Website\Sundqvist_DW9V2_PROD\Files\Templates\Designs\CapoStarter\eCom\Product\M_Product.cshtml:line 995
at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.b__0(TextWriter writer)
at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>>
2 @using System.Globalization
3 @using App_Code
4 @using Dynamicweb.Admin
5 @using Dynamicweb.Extensibility
6 @using Dynamicweb.Content
7 @using Newtonsoft.Json;
8 @using Newtonsoft.Json.Linq;
9
10
11 @{
12
13 var loggedIn = HelperClass.IsLoggedIn();
14 var currrencySymbol = GetGlobalValue("Global:eCommerce.Currency.Symbol");
15 var culture = GetGlobalValue("Global:Area.Culture.Name");
16
17 var consumentBuyButton = "consument";
18 var buttonClass = string.Empty;
19 bool NorwegianSite = false;
20
21 if (!loggedIn) { buttonClass = consumentBuyButton; };
22
23 var disallowAddToCart = Convert.ToBoolean(Pageview.Area.Item["Hide_Cart"]);
24 if (disallowAddToCart)
25 {
26
27 NorwegianSite = true;
28 }
29
30 int buyHerePageID = GetPageIdByNavigationTag("BuyHere");
31
32
33 // Triggers getPrices call to ERP system and Price Ex vat
34
35 decimal priceWithOutVat = Convert.ToDecimal(!string.IsNullOrEmpty(GetString("Ecom:Product.Price.PriceWithoutVAT")) ? GetString("Ecom:Product.Price.PriceWithoutVAT") : "0");
36 string priceFormattedWithOutVat = priceWithOutVat.ToString("n", new CultureInfo(GetGlobalValue("Global:Area.Culture.Name"))) + GetGlobalValue("Global:eCommerce.Currency.Symbol");
37
38
39 decimal priceWithVat = Convert.ToDecimal(!string.IsNullOrEmpty(GetString("Ecom:Product.Price.PriceWithVAT")) ? GetString("Ecom:Product.Price.PriceWithVAT") : "0");
40 string priceFormattedWithVat = priceWithVat.ToString("n0", new CultureInfo(GetGlobalValue("Global:Area.Culture.Name"))) + GetGlobalValue("Global:eCommerce.Currency.Symbol");
41
42 // Consumer old price - for campaign price graphics
43 double ConsumerOldPrice = GetDouble("Ecom:Product:Field.OldProductPrice");
44 ConsumerOldPrice = ConsumerOldPrice * 1.25;
45 string ConsumerOldPriceFormatted = ConsumerOldPrice.ToString("n0", new CultureInfo(GetGlobalValue("Global:Area.Culture.Name"))) + GetGlobalValue("Global:eCommerce.Currency.Symbol");
46
47 }
48
49
50 <section class="content productpage">
51 <div class="div-max1170-centered">
52 <div class="productcard">
53 <div class="row">
54 <div class="go-back-button">
55 <button class="btn" onclick="Misc.goBack()">@Translate("productBackButton", "Tillbaka")</button>
56 </div>
57 </div>
58
59 <div class="row">
60 <div class="col-sm-5 col-sm-offset-1">
61 <!-- Left Column -->
62 <div class="productimages-area">
63 <div class="productimages-wrapp">
64 @{
65 bool imgControl = false;
66 bool imgFunctions = false;
67 string disabledState = "";
68 }
69
70 <div class="carousel slide" id="carousel-productimages">
71 <!-- Wrapper for slides -->
72 <div class="carousel-inner">
73 @{
74 var counter = 0;
75
76 string prodnumber = GetString("Ecom:Product.Number").Replace("/", "-");
77
78 var curprodpath = Dynamicweb.Configuration.SystemConfiguration.Instance.GetValue("/Globalsettings/sundqvist/productimagepath") + "/" + prodnumber;
79 var imglist = new List<string>();
80 string[] imgfiles = new string[0];
81
82 var relatedImages1 = GetString("Ecom:Product:Field.relatedImages1.FullPath");
83 var relatedImages2 = GetString("Ecom:Product:Field.relatedImages2.FullPath");
84 var relatedImages3 = GetString("Ecom:Product:Field.relatedImages3.FullPath");
85 var relatedImages4 = GetString("Ecom:Product:Field.relatedImages4.FullPath");
86 var relatedImages5 = GetString("Ecom:Product:Field.relatedImages5.FullPath");
87 try
88 {
89 imgfiles = System.IO.Directory.GetFiles(System.Web.HttpContext.Current.Server.MapPath(curprodpath));
90
91 }
92 catch
93 {
94 <div class="item active">
95 <img src="/Files/Images/NoImageAvailable.png" alt="" class="img-responsive" />
96 </div>
97 }
98 string[] fieldRelatedImages = { @relatedImages1, @relatedImages2, @relatedImages3, @relatedImages4, @relatedImages5 };
99
100 //Check that first found image has list-image pattern productnumber_1.jpg
101 if (!imgfiles.Any(x => x.Contains(prodnumber + "_1.jpg")))
102 {
103
104 <div class="item active">
105 <img src="/Files/Images/NoImageAvailable.png" alt="" class="img-responsive" />
106 </div>
107 }
108 else
109 {
110
111 for (int i = 0; i < imgfiles.Length; i++)
112 {
113 if (!imgfiles[i].EndsWith(".jpg")) { continue; }
114
115 string imgname = System.IO.Path.GetFileName(imgfiles[i]);
116 string fullpath = curprodpath + "/" + imgname;
117 imglist.Add(fullpath);
118
119 var active = (counter == 0 ? "active" : "");
120 <div data-slide-number="@counter" class="item @active" data-hires="/admin/public/getimage.ashx?Image=@fullpath&Format=jpg&Compression=85&width=1900&height=1200&Crop=5&altFmImage_path=/Files/Images/NoImageAvailable.png">
121 <img src="/admin/public/getimage.ashx?Image=@fullpath&Format=jpg&Compression=85&width=400&height=400&Crop=5&altFmImage_path=/Files/Images/NoImageAvailable.png" alt="" title="@imgname" class="img-responsive panzoom-elements" data-original="@fullpath" />
122 </div>
123
124 counter = counter + 1;
125
126 }
127
128 foreach (var url in fieldRelatedImages)
129 {
130 if (!string.IsNullOrEmpty(url))
131 {
132 <div data-slide-number="@counter" class="item " data-hires="/admin/public/getimage.ashx?Image=@url&Format=jpg&Compression=85&width=1900&height=1200&Crop=5&altFmImage_path=/Files/Images/NoImageAvailable.png">
133 <img src="/admin/public/getimage.ashx?Image=@url&Format=jpg&Compression=85&width=400&height=400&Crop=5&altFmImage_path=/Files/Images/NoImageAvailable.png" alt="" title="@url" class="img-responsive panzoom-elements" data-original="@url" />
134 </div>
135
136 counter = counter + 1;
137 }
138 }
139
140 // Only show image functions if there is at least one image
141 if (counter > 0) { imgFunctions = true; }
142
143 // Only show image controls if there is at least two images
144 if (counter > 1) { imgControl = true; }
145
146 }
147
148
149
150 }
151
152 </div>
153
154 @if (imgControl)
155 {
156 <!-- Controls -->
157 <a class="left carousel-control" href="#carousel-productimages" data-slide="prev">
158 <i class="fa fa-angle-left"></i>
159 </a>
160 <a class="right carousel-control" href="#carousel-productimages" data-slide="next">
161 <i class="fa fa-angle-right"></i>
162 </a>
163 }
164 </div>
165
166 @if (imgFunctions)
167 {
168 <div class="img-controls text-right hidden-xs">
169 <a href="javascript:;" id="download" title="@Translate("productImageDownloadLinkText", "Ladda ner högupplöst...")"><i class="fa fa-download"></i></a>
170 <a href="javascript:;" id="y-zoom" title="@Translate("productImageEnlargeLinkText", "Förstora...")"><i class="fa fa-search-plus"></i></a>
171 </div>
172 }
173
174
175 @if (imgControl)
176 {
177
178 var counterThumbs = 0;
179 foreach (var src in imglist)
180 {
181 <div class="carousel-item col-sm-4 hidden-xs">
182 <a id="carousel-selector-@counterThumbs">
183 <img class="img-responsive" src="/admin/public/getimage.ashx?Image=@src&Format=jpg&Compression=80&width=100&height=70&crop=5&altFmImage_path=/Files/Images/NoImageAvailable.png">
184 </a>
185 </div>
186 counterThumbs = counterThumbs + 1;
187 }
188
189 <!--Start RelatedImages thumbs -->
190 foreach (var val in fieldRelatedImages)
191 {
192 var url = val;
193 if (!string.IsNullOrEmpty(url))
194 {
195
196 <div class="carousel-item col-sm-4 hidden-xs">
197 <a id="carousel-selector-@counterThumbs">
198 <img class="img-responsive" src="/admin/public/getimage.ashx?Image=@url&Format=jpg&Compression=80&width=100&height=70&crop=5&altFmImage_path=/Files/Images/NoImageAvailable.png">
199 </a>
200 </div>
201 }
202
203 counterThumbs = counterThumbs + 1;
204 }
205 <!--End RelatedImages thumbs -->
206
207 }
208 </div> <!-- #END carousel area -->
209 <!-- YouTube banner-->
210 @{
211 string youtubeVId = string.Empty; // string.Empty;
212 if (GetString("Ecom:Product:Field.YouTypeLink").Contains("?v="))
213 {
214 var tempArr = GetString("Ecom:Product:Field.YouTypeLink").Split('=');
215 youtubeVId = tempArr[1];
216 }
217 }
218
219 @if (!string.IsNullOrEmpty(youtubeVId))
220 {
221 var videoThumb = "http://img.youtube.com/vi/" + youtubeVId + "/0.jpg";
222 <div class="col-sm-6 col-md-4 youtube-vid hidden-xs">
223 <div class="thumbnail display-box">
224 <a class="y-video" data-video="@GetValue("Ecom:Product:Field.YouTypeLink")" data-toggle="modal" data-target="#videoModal">
225 <div class="display-img img-wrapp">
226 <div class="img-inner youtube product">
227 <img src="@videoThumb" class="img-responsive" alt="...">
228 </div>
229 </div>
230 </a>
231 </div>
232 </div>
233 }
234 </div>
235 </div>
236 <!-- #END Left Column -->
237
238 <div class="product-right col-sm-4 col-sm-offset-1">
239 <!-- Right Column -->
240 <div class="row">
241 <div class="col-sm-12 text-common">
242 <!--Start show brand logo-->
243
244 @{
245
246
247 var myListId = (int)Pageview.Area.Item["BrandList"];
248 var itemList = Dynamicweb.Content.Items.ItemList.GetItemListById(myListId);
249 int count = 0;
250 var loop = itemList.Relations.Cast<Dynamicweb.Content.Items.Item>();
251 string Link = string.Empty;
252
253 foreach (var c in loop)
254 {
255
256 string nameId = "";
257
258 string LogoPath = String.Empty;
259 string LogoSmallPath = String.Empty;
260 string LogoUrl = String.Empty;
261 string Match = GetString("Ecom:Product:Field.productTrademark").ToLower();
262 Link = c["Link"].ToString();
263
264 if (c["NameID"] != null)
265 {
266 nameId = c["NameID"].ToString().ToLower();
267 }
268
269 if (c["Image"] != null)
270 {
271 LogoPath = c["Image"].ToString();
272 }
273
274 if (c["ImageSmall"] != null)
275 {
276 LogoSmallPath = c["ImageSmall"].ToString();
277
278 }
279
280 if (!string.IsNullOrEmpty(LogoSmallPath))
281 {
282
283 LogoUrl = LogoSmallPath;
284
285 }
286
287 else if (!string.IsNullOrEmpty(LogoPath))
288 {
289
290 LogoUrl = LogoPath;
291 }
292
293 if (nameId == Match && !string.IsNullOrEmpty(LogoUrl))
294 {
295
296 <a href="@Link" target="_self" class="logo-container" style="background-image: url('/admin/public/getimage.ashx?Image=@LogoUrl&Format=jpg&Compression=90&height=140&crop=0&altFmImage_path=/Files/Images/NoImageAvailable.png'); background-position-y: bottom; " title="@nameId"></a>
297
298 count++;
299
300 }
301 if (nameId == Match && count == 0)
302 {
303 <a href="@Link" target="_self">
304 <div class="itemBrand" style="height: 30px;padding-top: 12px">@GetString("Ecom:Product:Field.productTrademark")</div>
305 </a>
306 break;
307 }
308
309 }
310
311 }
312
313 <!--End show brand logo -->
314
315 <h1 class="Product-Title">@GetString("Ecom:Product.Name")</h1>
316 <span class="art-nr">Art. Nr: @GetValue("Ecom:Product.Number")</span>
317 @{
318 var descr = GetString("Ecom:Product.LongDescription");
319
320 <div class="lead">
321 @descr
322 </div>
323 }
324
325 <div class="intro-black-collapse print-show collapse" id="viewdetails">
326 </div>
327
328 <a class="pull-left las-mer hidden-print" data-toggle="collapse" data-target="#viewdetails">@Translate("productLongDescriptionReadMore", "Läs mer")<i class="fa fa-angle-right"></i></a>
329 </div>
330 </div>
331
332 <div class="x-print">
333 <!-- well row -->
334 <div class="row well">
335 <div class="col-md-12 no-padding">
336
337 <div class="item-main-info">
338
339 @{
340 var getStockID = GetValue("Ecom:Product.ID").ToString();
341
342 var stock = HelperClass.StockValue(getStockID);
343
344 var stockstatusClass = GetString("Ecom:Product:Stock.DeliveryUnit");
345
346
347 if (stock <= 2)
348 {
349 disabledState = "disabled";
350
351 }
352 }
353
354 @if (!NorwegianSite)
355 {
356 <div class="clearfix">
357 <p class="@stockstatusClass">
358 @Translate("ProductStockStatusText", "Lagerstatus: ")<span>@GetValue("Ecom:Product:Stock.Text")</span>
359 </p>
360 </div>
361 }
362
363 </div>
364
365 <form class="form-inline">
366
367 <div class="item-main-info">
368
369 @if (HelperClass.IsLoggedIn())
370 {
371 // Consumer current price - get from DB price since Product.Price is overwritten by logged in customer price from NAV
372 double ConsumerCurrentPrice = GetDouble("Ecom:Product.DBPrice");
373 ConsumerCurrentPrice = ConsumerCurrentPrice * 1.25;
374 string ConsumerCurrentPriceFormatted = ConsumerCurrentPrice.ToString("0", new CultureInfo(GetGlobalValue("Global:Area.Culture.Name"))) + GetGlobalValue("Global:eCommerce.Currency.Symbol");
375
376
377 <h5>
378 @Translate("priceCustomerLabel", "Ditt pris"): @priceFormattedWithOutVat
379 </h5>
380
381 if (GetBoolean("Ecom:Product:Field.productCampaign") && ConsumerOldPrice > 0)
382 {
383
384 <div class="inline-price"><h6>@Translate("priceConsumerLabel", "Rek. Konsumentpris (inkl moms)"): </h6></div>
385 <div class="inline-price">
386 <h6 class="campaign-price">@ConsumerCurrentPriceFormatted</h6>
387
388 <h6 class="old-price">@ConsumerOldPriceFormatted</h6>
389 </div>
390
391 }
392 else
393 {
394 <div class="inline-price">
395 <h6>@Translate("priceConsumerLabel", "Rek. Konsumentpris (inkl moms)"):</h6>
396 </div>
397 <div class="inline-price">
398 <h6>@ConsumerCurrentPriceFormatted</h6>
399 </div>
400 }
401
402 }
403 else
404 {
405
406 if (GetBoolean("Ecom:Product:Field.productCampaign") && ConsumerOldPrice > 0)
407 {
408 <div class="inline-price">
409 <h5 class="campaign-price">@Translate("priceConsumentLabel", "Pris"): @priceFormattedWithVat</h5>
410
411 <h6 class="old-price">@ConsumerOldPriceFormatted</h6>
412 </div>
413 }
414 else
415 {
416 <h5>
417 @Translate("priceConsumentLabel", "Pris"): @priceFormattedWithVat
418 </h5>
419 }
420 }
421
422 </div>
423
424 @if (HelperClass.IsLoggedIn())
425 {
426 string pricesJSON = GetString("stackedPricesData") + "]"; // Last bracket is sent in NAV response but lost in the string here
427
428 // Override of Stacked prices JSON for easy development/test of rendering
429 //pricesJSON = @"[
430 // {
431 // 'quantity':'4',
432 // 'price':'767.52'
433 // },
434 // {
435 // 'quantity':'10',
436 // 'price':'697.06'
437 // },
438 // {
439 // 'quantity':'100',
440 // 'price':'540.85'
441 // }
442 // ]";
443
444 if (pricesJSON.Length > 3)
445 {
446 try
447 {
448 JArray pricesArray = JArray.Parse(pricesJSON);
449
450 <div class="bracket-price" style="height: 80px;display:block;" data-id="@GetValue("Ecom:Product.Number")">
451 <span style="padding-top: 10px">@Translate("discontPricingTable", "Vid köp av minst: ")</span><br>
452 <table>
453
454 @foreach (dynamic priceLine in pricesArray)
455 {
456 decimal price = Convert.ToDecimal(priceLine.price);
457 string priceFormatted = price.ToString("n", new CultureInfo(GetGlobalValue("Global:Area.Culture.Name"))) + GetGlobalValue("Global:eCommerce.Currency.Symbol");
458
459 <tr>
460 <td class="campaign-price" style="width:50px;">@priceLine.quantity st</td>
461 <td class="campaign-price">@priceFormatted</td>
462 </tr>
463 }
464 </table>
465 </div>
466 }
467 catch
468 {
469 <p class="campaign-price">@Translate("StackedPricesBadDataFormatMessage", "Kontakta oss för information om mängdrabatter.")</p>
470 }
471 }
472
473 }
474
475 @if (!NorwegianSite)
476 {
477 <div class="quantity @disabledState">
478 <input type="number" tabindex="1" class="form-control inline" min="1" value="1" id="antal">
479 <input type="hidden" class="antal-hidden" id="" />
480 </div>
481 }
482
483 @if (!disallowAddToCart)
484 {
485
486 var gtagEvent = HelperClass.IsLoggedIn() ? "ÅF - Köp" : "Konsument - Köp";
487
488 <div class="form-group inline @disabledState ">
489 <button id="btnBuy"
490 onclick="Cart.addToBasket(@GetValue("Ecom:Product:Page.ID"), '@GetValue("Ecom:Product.ID")', '@GetValue("Ecom:Product.Number")', this);gtag('event', '@gtagEvent');"
491 class="btn btn-default @buttonClass" type="button">
492 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
493 <polygon class="st0" points="152.8 42.3 57.1 42.3 36.6 -40.7 18.7 -40.7 18.7 -54.7 47.6 -54.7 68 28.3 143 28.3 160.7 -20.7 64.6 -19.9 64.5 -33.9 180.7 -34.9 " />
494 <path class="st0" d="M77.1 80.6c-11.9 0-21.6-9.7-21.6-21.6 0-11.9 9.7-21.6 21.6-21.6 11.9 0 21.6 9.7 21.6 21.6C98.7 70.9 89 80.6 77.1 80.6zM77.1 51.5c-4.2 0-7.6 3.4-7.6 7.6 0 4.2 3.4 7.6 7.6 7.6 4.2 0 7.6-3.4 7.6-7.6C84.7 54.9 81.3 51.5 77.1 51.5z" />
495 <path class="st0" d="M137.4 80.6c-11.9 0-21.6-9.7-21.6-21.6 0-11.9 9.7-21.6 21.6-21.6S159 47.1 159 59C159 70.9 149.3 80.6 137.4 80.6zM137.4 51.5c-4.2 0-7.6 3.4-7.6 7.6 0 4.2 3.4 7.6 7.6 7.6s7.6-3.4 7.6-7.6C145 54.9 141.6 51.5 137.4 51.5z" />
496 <polygon class="st0" points="124.6 -22.6 97.6 -50.9 75.4 -24.5 64.6 -33.5 96.9 -71.9 134.7 -32.3 " />
497 <polygon class="st0" points="172.6 -23.6 133.4 -52.5 117 -36.8 107.3 -46.9 132.3 -70.7 180.9 -34.8 " />
498 <path d="M19 5.8L19 5.8l-5.4-4 -2 1.9 -1.9-2L6.1 5.9h0l0 1.5 10.7-0.1 -2 5.5H6.5L4.2 3.6H1v1.6h2l2.3 9.2H6c-0.5 0.4-0.9 1.1-0.9 1.9 0 1.3 1.1 2.4 2.4 2.4s2.4-1.1 2.4-2.4c0-0.8-0.3-1.4-0.9-1.9h3.7c-0.5 0.4-0.9 1.1-0.9 1.9 0 1.3 1.1 2.4 2.4 2.4s2.4-1.1 2.4-2.4c0-0.8-0.4-1.4-0.9-1.9h0.2L19 5.8zM8.2 5.9L9.8 4l1.8 1.8L8.2 5.9zM13.7 5.8l-1-1 1-1 2.7 2L13.7 5.8zM7.5 17c-0.5 0-0.8-0.4-0.8-0.8 0-0.5 0.4-0.8 0.8-0.8 0.5 0 0.8 0.4 0.8 0.8C8.3 16.7 7.9 17 7.5 17zM14.2 17c-0.5 0-0.8-0.4-0.8-0.8 0-0.5 0.4-0.8 0.8-0.8 0.5 0 0.8 0.4 0.8 0.8C15 16.7 14.6 17 14.2 17z" />
499 <polygon points="19 5.8 19 5.8 19 5.8 " />
500 </svg>@Translate("productBuyButtonText", "Köp")
501 <i class="fa fa-refresh"></i>
502 </button>
503 </div>
504 }
505 else
506 {
507 <a href="/Default.aspx?ID=@buyHerePageID">
508 <div class="form-group inline ">
509 <button id="btnBuyHere" class="btn btn-buy-simple" type="button">
510 @Translate("productBuyHereButtonText", "Purchase here")
511 </button>
512 </div>
513 </a>
514 }
515
516
517 <div class="form-group inline">
518 @if (!string.IsNullOrEmpty(GetString("Ecom:Product.AddToFavorites")))
519 {
520 string favorite = GetBoolean("Ecom:Product.IsProductInFavoriteList") ? "favorite checked" : "favorite ";
521 <a href="javascript:;" onclick="Product.addToFavorites('?CCAddToMyLists=@GetString("Ecom:Product.ID")&CCAddToListVariantID=&CCAddToListLanguageID=LANG2', this)" class="btn btn-default @favorite " type="button"></a>
522
523 }
524 </div>
525
526 </form>
527 @if (!HelperClass.IsLoggedIn())
528 {
529 if (!NorwegianSite && !GetBoolean("Ecom:Product:Field.productOutlet"))
530 {
531 <div style="margin-top: 3px">
532 @Translate("productBuyHereLinkTextLong", "Purchase from one of our retailers")
533
534 <a href="#" onclick="$('#findStore').modal('show'); gtag('event', 'ÅF - Köp');">
535 @Translate("productBuyHereLinkTextShort", "here")
536 </a>
537 </div>
538 }
539 }
540 @if (!NorwegianSite)
541 {
542 if (stock <= 2)
543 {
544
545 <div id="priceDetails" class=""> <p class="outOfstocInfoText">@Translate("productButtonOutOfStockContactUS", "Varan är slut på lager - vänligen kontakta oss för mer information")</p></div>
546
547 }
548 }
549 </div>
550 <div style="margin-bottom: 15px;" class="visible-sm visible-xs clearfix"></div>
551 </div>
552 </div>
553
554 <div class="clearfix">
555
556 <div class="y-share-tools hidden-print">
557 <!-- AddThis Button BEGIN -->
558 <div class="addthis_toolbox addthis_default_style">
559 <span class="pull-left">@Translate("productShareLinksLabel", "DELA:")</span>
560
561 <a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http://<!--@Global:Request.Host--><!--@Global:Pageview.Url-->"></a>
562
563 <a href="https://twitter.com/share" data-lang="sv" data-count="none" data-dnt="true" target="_blank"></a>
564 <script>!function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https'; if (!d.getElementById(id)) { js = d.createElement(s); js.id = id; js.src = p + '://platform.twitter.com/widgets.js'; fjs.parentNode.insertBefore(js, fjs); } }(document, 'script', 'twitter-wjs');</script>
565
566 <a class="y-share-mail" href="mailto:?subject=Ett länktips&body= Här är en intressant länk http://<!--@Global:Request.Host--><!--@Global:Pageview.Url-->" title="Dela sidan via e-post... "><i class="fa fa-envelope"></i></a>
567
568 </div>
569
570 </div>
571 </div>
572 </div>
573 </div>
574
575 <div class="row">
576
577 <div class="col-md-10 col-md-offset-1 tab-list">
578
579 <ul class="nav nav-pills">
580
581 <li class="active"><a data-toggle="tab" href="#product-description">@Translate("productTabHeaderDescription", "Beskrivning")</a></li>
582
583 <li><a data-toggle="tab" href="#product-tecnical">@Translate("productTabHeaderTechInfo", "Teknisk info")</a></li>
584
585 @if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.guaranteeText")))
586 {
587 <li><a data-toggle="tab" href="#product-warranty">@Translate("productTabHeaderWarrenty", "Garanti")</a></li>
588 }
589 @if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.CareInstructions1")) || !string.IsNullOrEmpty(GetString("Ecom:Product:Field.CareInstructions2")) || !string.IsNullOrEmpty(GetString("Ecom:Product:Field.CareInstructions3")))
590 {
591 <li><a data-toggle="tab" href="#product-care">@Translate("productTabHeaderCare", "Skötsel")</a></li>
592 }
593 @{
594 try
595 {
596 string[] docfiles = System.IO.Directory.GetFiles(System.Web.HttpContext.Current.Server.MapPath(curprodpath + "/docs"));
597
598 if (docfiles.Length > 0)
599 {
600 <li><a data-toggle="tab" href="#product-documents">@Translate("productTabHeaderDocs", "Dokument")</a></li>
601
602 }
603 else
604 {
605 foreach (LoopItem i in GetLoop("Details"))
606 {
607 if (!string.IsNullOrEmpty(@i.GetString("Ecom:Product:Detail.Image.Clean")))
608 {
609
610 <li><a data-toggle="tab" href="#product-documents">@Translate("productTabHeaderDocs", "Dokument")</a></li>
611 break;
612 }
613 }
614
615
616 }
617
618 }
619 catch
620 {
621 foreach (LoopItem i in GetLoop("Details"))
622 {
623
624 if (!string.IsNullOrEmpty(@i.GetString("Ecom:Product:Detail.Image.Clean")))
625 {
626
627 <li><a data-toggle="tab" href="#product-documents">@Translate("productTabHeaderDocs", "Dokument")</a></li>
628 break;
629 }
630 }
631 }
632
633
634 }
635
636
637 </ul>
638
639 <div class="tab-content">
640 <div id="product-description" class="tab-pane fade in active">
641 @GetValue("Ecom:Product:Field.DescriptionLong")
642 </div>
643
644 <div id="product-tecnical" class="tab-pane fade">
645
646 @if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.TechInfo")))
647 {
648 @GetValue("Ecom:Product:Field.TechInfo")
649 }
650
651 <div class="product-tecnical">
652
653 @{
654 if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.productTrademark.Value.Clean")))
655 {
656
657 <div class="left"><label>@Translate("productTecnicalBrand", "Varumärke")</label></div>
658 <div class="right"><span class="tech-details-value">@GetString("Ecom:Product:Field.productTrademark.Value.Clean")</span></div>
659
660 }
661 if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.productSeries.Value.Clean")))
662 {
663
664 <div class="left"><label>@Translate("productTecnicalSeries", "Serie")</label></div>
665 <div class="right"><span class="tech-details-value">@GetString("Ecom:Product:Field.productSeries.Value.Clean")</span></div>
666 }
667 if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.ProductColor.Value.Clean")))
668 {
669
670 <div class="left"><label>@Translate("productTecnicalColor", "Färg")</label></div>
671 <div class="right"><span class="tech-details-value">@GetString("Ecom:Product:Field.ProductColor.Value.Clean")</span></div>
672
673 }
674 if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.productMaterial.Value.Clean")))
675 {
676
677 <div class="left"><label>@Translate("productTecnicalMaterial", "Material")</label></div>
678 <div class="right"><span class="tech-details-value">@GetString("Ecom:Product:Field.productMaterial.Value.Clean")</span></div>
679
680
681 }
682 if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.productSize.Value.Clean")))
683 {
684
685 <div class="left"><label>@Translate("productTecnicalSize", "Storlek")</label></div>
686 <div class="right"><span class="tech-details-value">@GetString("Ecom:Product:Field.productSize.Value.Clean")</span></div>
687 }
688 if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.productsVolume.Value.Clean")))
689 {
690 <div class="left"><label>Volym</label></div>
691 <div class="right"><span class="tech-details-value">@GetString("Ecom:Product:Field.productsVolume.Value.Clean") m³</span></div>
692
693 }
694
695 if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.produktEAN.Value.Clean")))
696 {
697 <div class="left"><label>@Translate("productTecnicalEAN", "EAN")</label></div>
698 <div class="right"><span class="tech-details-value">@GetString("Ecom:Product:Field.produktEAN.Value.Clean")</span></div>
699
700 }
701
702 }
703 </div>
704 </div>
705
706 <div id="product-warranty" class="tab-pane fade">
707 @{
708 string pageId;
709 int id;
710
711 var path = GetString("Ecom:Product:Field.guaranteeText");
712
713 if (!string.IsNullOrEmpty(path))
714 {
715
716 pageId = path.Substring(path.IndexOf('=') + 1);
717
718 if (int.TryParse(pageId, out id))
719 {
720 // Function that renders either pageItem "General_TextEditor" content OR all content from a regular page
721 @GetPageContent(id)
722 }
723
724 }
725
726 }
727
728
729
730 </div>
731
732 <div id="product-care" class="tab-pane fade">
733 @{
734
735 string[] fields = { "Ecom:Product:Field.CareInstructions1", "Ecom:Product:Field.CareInstructions2", "Ecom:Product:Field.CareInstructions3" };
736
737 foreach (var fieldName in fields)
738 {
739 path = GetString(fieldName);
740 if (!string.IsNullOrEmpty(path))
741 {
742
743 pageId = path.Substring(path.IndexOf('=') + 1);
744 id = Int32.Parse(pageId);
745 // Function that renders either pageItem "General_TextEditor" content OR all content from a regular page
746 @GetPageContent(id)
747
748 }
749
750 }
751
752 }
753
754
755
756 </div>
757
758 <div id="product-documents" class="tab-pane fade">
759 <div class="dokument-div">
760 <ul>
761 @{
762 //Documents
763 try
764 {
765 string[] docfiles = System.IO.Directory.GetFiles(System.Web.HttpContext.Current.Server.MapPath(curprodpath + "/docs"));
766
767
768 if (docfiles.Length > 0)
769 {
770
771 for (int i = 0; i < docfiles.Length; i++)
772 {
773 var filename = System.IO.Path.GetFileName(docfiles[i]);
774 string fullpath = curprodpath + "/docs/" + filename;
775
776 <li>
777 <a href="@fullpath" target="_blank">
778 <i class="fa fa-file-text-o"></i> @filename
779 </a>
780 </li>
781
782 }
783
784 }
785 }
786 catch (System.Exception e)
787 {
788
789 }
790
791 foreach (LoopItem i in GetLoop("Details"))
792 {
793 // You can get the details text fields using "Ecom:Product:Detail.Text"
794 if (!string.IsNullOrEmpty(i.GetString("Ecom:Product:Detail.Image.Clean")))
795 {
796 string fullpath = i.GetString("Ecom:Product:Detail.Image.Clean");
797 var filename = fullpath.Split('/').Last();
798 <li>
799 <a href="@fullpath" target="_blank">
800 <i class="fa fa-file-text-o"></i> @filename
801 </a>
802 </li>
803
804 }
805
806 }
807
808 }
809 </ul>
810 </div>
811 </div>
812
813 </div> <!-- #END Table -->
814 <!-- #END prod-list -->
815 </div>
816 </div>
817
818 @* MODAL CODE HAS BEEN MOVED TO \Files\Templates\Designs\CapoStarter\PageProduct.cshtml *@
819
820 </div>
821
822 <div class="row">
823 <div class="div-max1170-centered no-padding">
824 @if (GetLoop("ProductRelatedGroups").Count() > 0)
825 {
826 <div class="col-md-12 prod-list">
827 <!-- Prod-list -->
828
829 <h2 class="data-section-header">@Translate("productHeaderSimilarProducts", "Liknande produkter:")</h2>
830 <div class="row">
831 @foreach (var relatedG in GetLoop("ProductRelatedGroups"))
832 {
833 foreach (var related in relatedG.GetLoop("RelatedProducts"))
834 {
835
836
837 <a href="@related.GetString("Ecom:Product.Link.Clean")">
838
839 <div class="col-xs-12 col-sm-6 col-md-3">
840 <div class="thumbnail dropdown-info">
841 @{
842
843
844 var imgsrc = "/admin/public/getimage.ashx?Image=/Files/Images/productImages/" + related.GetValue("Ecom:Product.Number") + "/" + related.GetValue("Ecom:Product.Number") + "_1.jpg&width=330&height=330&compression=85&Crop=5&Format=jpg&altFmImage_path=/Files/Images/NoImageAvailable.png";
845 <div class="display-img">
846 <img alt="@related.GetValue("Ecom:Product.Name")" src="@imgsrc" data-original="@imgsrc" class="img-responsive lazy">
847 </div>
848
849 }
850
851
852 @if (related.GetString("Ecom:Product.MetaDescription").Length > 156)
853 {
854 @related.GetString("Ecom:Product.MetaDescription").Substring(0, 156)<text>...</text>
855 }
856 else
857 {
858 @related.GetValue("Ecom:Product.MetaDescription")
859 }
860
861
862 <div class="display-name">
863 <div class="name-info">
864
865 <div class="itemBrand">@GetValue("Ecom:Product:Field.productTrademark")</div>
866
867 <div class="itemName">@related.GetString("Ecom:Product.Name")</div>
868 <div class="itemNumber">Art. nr: @related.GetValue("Ecom:Product.Number")</div>
869 <div class="itemPrice" id='id_@related.GetValue("Ecom:Product.Number")'>
870 <b>
871
872 </b>
873
874 @if (related.GetValue("Ecom:Product.Price.Clean") != related.GetValue("Ecom:Product.ActualPrice.Clean"))
875 {
876 <span>(@related.GetValue("Ecom:Product.ActualPrice"))</span>
877 }
878 </div>
879 </div>
880 </div>
881
882 </div>
883 </div>
884 </a>
885 }
886 }
887 </div>
888
889 </div>
890
891 }
892 </div>
893 </div>
894
895 <!--Start Related catagory -->
896 <div class="row related-catagories-hide-if-empty">
897 <div class="div-max1170-centered no-padding">
898 <div class="col-md-12 related-categories">
899 <h2>@Translate("productHeaderRelatedCategories", "Relaterade kategorier:")</h2>
900 <div class="form-group inline">
901
902 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>>
903
904
905 @{
906 var shopID = "SHOP1";
907 var langID = "LANG2";
908 var shop = new Dynamicweb.Ecommerce.Shops.Shop(shopID);
909
910 foreach (var group in shop.get_TopLevelGroups(langID))
911 {
912 @GroupTemplate(group, 0, "", "")
913 }
914
915 }
916
917 @helper GroupTemplate(Dynamicweb.Ecommerce.Products.Group group, int level, string SubID, string Name)
918 {
919
920
921 var subID = SubID;
922 var name = Name;
923
924
925 foreach (LoopItem item in GetLoop("CustomGroupFields"))
926 {
927
928 if (!string.IsNullOrEmpty(item.GetString("related_Product_Catagories")))
929 {
930
931
932 string[] listOfCats = item.GetString("related_Product_Catagories").Split(',');
933
934
935 for (int i = 0; i < listOfCats.Length; i++)
936 {
937 var groupId = listOfCats[i];
938
939 groupId = groupId + "-at-SHOP1";
940
941 if (subID == groupId)
942 {
943
944
945 <a href="Default.aspx?ID=2&GroupID=@groupId" class="btn btn-categories">@name</a>
946 }
947
948 }
949 }
950 }
951
952 if (group.Subgroups.Count > 0)
953 {
954
955 foreach (var subgroup in group.Subgroups)
956 {
957 @GroupTemplate(subgroup, level + 1, subgroup.Id, subgroup.Name)
958
959 }
960
961 }
962
963 }
964
965
966 </div>
967 </div>
968 </div>
969 </div>
970 <!--End Related catagory -->
971 <!--Start Similar products -->
972 <div class="row similar-Products-hide-if-empty">
973 <div class="div-max1170-centered no-padding">
974 <div class="similar-products">
975 <h2>@Translate("productHeaderSimilarProducts", "Liknande produkter:")</h2>
976 <div class="form-group inline">
977 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>>
978 @using System.Activities.Statements
979 @using Dynamicweb.Ecommerce.Products
980 @using System.Globalization
981 @using System.Security.Cryptography
982 @using App_Code
983
984 @*Liknande produkter yta - speciell urvalslogik
985 Dessa ska sökas fram enligt följande logik:
986 Produkter i samma kategori
987 Ta 2 som ligger närmast i pris uppåt
988 Ta 2 som ligger närmast i pris nedåt*@
989
990 @{
991
992 // Get and set values
993 var groupID = GetString("Ecom:Group.ID");
994 var productID = GetString("Ecom:Product.ID");
995 var similarProducts = new SimilarProducts().GetSimilarProducts(groupID, productID);
996
997 if (similarProducts != null)
998 {
999 Dynamicweb.Ecommerce.LiveIntegration.Products.ProductManager.FetchProductInfos(similarProducts);
1000 var simProdStock = 0;
1001
1002 <div class="fixed-height-boxes">
1003
1004
1005 @foreach (var i in similarProducts)
1006 {
1007
1008 <div class="col-md-3">
1009
1010 @{
1011
1012 string productNumberClean = i.Number.Replace("/", "-");
1013 var imgsrc = "/admin/public/getimage.ashx?Image=/Files/Images/ProductImages/" + productNumberClean + "/" + productNumberClean + "_1.jpg&width=250&height=250&compression=85&Crop=5&Format=jpg&altFmImage_path=/Files/Images/NoImageAvailable.png";
1014 var isCampaigne = (Boolean)i.GetProductFieldValue("productCampaign");
1015 var isnews = (Boolean)i.GetProductFieldValue("productNews");
1016 string ProductsPageId = GetPageIdByNavigationTag("ProductsPage").ToString();
1017 string productId = i.Number + "-at-SHOP1";
1018
1019 if (isCampaigne && isnews)
1020 {
1021 <div class="labels">
1022 <button class="btn btn-small btn-danger product-flag campaign">@Translate("product_Campaign_tag", "Campaign")</button>
1023
1024 <button class="btn btn-small btn-default product-flag news">@Translate("product_News_tag", "News")</button>
1025 </div>
1026 }
1027
1028 else if (isnews)
1029 {
1030 <button class="btn btn-small btn-default product-flag news alone">@Translate("product_News_tag", "News")</button>
1031 }
1032
1033 else if (isCampaigne)
1034 {
1035 <button class="btn btn-small btn-danger product-flag campaign alone">@Translate("product_Campaign_tag", "Campaign")</button>
1036 }
1037
1038 }
1039
1040 <div class="thumbnail dropdown-info">
1041 <a href="/Default.aspx?ID=@ProductsPageId&GroupID=@GetValue("Ecom:Product.PrimaryOrFirstGroupID")&ProductID=@i.IdUrlEncoded">
1042 <div class="display-img">
1043 <img alt="@i.Name" src="@imgsrc" data-original="@imgsrc" class="img-responsive lazy">
1044 </div>
1045 <div class="display-name">
1046 <div class="name-info">
1047 <div class="itemBrand">@i.GetProductFieldValue("productTrademark")</div>
1048 <div class="itemName">@i.Name</div>
1049 @if (!string.IsNullOrEmpty(i.GetProductFieldValue("productSeries").ToString()))
1050 {
1051 <div class="itemBrand">@Translate("productListSeriesLabel", "Serie:") @i.GetProductFieldValue("productSeries")</div>
1052 }
1053 <div class="itemNumber">@Translate("productListArticleNrLabel", "Art. nr:") @i.Number</div>
1054 <div class="itemPrice" id='id_@i.Number'>
1055
1056 @if (Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName")))
1057 {
1058
1059 decimal CustomerPrice = Convert.ToDecimal(!string.IsNullOrEmpty(i.Price.PriceWithoutVAT.ToString()) ? i.Price.PriceWithoutVAT.ToString() : "0");
1060 string CustomerPriceFormatted = CustomerPrice.ToString("n", new CultureInfo(GetGlobalValue("Global:Area.Culture.Name"))) + GetGlobalValue("Global:eCommerce.Currency.Symbol");
1061
1062
1063
1064 <span>@CustomerPriceFormatted</span>
1065
1066 }
1067 else
1068 {
1069 decimal ConsumnerPriceWithVat = Convert.ToDecimal(!string.IsNullOrEmpty(i.Price.PriceWithVAT.ToString()) ? i.Price.PriceWithVAT.ToString() : "0");
1070 var ConsumnerPriceWithVatFormatted = ConsumnerPriceWithVat.ToString("n0", new CultureInfo(GetGlobalValue("Global:Area.Culture.Name"))) + GetGlobalValue("Global:eCommerce.Currency.Symbol");
1071
1072 //Campaign price graphics
1073 double ConsumerOldProductPrice = double.Parse(i.GetProductFieldValue("OldProductPrice").ToString(), CultureInfo.InvariantCulture);
1074 ConsumerOldProductPrice = ConsumerOldProductPrice * 1.25;
1075
1076 if (isCampaigne && ConsumerOldProductPrice > 0)
1077 {
1078 string ConsumerOldProductPriceFormatted = ConsumerOldProductPrice.ToString("n0", new CultureInfo(GetGlobalValue("Global:Area.Culture.Name"))) + GetGlobalValue("Global:eCommerce.Currency.Symbol");
1079
1080 <div class="item-main-info campaign-price">
1081 <span class="old-price">@ConsumerOldProductPriceFormatted </span>
1082 <span>@ConsumnerPriceWithVatFormatted </span>
1083 </div>
1084
1085 }
1086 else
1087 {
1088
1089 <div class="itemPrice">
1090
1091 <div class="item-main-info">
1092 <span>@ConsumnerPriceWithVatFormatted</span>
1093 </div>
1094
1095 </div>
1096
1097
1098
1099
1100 }
1101
1102 }
1103 </div>
1104 </div>
1105 </div>
1106 </a>
1107
1108 @if (!disallowAddToCart)
1109 {
1110 string simProdDisabledState = "";
1111 var getSimProductId = productId;
1112
1113 simProdStock = HelperClass.StockValue(getSimProductId);
1114
1115
1116 if (simProdStock <= 2)
1117 {
1118 simProdDisabledState = "disabled card";
1119 }
1120
1121
1122 <form class="form-inline product-card-buy-button @buttonClass @simProdDisabledState ">
1123 <span>
1124 <button id="btnBuy"
1125 onclick="Cart.addToBasket(@ProductsPageId, '@productId', '@productNumberClean', this);gtag('event', 'ÅF - Köp');"
1126 class="btn btn-default @buttonClass" type="button" style="float: right; margin-top: -35px;">
1127 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
1128 <polygon class="st0" points="152.8 42.3 57.1 42.3 36.6 -40.7 18.7 -40.7 18.7 -54.7 47.6 -54.7 68 28.3 143 28.3 160.7 -20.7 64.6 -19.9 64.5 -33.9 180.7 -34.9 " />
1129 <path class="st0" d="M77.1 80.6c-11.9 0-21.6-9.7-21.6-21.6 0-11.9 9.7-21.6 21.6-21.6 11.9 0 21.6 9.7 21.6 21.6C98.7 70.9 89 80.6 77.1 80.6zM77.1 51.5c-4.2 0-7.6 3.4-7.6 7.6 0 4.2 3.4 7.6 7.6 7.6 4.2 0 7.6-3.4 7.6-7.6C84.7 54.9 81.3 51.5 77.1 51.5z" />
1130 <path class="st0" d="M137.4 80.6c-11.9 0-21.6-9.7-21.6-21.6 0-11.9 9.7-21.6 21.6-21.6S159 47.1 159 59C159 70.9 149.3 80.6 137.4 80.6zM137.4 51.5c-4.2 0-7.6 3.4-7.6 7.6 0 4.2 3.4 7.6 7.6 7.6s7.6-3.4 7.6-7.6C145 54.9 141.6 51.5 137.4 51.5z" />
1131 <polygon class="st0" points="124.6 -22.6 97.6 -50.9 75.4 -24.5 64.6 -33.5 96.9 -71.9 134.7 -32.3 " />
1132 <polygon class="st0" points="172.6 -23.6 133.4 -52.5 117 -36.8 107.3 -46.9 132.3 -70.7 180.9 -34.8 " />
1133 <path d="M19 5.8L19 5.8l-5.4-4 -2 1.9 -1.9-2L6.1 5.9h0l0 1.5 10.7-0.1 -2 5.5H6.5L4.2 3.6H1v1.6h2l2.3 9.2H6c-0.5 0.4-0.9 1.1-0.9 1.9 0 1.3 1.1 2.4 2.4 2.4s2.4-1.1 2.4-2.4c0-0.8-0.3-1.4-0.9-1.9h3.7c-0.5 0.4-0.9 1.1-0.9 1.9 0 1.3 1.1 2.4 2.4 2.4s2.4-1.1 2.4-2.4c0-0.8-0.4-1.4-0.9-1.9h0.2L19 5.8zM8.2 5.9L9.8 4l1.8 1.8L8.2 5.9zM13.7 5.8l-1-1 1-1 2.7 2L13.7 5.8zM7.5 17c-0.5 0-0.8-0.4-0.8-0.8 0-0.5 0.4-0.8 0.8-0.8 0.5 0 0.8 0.4 0.8 0.8C8.3 16.7 7.9 17 7.5 17zM14.2 17c-0.5 0-0.8-0.4-0.8-0.8 0-0.5 0.4-0.8 0.8-0.8 0.5 0 0.8 0.4 0.8 0.8C15 16.7 14.6 17 14.2 17z" />
1134 <polygon points="19 5.8 19 5.8 19 5.8 " />
1135 </svg>
1136 @if (loggedIn)
1137 {
1138 @Translate("productBuyButtonText", "Köp");
1139 }
1140 <i class="fa fa-refresh"></i>
1141 </span>
1142 </form>
1143
1144
1145 }
1146
1147 </div>
1148
1149 </div>
1150
1151 }
1152
1153
1154 </div>
1155
1156 }
1157 }
1158
1159
1160
1161 </div>
1162 </div>
1163 </div>
1164 </div>
1165 <!--End Similar products -->
1166
1167 </div>
1168 </section>
1169
1170
1171 @if (imgFunctions)
1172 {
1173 <div class="modal fade y-modalCarousel" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
1174 <div class="modal-dialog">
1175
1176 <button class="close" type="button" data-dismiss="modal">
1177 <i class="fa fa-close"></i>
1178 </button>
1179
1180 <div id="modalCarousel" class="carousel slide">
1181 <div class="carousel-inner">
1182 </div>
1183
1184 @if (imgControl)
1185 {
1186 <a class="left carousel-control" href="#modalCarousel" data-slide="prev">
1187 <i class="fa fa-angle-left"></i>
1188 </a>
1189 <a class="right carousel-control" href="#modalCarousel" data-slide="next">
1190 <i class="fa fa-angle-right"></i>
1191 </a>
1192 }
1193 <span class="cl-area" data-dismiss="modal"></span>
1194 </div>
1195 </div>
1196 </div>
1197 }
1198
1199
1200
1201
1202
1203 @functions {
1204 string GetPageContent(int pageId)
1205 {
1206
1207 try
1208 {
1209 string output = null;
1210
1211 var page = ServiceLocator.Current.GetPageService().GetPage(pageId);
1212
1213 if (!string.IsNullOrEmpty(page.ItemType) && !string.IsNullOrEmpty(page.ItemId))
1214 {
1215 var item = Dynamicweb.Content.Items.Item.GetItemById(page.ItemType, page.ItemId);
1216 output = "<div>" + item["General_TextEditor"] + "</div>";
1217 }
1218 else
1219 {
1220 var contentPageView = Dynamicweb.Frontend.PageView.GetPageviewByPageID(pageId);
1221 output = contentPageView.Output();
1222
1223 // Remove everything but the actual page content
1224 var startTag = "<!--PageContentStart-->";
1225 var endTag = "<!--PageContentEnd-->";
1226 int startIndex = output.IndexOf(startTag) + startTag.Length;
1227 int endIndex = output.IndexOf(endTag, startIndex);
1228 output = output.Substring(startIndex, endIndex - startIndex);
1229 }
1230
1231 return output;
1232 }
1233 catch { }
1234 return null;
1235 }
1236
1237 }
1238
1239 <!-- Modals -->
1240
1241 @using Dynamicweb.Rendering.Translation
1242 @using System;
1243
1244
1245 @{ var LinkText = Translate("retail_search_webshop_button", "Webshop");
1246 //var EAN = GetString("Ecom:Product:Field.produktEAN");
1247
1248 }
1249
1250
1251 @*<input type="hidden" id="EAN" value="@EAN" />*@
1252
1253 <div class="modal fade" id="findStore" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
1254 <div class="modal-dialog" role="document">
1255 <div class="modal-content">
1256 <div class="modal-header">
1257 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
1258 <h1 class="modal-title" id="myModalLabel">@Translate("ProductlistBuy", "Buy")</h1>
1259 </div>
1260 <div class="modal-body col-sm-12">
1261 <div class="col-lg-6 col-md-12 modal-search-form">
1262 <form class="search-form">
1263 <div class="row">
1264 <button type="submit" class="button-primary"><i class="fa fa-search"></i></button>
1265 <input type="text" class="u-full-width search-field" autofocus placeholder="@Translate("reseller_post_number", "Enter postal number")" value="">
1266 </div>
1267 <div class="row address">
1268 <small class="formatted-address"></small>
1269 </div>
1270 </form>
1271 <ul class="search-filter">
1272 @{
1273
1274 var BrandlistListId = (int) Pageview.Area.Item["BrandList"];
1275 var BrandlistItemList = Dynamicweb.Content.Items.ItemList.GetItemListById(BrandlistListId);
1276 var Brandlsloop = BrandlistItemList.Relations.Cast<Dynamicweb.Content.Items.Item>();
1277
1278 foreach (var i in Brandlsloop)
1279 {
1280
1281 string brand = "";
1282 try
1283 {
1284 string nameId = i["NameID"].ToString();
1285
1286
1287 if (!String.IsNullOrEmpty(nameId))
1288 {
1289 brand = nameId;
1290
1291 <li><label for="@brand"><input type="checkbox" id="@brand"><icon class="check"></icon>@brand</label></li>
1292 }
1293
1294 }
1295 catch (Exception ex)
1296 {
1297 Console.WriteLine(ex.ToString());
1298 }
1299
1300
1301 }
1302 }
1303 </ul>
1304 <div class="stores-list"></div>
1305 </div>
1306 <div class="col-lg-6 col-md-12 webshops">
1307 <h2>@Translate("retail_search_webshop", "Online shops")</h2>
1308
1309 <div class="links">
1310 <ul>
1311 @{
1312 var ResellersListId = (int) Pageview.Area.Item["Resellers_List"];
1313 var ResellersItemList = Dynamicweb.Content.Items.ItemList.GetItemListById(ResellersListId);
1314 var Resellersloop = ResellersItemList.Relations.Cast<Dynamicweb.Content.Items.Item>();
1315 string curentBrand = GetString("Ecom:Product:Field.productTrademark");
1316
1317
1318 foreach (var c in Resellersloop)
1319 {
1320 string linkText = c["LinkText"].ToString();
1321 string landinpageLink = String.Empty;
1322 try
1323 {
1324 landinpageLink = c[curentBrand].ToString();
1325 //landinpageLink = c["Chasseur"].ToString();
1326
1327
1328 if (!String.IsNullOrEmpty(landinpageLink))
1329 {
1330
1331 <li>
1332 @linkText
1333 <a href="@landinpageLink" target="_blank" title="@linkText" class="button">@Translate("retail_search_webshop_button", "Webshop")</a>
1334 </li>
1335
1336 }
1337
1338
1339 }
1340 catch (Exception ex)
1341 {
1342
1343 Console.WriteLine(ex.ToString());
1344 }
1345
1346 }
1347
1348 }
1349
1350
1351 </ul>
1352 </div>
1353 </div>
1354 </div>
1355 </div>
1356 </div>
1357 </div>
1358
1359 ;
1360
1361 @{
1362 var hostUrl = GetGlobalValue("Global:Request.Host");
1363 }
1364
1365 @SnippetStart("FacebookOGProductMeta")
1366
1367 <meta property='og:type' content='website' />
1368 <meta property='og:title' content='@GetString("Ecom:Product.Name")' />
1369 <meta property='og:image' content='@GetGlobalValue("Global:Request.Scheme")://@hostUrl/Admin/Public/GetImage.ashx?image=@curprodpath/@GetString("Ecom:Product.Number")_1.jpg&Compression=85&width=400&height=400&Crop=5&altFmImage_path=/Files/Images/NoImageAvailable.png' />
1370 <meta property='og:description' content='@GetString("Ecom:Product:Field.DescriptionLong")'/>
1371 <meta property='og:url' content='@GetGlobalValue("Global:Request.Scheme")://@GetGlobalValue("Global:Request.Host")@GetGlobalValue("Global:Pageview.Url")' />
1372
1373 @SnippetEnd("FacebookOGProductMeta")