Error compiling template "Designs/Swift/Paragraph/Swift_ProductListCompactView.cshtml"
Line 2284: A local variable or function named 'price' is already defined in this scope
1 //------------------------------------------------------------------------------
2 // <auto-generated>
3 // This code was generated by a tool.
4 // Runtime Version:4.0.30319.42000
5 //
6 // Changes to this file may cause incorrect behavior and will be lost if
7 // the code is regenerated.
8 // </auto-generated>
9 //------------------------------------------------------------------------------
10
11 namespace CompiledRazorTemplates.Dynamic {
12 using System;
13 using System.Collections.Generic;
14 using System.Linq;
15
16 #line 2 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
17 using Dynamicweb.Ecommerce.ProductCatalog;
18
19 #line default
20 #line hidden
21
22 #line 3 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
23 using Dynamicweb.Ecommerce.CustomerExperienceCenter.Favorites;
24
25 #line default
26 #line hidden
27
28
29 public class RazorEngine_3206c3487eec4315a014f85352f1f322 : Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> {
30
31 #line hidden
32
33 #line 20 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
34 public RazorEngine.Templating.TemplateWriter RenderProductList()
35 {
36 #line default
37 #line hidden
38 return new RazorEngine.Templating.TemplateWriter(__razor_helper_writer => {
39
40 #line 21 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
41
42 ProductListViewModel productList = new ProductListViewModel();
43
44 if (Dynamicweb.Context.Current.Items.Contains("ProductList"))
45 {
46 productList = (ProductListViewModel)Dynamicweb.Context.Current.Items["ProductList"];
47 }
48
49 string anonymousUsersLimitations = Pageview.AreaSettings.GetRawValueString("AnonymousUsers", "");
50 bool anonymousUser = Pageview.User == null;
51 bool hideProductNumber = !string.IsNullOrEmpty(Model.Item.GetString("HideProductNumber")) ? Model.Item.GetBoolean("HideProductNumber") : false;
52 bool hidePrice = anonymousUsersLimitations.Contains("price") && anonymousUser;
53 bool hideAddToCart = !string.IsNullOrEmpty(Model.Item.GetString("HideAddToCart")) ? Model.Item.GetBoolean("HideAddToCart") : false;
54 hideAddToCart = anonymousUsersLimitations.Contains("cart") && anonymousUser ? true : hideAddToCart;
55 bool hideFavoritesSelector = !string.IsNullOrEmpty(Model.Item.GetString("HideFavoritesSelector")) ? Model.Item.GetBoolean("HideFavoritesSelector") : false;
56
57 string listItemLayout = !string.IsNullOrEmpty(Model.Item.GetString("ListItemLayout")) ? Model.Item.GetString("ListItemLayout") : "full";
58
59 string detailsPageLink = Dynamicweb.Context.Current.Items["DetailsPageLink"] != null ? Dynamicweb.Context.Current.Items["DetailsPageLink"].ToString() : "";
60 string productTheme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("ProductTheme")) ? " theme p-3 " + Model.Item.GetRawValueString("ProductTheme").Replace(" ", "").Trim().ToLower() : "";
61 string modalTheme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("ModalTheme")) ? " theme " + Model.Item.GetRawValueString("ModalTheme").Replace(" ", "").Trim().ToLower() : "theme light";
62 string textPadding = !string.IsNullOrEmpty(Model.Item.GetString("ContentPadding")) ? Model.Item.GetRawValueString("ContentPadding") : "none";
63 textPadding = textPadding == "none" ? "" : textPadding;
64 textPadding = textPadding == "small" ? "p-2 p-lg-3" : textPadding;
65
66 string groupId = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString.Get("GroupID")) ? Dynamicweb.Context.Current.Request.QueryString.Get("GroupID") : "";
67 string url = Dynamicweb.Context.Current.Request.RawUrl;
68
69 var badgeParms = new Dictionary<string, object>();
70 badgeParms.Add("saleBadgeType", Model.Item.GetRawValue("SaleBadgeType"));
71 badgeParms.Add("saleBadgeCssClassName", Model.Item.GetRawValue("SaleBadgeDesign"));
72 badgeParms.Add("newBadgeCssClassName", Model.Item.GetRawValue("NewBadgeDesign"));
73 badgeParms.Add("newPublicationDays", Model.Item.GetInt32("NewPublicationDays"));
74 badgeParms.Add("campaignBadgesValues", Model.Item.GetRawValueString("CampaignBadges"));
75
76 var favoriteParameters = new Dictionary<string, object>();
77 if (!anonymousUser && !hideFavoritesSelector)
78 {
79 int defaultFavoriteListId = 0;
80
81 IEnumerable<FavoriteList> favoreiteLists = Pageview.User.GetFavoriteLists();
82 if (favoreiteLists.Count() == 1)
83 {
84 foreach (FavoriteList list in favoreiteLists)
85 {
86 defaultFavoriteListId = list.ListId;
87 }
88 }
89
90 favoriteParameters.Add("ListId", defaultFavoriteListId);
91 }
92
93 if (productList.TotalProductsCount > 0)
94 {
95 int pageSizeSetting = 30;
96 int pageSize = productList.PageSize;
97 pageSize += pageSizeSetting;
98
99 int loadedProducts = productList.PageSize > productList.TotalProductsCount ? productList.TotalProductsCount : productList.PageSize;
100
101 foreach (ProductViewModel product in productList.Products)
102 {
103 var defaultGroupId = product.PrimaryOrDefaultGroup.Id;
104 var selectedDetailPage = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(defaultGroupId)?.Meta.PrimaryPage ?? string.Empty;
105
106 string link = string.IsNullOrEmpty(selectedDetailPage) ? $"{detailsPageLink}&groupid={defaultGroupId}" : selectedDetailPage;
107 link += "&productid=" + product.Id;
108 link += !string.IsNullOrEmpty(product.VariantId) ? "&variantid=" + product.VariantId : "";
109
110 string imagePath = product?.DefaultImage?.Value ?? "";
111 imagePath = Dynamicweb.Context.Current.Server.UrlEncode(imagePath);
112 imagePath = "/Admin/Public/GetImage.ashx?width=" + 48 + "&image=" + imagePath + "&format=webp";
113
114 string ratio = Model.Item.GetRawValueString("ImageAspectRatio", "");
115 ratio = ratio != "0" ? ratio : "";
116 string ratioCssClass = ratio != "" ? " ratio" : "";
117 string ratioVariable = ratio != "" ? "--bs-aspect-ratio: " + ratio : "";
118
119 string imageTheme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("ImageTheme")) ? " theme " + Model.Item.GetRawValueString("ImageTheme").Replace(" ", "").Trim().ToLower() : "";
120 string imageId = "ProductImage_" + product.Id + product.VariantId;
121
122
123
124 #line default
125 #line hidden
126
127 #line 102 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
128
129 var supportedImageFormats = new string[] { ".jpg", ".webp", ".png", ".gif" };
130 string defaultImage = product.DefaultImage != null ? product.DefaultImage.Value : "";
131 var selectedAssetCategories = Model.Item.GetRawValueString("AlternativeImageAssets");
132 IEnumerable<MediaViewModel> alternativeImagesList = product.AssetCategories.Where(x => selectedAssetCategories.Contains(x.SystemName)).SelectMany(x => x.Assets);
133
134 if (alternativeImagesList.FirstOrDefault() != null) {
135 alternativeImagesList = alternativeImagesList.OrderByDescending(x => x.Value.Equals(defaultImage));
136
137 if (alternativeImagesList.First().Value == defaultImage) {
138 alternativeImagesList = alternativeImagesList.Skip(1);
139 }
140 }
141
142 string alternativeImage = alternativeImagesList.FirstOrDefault() != null ? alternativeImagesList.FirstOrDefault().Value : "";
143 alternativeImage = !string.IsNullOrEmpty(alternativeImage) ? "/Admin/Public/GetImage.ashx?width=" + 48 + "&image=" + alternativeImage + "&format=webp" : "";
144
145
146
147 #line default
148 #line hidden
149
150 #line 119 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
151
152 IEnumerable<string> selectedDisplayGroups = Model.Item.GetRawValueString("MainFeatures").Split(',').ToList();
153 List<CategoryFieldViewModel> mainFeatures = new List<CategoryFieldViewModel>();
154
155 foreach (var selection in selectedDisplayGroups)
156 {
157 foreach (CategoryFieldViewModel group in product.FieldDisplayGroups.Values)
158 {
159 if (selection == group.Id)
160 {
161 mainFeatures.Add(group);
162 }
163 }
164 }
165
166
167
168 #line default
169 #line hidden
170 WriteLiteralTo(__razor_helper_writer, "\t\t\t<article");
171
172 WriteAttributeTo(__razor_helper_writer, "class", Tuple.Create(" class=\"", 6778), Tuple.Create("\"", 6826)
173 , Tuple.Create(Tuple.Create("", 6786), Tuple.Create("grid", 6786), true)
174 , Tuple.Create(Tuple.Create(" ", 6790), Tuple.Create("gap-2", 6791), true)
175 , Tuple.Create(Tuple.Create(" ", 6796), Tuple.Create("gap-lg-3", 6797), true)
176 , Tuple.Create(Tuple.Create(" ", 6805), Tuple.Create("mb-3", 6806), true)
177
178 #line 134 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
179 , Tuple.Create(Tuple.Create(" ", 6810), Tuple.Create<System.Object, System.Int32>(productTheme
180
181 #line default
182 #line hidden
183 , 6811), false)
184 );
185
186 WriteLiteralTo(__razor_helper_writer, ">\r\n\t\t\t\t<a");
187
188 WriteAttributeTo(__razor_helper_writer, "href", Tuple.Create(" href=\"", 6836), Tuple.Create("\"", 6848)
189
190 #line 135 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
191 , Tuple.Create(Tuple.Create("", 6843), Tuple.Create<System.Object, System.Int32>(link
192
193 #line default
194 #line hidden
195 , 6843), false)
196 );
197
198 WriteLiteralTo(__razor_helper_writer, " class=\"g-col-12 g-col-lg-8 d-flex text-decoration-none mb-2 mb-lg-0\"");
199
200 WriteLiteralTo(__razor_helper_writer, ">\r\n\r\n");
201
202
203 #line 137 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
204
205
206 #line default
207 #line hidden
208
209 #line 137 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
210 if (!Model.Item.GetBoolean("HideImage"))
211 {
212
213
214 #line default
215 #line hidden
216 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t\t\t<div");
217
218 WriteLiteralTo(__razor_helper_writer, " class=\"d-flex align-items-center me-3\"");
219
220 WriteLiteralTo(__razor_helper_writer, " style=\"min-width: 48px\"");
221
222 WriteLiteralTo(__razor_helper_writer, ">\r\n\t\t\t\t\t\t\t<div");
223
224 WriteAttributeTo(__razor_helper_writer, "class", Tuple.Create(" class=\"", 7066), Tuple.Create("\"", 7092)
225
226 #line 140 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
227 , Tuple.Create(Tuple.Create("", 7074), Tuple.Create<System.Object, System.Int32>(ratioCssClass
228
229 #line default
230 #line hidden
231 , 7074), false)
232 , Tuple.Create(Tuple.Create(" ", 7088), Tuple.Create("m-0", 7089), true)
233 );
234
235 WriteAttributeTo(__razor_helper_writer, "style", Tuple.Create(" style=\"", 7093), Tuple.Create("\"", 7117)
236
237 #line 140 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
238 , Tuple.Create(Tuple.Create("", 7101), Tuple.Create<System.Object, System.Int32>(ratioVariable
239
240 #line default
241 #line hidden
242 , 7101), false)
243 );
244
245 WriteLiteralTo(__razor_helper_writer, ">\r\n\t\t\t\t\t\t\t\t<figure");
246
247 WriteLiteralTo(__razor_helper_writer, " class=\"m-0\"");
248
249 WriteLiteralTo(__razor_helper_writer, ">\r\n\t\t\t\t\t\t\t\t\t<div");
250
251 WriteLiteralTo(__razor_helper_writer, " class=\"d-flex justify-content-center align-items-center h-100 w-100\"");
252
253 WriteLiteralTo(__razor_helper_writer, ">\r\n");
254
255
256 #line 143 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
257
258
259 #line default
260 #line hidden
261
262 #line 143 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
263 if (string.IsNullOrEmpty(alternativeImage)) {
264
265
266 #line default
267 #line hidden
268 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t\t\t\t\t\t\t\t<img");
269
270 WriteAttributeTo(__razor_helper_writer, "src", Tuple.Create(" src=\"", 7310), Tuple.Create("\"", 7326)
271
272 #line 144 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
273 , Tuple.Create(Tuple.Create("", 7316), Tuple.Create<System.Object, System.Int32>(imagePath
274
275 #line default
276 #line hidden
277 , 7316), false)
278 );
279
280 WriteAttributeTo(__razor_helper_writer, "alt", Tuple.Create(" alt=\"", 7327), Tuple.Create("\"", 7346)
281
282 #line 144 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
283 , Tuple.Create(Tuple.Create("", 7333), Tuple.Create<System.Object, System.Int32>(product.Name
284
285 #line default
286 #line hidden
287 , 7333), false)
288 );
289
290 WriteLiteralTo(__razor_helper_writer, " class=\"mw-100 mh-100\"");
291
292 WriteLiteralTo(__razor_helper_writer, " loading=\"lazy\"");
293
294 WriteLiteralTo(__razor_helper_writer, " style=\"object-fit: cover;\"");
295
296 WriteLiteralTo(__razor_helper_writer, " />\r\n");
297
298
299 #line 145 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
300 } else {
301
302
303 #line default
304 #line hidden
305 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t\t\t\t\t\t\t\t<img");
306
307 WriteAttributeTo(__razor_helper_writer, "src", Tuple.Create(" src=\"", 7452), Tuple.Create("\"", 7468)
308
309 #line 146 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
310 , Tuple.Create(Tuple.Create("", 7458), Tuple.Create<System.Object, System.Int32>(imagePath
311
312 #line default
313 #line hidden
314 , 7458), false)
315 );
316
317 WriteAttributeTo(__razor_helper_writer, "onmouseover", Tuple.Create(" onmouseover=\"", 7469), Tuple.Create("\"", 7511)
318 , Tuple.Create(Tuple.Create("", 7483), Tuple.Create("this.src=\'", 7483), true)
319
320 #line 146 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
321 , Tuple.Create(Tuple.Create("", 7493), Tuple.Create<System.Object, System.Int32>(alternativeImage
322
323 #line default
324 #line hidden
325 , 7493), false)
326 , Tuple.Create(Tuple.Create("", 7510), Tuple.Create("\'", 7510), true)
327 );
328
329 WriteAttributeTo(__razor_helper_writer, "onmouseout", Tuple.Create(" onmouseout=\"", 7512), Tuple.Create("\"", 7546)
330 , Tuple.Create(Tuple.Create("", 7525), Tuple.Create("this.src=\'", 7525), true)
331
332 #line 146 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
333 , Tuple.Create(Tuple.Create("", 7535), Tuple.Create<System.Object, System.Int32>(imagePath
334
335 #line default
336 #line hidden
337 , 7535), false)
338 , Tuple.Create(Tuple.Create("", 7545), Tuple.Create("\'", 7545), true)
339 );
340
341 WriteAttributeTo(__razor_helper_writer, "alt", Tuple.Create(" alt=\"", 7547), Tuple.Create("\"", 7566)
342
343 #line 146 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
344 , Tuple.Create(Tuple.Create("", 7553), Tuple.Create<System.Object, System.Int32>(product.Name
345
346 #line default
347 #line hidden
348 , 7553), false)
349 );
350
351 WriteLiteralTo(__razor_helper_writer, " class=\"mw-100 mh-100\"");
352
353 WriteLiteralTo(__razor_helper_writer, " loading=\"lazy\"");
354
355 WriteLiteralTo(__razor_helper_writer, " style=\"object-fit: cover;\"");
356
357 WriteLiteralTo(__razor_helper_writer, " />\r\n");
358
359
360 #line 147 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
361 }
362
363
364 #line default
365 #line hidden
366 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t</figure>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</div>\r\n");
367
368
369 #line 152 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
370 }
371
372
373 #line default
374 #line hidden
375 WriteLiteralTo(__razor_helper_writer, "\r\n\t\t\t\t\t<div");
376
377 WriteLiteralTo(__razor_helper_writer, " class=\"grid gap-1 flex-fill\"");
378
379 WriteLiteralTo(__razor_helper_writer, ">\r\n\t\t\t\t\t\t<div");
380
381 WriteLiteralTo(__razor_helper_writer, " class=\"g-col-12 g-col-lg-6\"");
382
383 WriteLiteralTo(__razor_helper_writer, ">\r\n\t\t\t\t\t\t\t<h3");
384
385 WriteLiteralTo(__razor_helper_writer, " class=\"h6 mb-0\"");
386
387 WriteLiteralTo(__razor_helper_writer, ">");
388
389
390 #line 156 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
391 WriteTo(__razor_helper_writer, product.Name);
392
393
394 #line default
395 #line hidden
396 WriteLiteralTo(__razor_helper_writer, " ");
397
398
399 #line 156 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
400 if (!string.IsNullOrEmpty(product.VariantName)) {
401
402 #line default
403 #line hidden
404 WriteLiteralTo(__razor_helper_writer, " ");
405
406 WriteLiteralTo(__razor_helper_writer, "(");
407
408
409 #line 156 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
410 WriteTo(__razor_helper_writer, product.VariantName);
411
412
413 #line default
414 #line hidden
415 WriteLiteralTo(__razor_helper_writer, ")");
416
417 WriteLiteralTo(__razor_helper_writer, " ");
418
419
420 #line 156 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
421 }
422
423 #line default
424 #line hidden
425 WriteLiteralTo(__razor_helper_writer, "</h3> \r\n\r\n");
426
427
428 #line 158 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
429
430
431 #line default
432 #line hidden
433
434 #line 158 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
435 if (!hideProductNumber) {
436
437
438 #line default
439 #line hidden
440 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t\t\t\t\t<div");
441
442 WriteLiteralTo(__razor_helper_writer, " class=\"fs-7 opacity-75\"");
443
444 WriteLiteralTo(__razor_helper_writer, ">");
445
446
447 #line 159 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
448 WriteTo(__razor_helper_writer, product.Number);
449
450
451 #line default
452 #line hidden
453 WriteLiteralTo(__razor_helper_writer, "</div>\r\n");
454
455
456 #line 160 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
457 }
458
459
460 #line default
461 #line hidden
462 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t\t\t\t");
463
464
465 #line 161 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
466 if (!Model.Item.GetBoolean("HideStockState"))
467 {
468
469
470 #line default
471 #line hidden
472 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t\t\t\t\t<div");
473
474 WriteLiteralTo(__razor_helper_writer, " class=\"g-col-12 fs-7 d-block d-lg-none\"");
475
476 WriteLiteralTo(__razor_helper_writer, ">\r\n");
477
478 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t\t\t\t\t\t");
479
480
481 #line 164 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
482 WriteTo(__razor_helper_writer, RenderStockState(product));
483
484
485 #line default
486 #line hidden
487 WriteLiteralTo(__razor_helper_writer, "\r\n\t\t\t\t\t\t\t\t</div>\r\n");
488
489
490 #line 166 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
491 }
492
493
494 #line default
495 #line hidden
496 WriteLiteralTo(__razor_helper_writer, "\r\n");
497
498 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t\t\t\t");
499
500
501 #line 168 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
502 WriteTo(__razor_helper_writer, RenderPartial("Components/EcommerceBadge.cshtml", product, badgeParms));
503
504
505 #line default
506 #line hidden
507 WriteLiteralTo(__razor_helper_writer, "\r\n\t\t\t\t\t\t</div>\r\n");
508
509
510 #line 170 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
511
512
513 #line default
514 #line hidden
515
516 #line 170 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
517 if (selectedDisplayGroups.Count() > 0)
518 {
519
520
521 #line default
522 #line hidden
523 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t\t\t\t<div");
524
525 WriteLiteralTo(__razor_helper_writer, " class=\"g-col-12 g-col-lg-4\"");
526
527 WriteLiteralTo(__razor_helper_writer, ">\r\n");
528
529 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t\t\t\t\t");
530
531
532 #line 173 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
533 WriteTo(__razor_helper_writer, RenderMainFeatures(mainFeatures));
534
535
536 #line default
537 #line hidden
538 WriteLiteralTo(__razor_helper_writer, "\r\n\t\t\t\t\t\t\t</div>\r\n");
539
540
541 #line 175 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
542 }
543
544
545 #line default
546 #line hidden
547 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t\t\t");
548
549
550 #line 176 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
551 if (!Model.Item.GetBoolean("HideStockState"))
552 {
553
554
555 #line default
556 #line hidden
557 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t\t\t\t<div");
558
559 WriteLiteralTo(__razor_helper_writer, " class=\"g-col-12 g-col-lg-2 text-end align-self-center d-none d-lg-block\"");
560
561 WriteLiteralTo(__razor_helper_writer, ">\r\n");
562
563 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t\t\t\t\t");
564
565
566 #line 179 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
567 WriteTo(__razor_helper_writer, RenderStockState(product));
568
569
570 #line default
571 #line hidden
572 WriteLiteralTo(__razor_helper_writer, "\r\n\t\t\t\t\t\t\t</div>\r\n");
573
574
575 #line 181 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
576 }
577
578
579 #line default
580 #line hidden
581 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t\t</div>\r\n\t\t\t\t</a>\r\n\r\n\t\t\t\t<div");
582
583 WriteLiteralTo(__razor_helper_writer, " class=\"g-col-12 g-col-lg-4 d-flex justify-content-end\"");
584
585 WriteLiteralTo(__razor_helper_writer, ">\r\n");
586
587
588 #line 186 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
589
590
591 #line default
592 #line hidden
593
594 #line 186 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
595 if (!hidePrice)
596 {
597
598
599 #line default
600 #line hidden
601 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t\t\t<div");
602
603 WriteLiteralTo(__razor_helper_writer, " class=\"me-3 my-auto\"");
604
605 WriteLiteralTo(__razor_helper_writer, ">\r\n");
606
607 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t\t\t\t");
608
609
610 #line 189 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
611 WriteTo(__razor_helper_writer, RenderPrice(product));
612
613
614 #line default
615 #line hidden
616 WriteLiteralTo(__razor_helper_writer, "\r\n\t\t\t\t\t\t</div>\r\n");
617
618
619 #line 191 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
620 }
621
622
623 #line default
624 #line hidden
625 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t\t");
626
627
628 #line 192 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
629 if (!anonymousUser && !hideFavoritesSelector && product.VariantInfo.VariantInfo == null)
630 {
631
632
633 #line default
634 #line hidden
635
636 #line 194 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
637 WriteTo(__razor_helper_writer, RenderPartial("Components/ToggleFavorite.cshtml", product, favoriteParameters));
638
639
640 #line default
641 #line hidden
642
643 #line 194 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
644
645 }
646
647
648 #line default
649 #line hidden
650 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t\t");
651
652
653 #line 196 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
654 WriteTo(__razor_helper_writer, RenderAddToCart(product));
655
656
657 #line default
658 #line hidden
659 WriteLiteralTo(__razor_helper_writer, "\r\n\t\t\t\t</div>\r\n\t\t\t</article>\r\n");
660
661
662 #line 199 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
663 }
664
665
666
667 #line default
668 #line hidden
669 WriteLiteralTo(__razor_helper_writer, "\t\t<div");
670
671 WriteLiteralTo(__razor_helper_writer, " class=\"my-3\"");
672
673 WriteLiteralTo(__razor_helper_writer, ">\r\n\t\t\t<div");
674
675 WriteLiteralTo(__razor_helper_writer, " class=\"text-center d-flex flex-column gap-3\"");
676
677 WriteLiteralTo(__razor_helper_writer, ">\r\n\t\t\t\t<div");
678
679 WriteLiteralTo(__razor_helper_writer, " class=\"opacity-85\"");
680
681 WriteLiteralTo(__razor_helper_writer, ">");
682
683
684 #line 203 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
685 WriteTo(__razor_helper_writer, loadedProducts);
686
687
688 #line default
689 #line hidden
690 WriteLiteralTo(__razor_helper_writer, " ");
691
692
693 #line 203 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
694 WriteTo(__razor_helper_writer, Translate("out of"));
695
696
697 #line default
698 #line hidden
699 WriteLiteralTo(__razor_helper_writer, " ");
700
701
702 #line 203 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
703 WriteTo(__razor_helper_writer, productList.TotalProductsCount);
704
705
706 #line default
707 #line hidden
708 WriteLiteralTo(__razor_helper_writer, " ");
709
710
711 #line 203 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
712 WriteTo(__razor_helper_writer, Translate("products"));
713
714
715 #line default
716 #line hidden
717 WriteLiteralTo(__razor_helper_writer, "</div>\r\n");
718
719
720 #line 204 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
721
722
723 #line default
724 #line hidden
725
726 #line 204 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
727 if (productList.PageCount != 1)
728 {
729 string sortBySelection = Dynamicweb.Context.Current.Request?.Form["SortBy"] ?? "NameForSort";
730 sortBySelection = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString.Get("SortBy")) ? Dynamicweb.Context.Current.Request.QueryString.Get("SortBy") : sortBySelection;
731
732
733
734 #line default
735 #line hidden
736 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t\t<form");
737
738 WriteLiteralTo(__razor_helper_writer, " method=\"get\"");
739
740 WriteAttributeTo(__razor_helper_writer, "action", Tuple.Create(" action=\"", 9741), Tuple.Create("\"", 9754)
741
742 #line 209 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
743 , Tuple.Create(Tuple.Create("", 9750), Tuple.Create<System.Object, System.Int32>(url
744
745 #line default
746 #line hidden
747 , 9750), false)
748 );
749
750 WriteLiteralTo(__razor_helper_writer, " data-response-target-element=\"content\"");
751
752 WriteLiteralTo(__razor_helper_writer, " class=\"w-100\"");
753
754 WriteLiteralTo(__razor_helper_writer, ">\r\n");
755
756
757 #line 210 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
758
759
760 #line default
761 #line hidden
762
763 #line 210 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
764 foreach (FacetGroupViewModel facetGroup in productList.FacetGroups)
765 {
766 foreach (FacetViewModel facetItem in facetGroup.Facets)
767 {
768 foreach (FacetOptionViewModel facetOption in facetItem.Options)
769 {
770 if (facetOption.Selected)
771 {
772
773
774 #line default
775 #line hidden
776 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t\t\t\t\t\t\t<input");
777
778 WriteLiteralTo(__razor_helper_writer, " type=\"hidden\"");
779
780 WriteAttributeTo(__razor_helper_writer, "name", Tuple.Create(" name=\"", 10132), Tuple.Create("\"", 10164)
781
782 #line 218 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
783 , Tuple.Create(Tuple.Create("", 10139), Tuple.Create<System.Object, System.Int32>(facetItem.QueryParameter
784
785 #line default
786 #line hidden
787 , 10139), false)
788 );
789
790 WriteAttributeTo(__razor_helper_writer, "value", Tuple.Create(" value=\"", 10165), Tuple.Create("\"", 10193)
791 , Tuple.Create(Tuple.Create("", 10173), Tuple.Create("[", 10173), true)
792
793 #line 218 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
794 , Tuple.Create(Tuple.Create("", 10174), Tuple.Create<System.Object, System.Int32>(facetOption.Value
795
796 #line default
797 #line hidden
798 , 10174), false)
799 , Tuple.Create(Tuple.Create("", 10192), Tuple.Create("]", 10192), true)
800 );
801
802 WriteLiteralTo(__razor_helper_writer, " />\r\n");
803
804
805 #line 219 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
806 }
807 }
808 }
809 }
810
811
812 #line default
813 #line hidden
814 WriteLiteralTo(__razor_helper_writer, "\r\n");
815
816
817 #line 224 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
818
819
820 #line default
821 #line hidden
822
823 #line 224 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
824 if (productList?.Group?.Id != null)
825 {
826
827
828 #line default
829 #line hidden
830 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t\t\t\t<input");
831
832 WriteLiteralTo(__razor_helper_writer, " type=\"hidden\"");
833
834 WriteLiteralTo(__razor_helper_writer, " name=\"GroupId\"");
835
836 WriteAttributeTo(__razor_helper_writer, "value", Tuple.Create(" value=\"", 10338), Tuple.Create("\"", 10367)
837
838 #line 226 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
839 , Tuple.Create(Tuple.Create("", 10346), Tuple.Create<System.Object, System.Int32>(productList.Group.Id
840
841 #line default
842 #line hidden
843 , 10346), false)
844 );
845
846 WriteLiteralTo(__razor_helper_writer, " />\r\n");
847
848
849 #line 227 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
850 }
851
852
853 #line default
854 #line hidden
855 WriteLiteralTo(__razor_helper_writer, "\r\n\t\t\t\t\t\t<input");
856
857 WriteLiteralTo(__razor_helper_writer, " type=\"hidden\"");
858
859 WriteLiteralTo(__razor_helper_writer, " name=\"PageSize\"");
860
861 WriteAttributeTo(__razor_helper_writer, "value", Tuple.Create(" value=\"", 10426), Tuple.Create("\"", 10443)
862
863 #line 229 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
864 , Tuple.Create(Tuple.Create("", 10434), Tuple.Create<System.Object, System.Int32>(pageSize
865
866 #line default
867 #line hidden
868 , 10434), false)
869 );
870
871 WriteLiteralTo(__razor_helper_writer, " />\r\n\t\t\t\t\t\t<input");
872
873 WriteLiteralTo(__razor_helper_writer, " type=\"hidden\"");
874
875 WriteLiteralTo(__razor_helper_writer, " name=\"SortBy\"");
876
877 WriteAttributeTo(__razor_helper_writer, "value", Tuple.Create(" value=\"", 10489), Tuple.Create("\"", 10513)
878
879 #line 230 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
880 , Tuple.Create(Tuple.Create("", 10497), Tuple.Create<System.Object, System.Int32>(sortBySelection
881
882 #line default
883 #line hidden
884 , 10497), false)
885 );
886
887 WriteLiteralTo(__razor_helper_writer, " />\r\n\t\t\t\t\t\t<input");
888
889 WriteLiteralTo(__razor_helper_writer, " type=\"hidden\"");
890
891 WriteLiteralTo(__razor_helper_writer, " name=\"RequestType\"");
892
893 WriteLiteralTo(__razor_helper_writer, " value=\"UpdateList\"");
894
895 WriteLiteralTo(__razor_helper_writer, " />\r\n\r\n\t\t\t\t\t\t<button");
896
897 WriteLiteralTo(__razor_helper_writer, " class=\"btn btn-primary\"");
898
899 WriteLiteralTo(__razor_helper_writer, " type=\"button\"");
900
901 WriteLiteralTo(__razor_helper_writer, " onclick=\"swift.ProductList.Update(event)\"");
902
903 WriteLiteralTo(__razor_helper_writer, ">");
904
905
906 #line 233 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
907 WriteTo(__razor_helper_writer, Translate("Load more products"));
908
909
910 #line default
911 #line hidden
912 WriteLiteralTo(__razor_helper_writer, "</button>\r\n\t\t\t\t\t</form>\r\n");
913
914
915 #line 235 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
916 }
917
918
919 #line default
920 #line hidden
921 WriteLiteralTo(__razor_helper_writer, "\t\t\t</div>\r\n\t\t</div>\r\n");
922
923
924 #line 238 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
925
926 if (!hideAddToCart)
927 {
928
929
930 #line default
931 #line hidden
932 WriteLiteralTo(__razor_helper_writer, "\t\t\t<div");
933
934 WriteLiteralTo(__razor_helper_writer, " class=\"modal fade js-product\"");
935
936 WriteAttributeTo(__razor_helper_writer, "id", Tuple.Create(" id=\"", 10836), Tuple.Create("\"", 10871)
937 , Tuple.Create(Tuple.Create("", 10841), Tuple.Create("VariantSelectorModal_", 10841), true)
938
939 #line 241 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
940 , Tuple.Create(Tuple.Create("", 10862), Tuple.Create<System.Object, System.Int32>(Model.ID
941
942 #line default
943 #line hidden
944 , 10862), false)
945 );
946
947 WriteLiteralTo(__razor_helper_writer, " tabindex=\"-1\"");
948
949 WriteLiteralTo(__razor_helper_writer, " aria-hidden=\"true\"");
950
951 WriteLiteralTo(__razor_helper_writer, ">\r\n\t\t\t\t<div");
952
953 WriteLiteralTo(__razor_helper_writer, " class=\"modal-dialog modal-dialog-centered modal-md\"");
954
955 WriteLiteralTo(__razor_helper_writer, ">\r\n\t\t\t\t\t<div");
956
957 WriteAttributeTo(__razor_helper_writer, "class", Tuple.Create(" class=\"", 10980), Tuple.Create("\"", 11013)
958 , Tuple.Create(Tuple.Create("", 10988), Tuple.Create("modal-content", 10988), true)
959
960 #line 243 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
961 , Tuple.Create(Tuple.Create(" ", 11001), Tuple.Create<System.Object, System.Int32>(modalTheme
962
963 #line default
964 #line hidden
965 , 11002), false)
966 );
967
968 WriteAttributeTo(__razor_helper_writer, "id", Tuple.Create(" id=\"", 11014), Tuple.Create("\"", 11056)
969 , Tuple.Create(Tuple.Create("", 11019), Tuple.Create("VariantSelectorModalContent_", 11019), true)
970
971 #line 243 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
972 , Tuple.Create(Tuple.Create("", 11047), Tuple.Create<System.Object, System.Int32>(Model.ID
973
974 #line default
975 #line hidden
976 , 11047), false)
977 );
978
979 WriteLiteralTo(__razor_helper_writer, ">\r\n\t\t\t\t\t\t");
980
981 WriteLiteralTo(__razor_helper_writer, "\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n");
982
983
984 #line 248 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
985 }
986
987 } else {
988 if (!Pageview.IsVisualEditorMode) {
989
990
991 #line default
992 #line hidden
993 WriteLiteralTo(__razor_helper_writer, "<div");
994
995 WriteLiteralTo(__razor_helper_writer, " class=\"alert alert-dark m-0\"");
996
997 WriteLiteralTo(__razor_helper_writer, ">\r\n");
998
999 WriteLiteralTo(__razor_helper_writer, "\t");
1000
1001
1002 #line 253 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1003 WriteTo(__razor_helper_writer, Translate("We did not find anything matching your search result"));
1004
1005
1006 #line default
1007 #line hidden
1008 WriteLiteralTo(__razor_helper_writer, "\r\n</div>\r\n");
1009
1010
1011 #line 255 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1012 } else {
1013
1014
1015 #line default
1016 #line hidden
1017 WriteLiteralTo(__razor_helper_writer, "<div");
1018
1019 WriteLiteralTo(__razor_helper_writer, " class=\"alert alert-dark m-0\"");
1020
1021 WriteLiteralTo(__razor_helper_writer, " role=\"alert\"");
1022
1023 WriteLiteralTo(__razor_helper_writer, ">\r\n\t<span>");
1024
1025
1026 #line 257 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1027 WriteTo(__razor_helper_writer, Translate("Product list: The list will be shown here, if any"));
1028
1029
1030 #line default
1031 #line hidden
1032 WriteLiteralTo(__razor_helper_writer, "</span>\r\n</div>\r\n");
1033
1034
1035 #line 259 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1036 }
1037 }
1038
1039
1040 #line default
1041 #line hidden
1042 });
1043
1044 #line 261 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1045 }
1046 #line default
1047 #line hidden
1048
1049
1050 #line 263 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1051 public RazorEngine.Templating.TemplateWriter RenderMainFeatures(List<CategoryFieldViewModel> mainFeatures)
1052 {
1053 #line default
1054 #line hidden
1055 return new RazorEngine.Templating.TemplateWriter(__razor_helper_writer => {
1056
1057 #line 264 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1058
1059 if (mainFeatures.Count > 0)
1060 {
1061 string featuresLayout = Model.Item.GetRawValueString("FeaturesLayout", "bullets");
1062
1063 if (featuresLayout == "bullets")
1064 {
1065
1066
1067 #line default
1068 #line hidden
1069 WriteLiteralTo(__razor_helper_writer, "\t\t\t<ul");
1070
1071 WriteLiteralTo(__razor_helper_writer, " class=\"m-0 p-0 lh-1 fs-7 opacity-75\"");
1072
1073 WriteLiteralTo(__razor_helper_writer, " style=\"list-style-position: inside\"");
1074
1075 WriteLiteralTo(__razor_helper_writer, ">\r\n");
1076
1077
1078 #line 272 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1079
1080
1081 #line default
1082 #line hidden
1083
1084 #line 272 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1085 foreach (CategoryFieldViewModel mainFeatureGroup in mainFeatures)
1086 {
1087 foreach (var field in mainFeatureGroup.Fields)
1088 {
1089
1090
1091 #line default
1092 #line hidden
1093
1094 #line 276 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1095 WriteTo(__razor_helper_writer, RenderField(field.Value));
1096
1097
1098 #line default
1099 #line hidden
1100
1101 #line 276 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1102
1103 }
1104 }
1105
1106
1107 #line default
1108 #line hidden
1109 WriteLiteralTo(__razor_helper_writer, "\t\t\t</ul>\r\n");
1110
1111
1112 #line 280 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1113 }
1114 else
1115 {
1116 List<string> featuresList = new List<string>();
1117 foreach (CategoryFieldViewModel mainFeatureGroup in mainFeatures)
1118 {
1119 foreach (var field in mainFeatureGroup.Fields)
1120 {
1121 if (field.Value.Value.GetType() == typeof(System.Collections.Generic.List<FieldOptionValueViewModel>))
1122 {
1123 List<string> options = new List<string>();
1124 foreach (FieldOptionValueViewModel option in field.Value.Value as System.Collections.Generic.List<FieldOptionValueViewModel>)
1125 {
1126 if (!string.IsNullOrWhiteSpace(option.Value))
1127 {
1128 if (option.Value.ToString().Contains("#") && (Translate(field.Value.Name) == Translate("Color") || Translate(field.Value.Name) == Translate("Colour")))
1129 {
1130 string colorSpan = "<span class=\"colorbox-sm\" style=\"background-color: " + option.Value + "\"></span>";
1131 options.Add(colorSpan);
1132 }
1133 else
1134 {
1135 options.Add(option.Name);
1136 }
1137 }
1138 }
1139 string optionsString = (string.Join(", ", options.Select(x => x.ToString()).ToArray()));
1140 if ((Translate(field.Value.Name) == Translate("Color") || Translate(field.Value.Name) == Translate("Colour")))
1141 {
1142 optionsString = (string.Join(" ", options.Select(x => x.ToString()).ToArray()));
1143 }
1144 featuresList.Add(field.Value.Name + ": " + optionsString);
1145 }
1146 else
1147 {
1148 if (!string.IsNullOrWhiteSpace(field.Value.Value.ToString()))
1149 {
1150 if (field.Value.Value.ToString().Contains("#") && (Translate(field.Value.Name) == Translate("Color") || Translate(field.Value.Name) == Translate("Colour")))
1151 {
1152 string colorSpan = "<span class=\"colorbox-sm\" style=\"background-color: " + field.Value.Value + "\"></span>";
1153 featuresList.Add(field.Value.Name + ": " + colorSpan);
1154 }
1155 else
1156 {
1157 featuresList.Add(field.Value.Name + ": " + field.Value.Value.ToString());
1158 }
1159 }
1160 }
1161 }
1162 }
1163 string featuresString = (string.Join(", ", featuresList.Select(x => x.ToString()).ToArray()));
1164
1165
1166
1167 #line default
1168 #line hidden
1169 WriteLiteralTo(__razor_helper_writer, "\t\t\t<div");
1170
1171 WriteLiteralTo(__razor_helper_writer, " class=\"opacity-75 fs-7\"");
1172
1173 WriteLiteralTo(__razor_helper_writer, ">");
1174
1175
1176 #line 332 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1177 WriteTo(__razor_helper_writer, featuresString);
1178
1179
1180 #line default
1181 #line hidden
1182 WriteLiteralTo(__razor_helper_writer, "</div>\r\n");
1183
1184
1185 #line 333 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1186 }
1187 }
1188
1189
1190 #line default
1191 #line hidden
1192 });
1193
1194 #line 335 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1195 }
1196 #line default
1197 #line hidden
1198
1199
1200 #line 337 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1201 public RazorEngine.Templating.TemplateWriter RenderField(FieldValueViewModel field)
1202 {
1203 #line default
1204 #line hidden
1205 return new RazorEngine.Templating.TemplateWriter(__razor_helper_writer => {
1206
1207 #line 338 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1208
1209 string fieldValue = field?.Value != null ? field.Value.ToString() : "";
1210
1211 if (fieldValue != "")
1212 {
1213 fieldValue = fieldValue == "False" ? Translate("No") : fieldValue;
1214 fieldValue = fieldValue == "True" ? Translate("Yes") : fieldValue;
1215
1216 if (field.Value.GetType() == typeof(System.Collections.Generic.List<FieldOptionValueViewModel>))
1217 {
1218 fieldValue = "";
1219 List<string> options = new List<string>();
1220 foreach (FieldOptionValueViewModel option in field.Value as System.Collections.Generic.List<FieldOptionValueViewModel>)
1221 {
1222 if (!string.IsNullOrWhiteSpace(option.Value))
1223 {
1224 if (option.Value.ToString().Contains("#") && (Translate(field.Name) == Translate("Color") || Translate(field.Name) == Translate("Colour")))
1225 {
1226 string colorSpan = "<span class=\"colorbox-sm\" style=\"background-color: " + option.Value + "\"></span>";
1227 options.Add(colorSpan);
1228 }
1229 else
1230 {
1231 options.Add(option.Value);
1232 }
1233 }
1234 }
1235 string optionsString = (string.Join(", ", options.Select(x => x.ToString()).ToArray()));
1236 if ((Translate(field.Name) == Translate("Color") || Translate(field.Name) == Translate("Colour")))
1237 {
1238 optionsString = (string.Join(" ", options.Select(x => x.ToString()).ToArray()));
1239 }
1240
1241 fieldValue = optionsString;
1242 }
1243
1244 if (!string.IsNullOrEmpty(fieldValue))
1245 {
1246
1247
1248 #line default
1249 #line hidden
1250 WriteLiteralTo(__razor_helper_writer, "\t\t\t<li>");
1251
1252
1253 #line 376 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1254 WriteTo(__razor_helper_writer, field.Name);
1255
1256
1257 #line default
1258 #line hidden
1259 WriteLiteralTo(__razor_helper_writer, ": ");
1260
1261
1262 #line 376 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1263 WriteTo(__razor_helper_writer, fieldValue);
1264
1265
1266 #line default
1267 #line hidden
1268 WriteLiteralTo(__razor_helper_writer, "</li>\r\n");
1269
1270
1271 #line 377 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1272 }
1273 }
1274
1275
1276 #line default
1277 #line hidden
1278 });
1279
1280 #line 379 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1281 }
1282 #line default
1283 #line hidden
1284
1285
1286 #line 381 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1287 public RazorEngine.Templating.TemplateWriter RenderStockState(ProductViewModel product)
1288 {
1289 #line default
1290 #line hidden
1291 return new RazorEngine.Templating.TemplateWriter(__razor_helper_writer => {
1292
1293 #line 382 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1294
1295 bool isNeverOutOfStock = product.NeverOutOfstock;
1296 bool hasExpectedDelivery = product.ExpectedDelivery != null && product.ExpectedDelivery > DateTime.Now;
1297 string expectedDeliveryDate = product.ExpectedDelivery?.ToShortDateString() ?? "";
1298
1299 string stockLevel = product.StockLevel > 100 ? "100+" : product.StockLevel.ToString();
1300
1301 if (!isNeverOutOfStock)
1302 {
1303 if (product.StockLevel > 0)
1304 {
1305 if (!Model.Item.GetBoolean("HideInventory"))
1306 {
1307
1308
1309 #line default
1310 #line hidden
1311 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t<p");
1312
1313 WriteLiteralTo(__razor_helper_writer, " class=\"fs-7 text-success m-0\"");
1314
1315 WriteLiteralTo(__razor_helper_writer, ">");
1316
1317
1318 #line 395 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1319 WriteTo(__razor_helper_writer, stockLevel);
1320
1321
1322 #line default
1323 #line hidden
1324 WriteLiteralTo(__razor_helper_writer, " ");
1325
1326
1327 #line 395 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1328 WriteTo(__razor_helper_writer, Translate("In stock"));
1329
1330
1331 #line default
1332 #line hidden
1333 WriteLiteralTo(__razor_helper_writer, "</p>\r\n");
1334
1335
1336 #line 396 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1337 }
1338 else
1339 {
1340
1341
1342 #line default
1343 #line hidden
1344 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t<p");
1345
1346 WriteLiteralTo(__razor_helper_writer, " class=\"fs-7 text-success m-0\"");
1347
1348 WriteLiteralTo(__razor_helper_writer, ">");
1349
1350
1351 #line 399 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1352 WriteTo(__razor_helper_writer, Translate("In stock"));
1353
1354
1355 #line default
1356 #line hidden
1357 WriteLiteralTo(__razor_helper_writer, "</p>\r\n");
1358
1359
1360 #line 400 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1361 }
1362 }
1363 else
1364 {
1365
1366
1367 #line default
1368 #line hidden
1369 WriteLiteralTo(__razor_helper_writer, "\t\t\t<p");
1370
1371 WriteLiteralTo(__razor_helper_writer, " class=\"fs-7 text-danger m-0\"");
1372
1373 WriteLiteralTo(__razor_helper_writer, ">");
1374
1375
1376 #line 404 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1377 WriteTo(__razor_helper_writer, Translate("Out of Stock"));
1378
1379
1380 #line default
1381 #line hidden
1382 WriteLiteralTo(__razor_helper_writer, "</p>\r\n");
1383
1384
1385 #line 405 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1386 }
1387
1388 if (hasExpectedDelivery)
1389 {
1390
1391
1392 #line default
1393 #line hidden
1394 WriteLiteralTo(__razor_helper_writer, "\t\t\t<p>\r\n\t\t\t\t<span>");
1395
1396
1397 #line 410 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1398 WriteTo(__razor_helper_writer, Translate("Expected:"));
1399
1400
1401 #line default
1402 #line hidden
1403 WriteLiteralTo(__razor_helper_writer, "</span>\r\n\t\t\t\t<span>");
1404
1405
1406 #line 411 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1407 WriteTo(__razor_helper_writer, expectedDeliveryDate);
1408
1409
1410 #line default
1411 #line hidden
1412 WriteLiteralTo(__razor_helper_writer, "</span>\r\n\t\t\t</p>\r\n");
1413
1414
1415 #line 413 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1416 }
1417 }
1418
1419
1420 #line default
1421 #line hidden
1422 });
1423
1424 #line 415 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1425 }
1426 #line default
1427 #line hidden
1428
1429
1430 #line 417 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1431 public RazorEngine.Templating.TemplateWriter RenderAddToCart(ProductViewModel product)
1432 {
1433 #line default
1434 #line hidden
1435 return new RazorEngine.Templating.TemplateWriter(__razor_helper_writer => {
1436
1437 #line 418 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1438
1439 string iconPath = "/Files/icons/";
1440 string url = "/Default.aspx?ID=" + (GetPageIdByNavigationTag("CartService"));
1441 if (!url.Contains("LayoutTemplate"))
1442 {
1443 url += url.Contains("?") ? "&LayoutTemplate=Swift_MiniCart.cshtml" : "?LayoutTemplate=Swift_MiniCart.cshtml";
1444 }
1445
1446 string anonymousUsersLimitations = Pageview.AreaSettings.GetRawValueString("AnonymousUsers", "");
1447 bool anonymousUser = Pageview.User == null;
1448
1449 bool hideAddToCart = !string.IsNullOrEmpty(Model.Item.GetString("HideAddToCart")) ? Model.Item.GetBoolean("HideAddToCart") : false;
1450 hideAddToCart = anonymousUsersLimitations.Contains("cart") && anonymousUser ? true : hideAddToCart;
1451 bool quantitySelector = !string.IsNullOrEmpty(Model.Item.GetString("QuantitySelector")) ? Model.Item.GetBoolean("QuantitySelector") : false;
1452
1453 string disableAddToCart = (product.StockLevel <= 0) ? "disabled" : "";
1454 bool isNeverOutOfStock = product.NeverOutOfstock;
1455 disableAddToCart = isNeverOutOfStock ? "" : disableAddToCart;
1456
1457 if (!hideAddToCart)
1458 {
1459 if (product.VariantInfo.VariantInfo == null)
1460 {
1461 string minQty = product.PurchaseMinimumQuantity != 1 ? "min=\"" + product.PurchaseMinimumQuantity.ToString() + "\"" : "min=\"1\"";
1462 string stepQty = product.PurchaseQuantityStep > 1 ? product.PurchaseQuantityStep.ToString() : "1";
1463 string valueQty = product.PurchaseMinimumQuantity > product.PurchaseQuantityStep ? product.PurchaseMinimumQuantity.ToString() : stepQty;
1464 string qtyValidCheck = stepQty != "1" ? "onkeyup=\"swift.Cart.QuantityValidate(event)\"" : "";
1465
1466
1467
1468 #line default
1469 #line hidden
1470 WriteLiteralTo(__razor_helper_writer, "\t\t\t<form");
1471
1472 WriteLiteralTo(__razor_helper_writer, " method=\"post\"");
1473
1474 WriteAttributeTo(__razor_helper_writer, "action", Tuple.Create(" action=\"", 18214), Tuple.Create("\"", 18227)
1475
1476 #line 446 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1477 , Tuple.Create(Tuple.Create("", 18223), Tuple.Create<System.Object, System.Int32>(url
1478
1479 #line default
1480 #line hidden
1481 , 18223), false)
1482 );
1483
1484 WriteLiteralTo(__razor_helper_writer, " class=\"d-inline-block my-auto\"");
1485
1486 WriteLiteralTo(__razor_helper_writer, ">\r\n\t\t\t\t<input");
1487
1488 WriteLiteralTo(__razor_helper_writer, " type=\"hidden\"");
1489
1490 WriteLiteralTo(__razor_helper_writer, " name=\"redirect\"");
1491
1492 WriteLiteralTo(__razor_helper_writer, " value=\"false\"");
1493
1494 WriteLiteralTo(__razor_helper_writer, " />\r\n\t\t\t\t<input");
1495
1496 WriteLiteralTo(__razor_helper_writer, " type=\"hidden\"");
1497
1498 WriteLiteralTo(__razor_helper_writer, " name=\"ProductId\"");
1499
1500 WriteAttributeTo(__razor_helper_writer, "value", Tuple.Create(" value=\"", 18362), Tuple.Create("\"", 18381)
1501
1502 #line 448 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1503 , Tuple.Create(Tuple.Create("", 18370), Tuple.Create<System.Object, System.Int32>(product.Id
1504
1505 #line default
1506 #line hidden
1507 , 18370), false)
1508 );
1509
1510 WriteLiteralTo(__razor_helper_writer, " />\r\n\t\t\t\t<input");
1511
1512 WriteLiteralTo(__razor_helper_writer, " type=\"hidden\"");
1513
1514 WriteLiteralTo(__razor_helper_writer, " name=\"cartcmd\"");
1515
1516 WriteLiteralTo(__razor_helper_writer, " value=\"add\"");
1517
1518 WriteLiteralTo(__razor_helper_writer, " />\r\n\r\n");
1519
1520
1521 #line 451 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1522
1523
1524 #line default
1525 #line hidden
1526
1527 #line 451 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1528 if (!string.IsNullOrEmpty(product.VariantId))
1529 {
1530
1531
1532 #line default
1533 #line hidden
1534 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t\t<input");
1535
1536 WriteLiteralTo(__razor_helper_writer, " type=\"hidden\"");
1537
1538 WriteLiteralTo(__razor_helper_writer, " name=\"VariantId\"");
1539
1540 WriteAttributeTo(__razor_helper_writer, "value", Tuple.Create(" value=\"", 18546), Tuple.Create("\"", 18572)
1541
1542 #line 453 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1543 , Tuple.Create(Tuple.Create("", 18554), Tuple.Create<System.Object, System.Int32>(product.VariantId
1544
1545 #line default
1546 #line hidden
1547 , 18554), false)
1548 );
1549
1550 WriteLiteralTo(__razor_helper_writer, " />\r\n");
1551
1552
1553 #line 454 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1554 }
1555
1556
1557 #line default
1558 #line hidden
1559 WriteLiteralTo(__razor_helper_writer, "\r\n");
1560
1561
1562 #line 456 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1563
1564
1565 #line default
1566 #line hidden
1567
1568 #line 456 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1569 if (quantitySelector)
1570 {
1571
1572
1573 #line default
1574 #line hidden
1575 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t\t<div");
1576
1577 WriteLiteralTo(__razor_helper_writer, " class=\"input-group input-primary-button-group d-flex flex-row w-100\"");
1578
1579 WriteLiteralTo(__razor_helper_writer, ">\r\n\t\t\t\t\t\t<label");
1580
1581 WriteAttributeTo(__razor_helper_writer, "for", Tuple.Create(" for=\"", 18715), Tuple.Create("\"", 18762)
1582 , Tuple.Create(Tuple.Create("", 18721), Tuple.Create("Quantity_", 18721), true)
1583
1584 #line 459 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1585 , Tuple.Create(Tuple.Create("", 18730), Tuple.Create<System.Object, System.Int32>(product.Id
1586
1587 #line default
1588 #line hidden
1589 , 18730), false)
1590 , Tuple.Create(Tuple.Create("", 18743), Tuple.Create("_", 18743), true)
1591
1592 #line 459 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1593 , Tuple.Create(Tuple.Create("", 18744), Tuple.Create<System.Object, System.Int32>(product.VariantId
1594
1595 #line default
1596 #line hidden
1597 , 18744), false)
1598 );
1599
1600 WriteLiteralTo(__razor_helper_writer, " class=\"visually-hidden\"");
1601
1602 WriteLiteralTo(__razor_helper_writer, ">");
1603
1604
1605 #line 459 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1606 WriteTo(__razor_helper_writer, Translate("Quantity"));
1607
1608
1609 #line default
1610 #line hidden
1611 WriteLiteralTo(__razor_helper_writer, "</label>\r\n\t\t\t\t\t\t<input");
1612
1613 WriteAttributeTo(__razor_helper_writer, "id", Tuple.Create(" id=\"", 18832), Tuple.Create("\"", 18878)
1614 , Tuple.Create(Tuple.Create("", 18837), Tuple.Create("Quantity_", 18837), true)
1615
1616 #line 460 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1617 , Tuple.Create(Tuple.Create("", 18846), Tuple.Create<System.Object, System.Int32>(product.Id
1618
1619 #line default
1620 #line hidden
1621 , 18846), false)
1622 , Tuple.Create(Tuple.Create("", 18859), Tuple.Create("_", 18859), true)
1623
1624 #line 460 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1625 , Tuple.Create(Tuple.Create("", 18860), Tuple.Create<System.Object, System.Int32>(product.VariantId
1626
1627 #line default
1628 #line hidden
1629 , 18860), false)
1630 );
1631
1632 WriteLiteralTo(__razor_helper_writer, " name=\"Quantity\"");
1633
1634 WriteAttributeTo(__razor_helper_writer, "value", Tuple.Create(" value=\"", 18895), Tuple.Create("\"", 18912)
1635
1636 #line 460 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1637 , Tuple.Create(Tuple.Create("", 18903), Tuple.Create<System.Object, System.Int32>(valueQty
1638
1639 #line default
1640 #line hidden
1641 , 18903), false)
1642 );
1643
1644 WriteAttributeTo(__razor_helper_writer, "step", Tuple.Create(" step=\"", 18913), Tuple.Create("\"", 18928)
1645
1646 #line 460 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1647 , Tuple.Create(Tuple.Create("", 18920), Tuple.Create<System.Object, System.Int32>(stepQty
1648
1649 #line default
1650 #line hidden
1651 , 18920), false)
1652 );
1653
1654 WriteLiteralTo(__razor_helper_writer, " ");
1655
1656
1657 #line 460 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1658 WriteTo(__razor_helper_writer, minQty);
1659
1660
1661 #line default
1662 #line hidden
1663 WriteLiteralTo(__razor_helper_writer, " class=\"form-control\" style=\"max-width: 100px\" type=\"number\">\r\n\t\t\t\t\t\t<button");
1664
1665 WriteLiteralTo(__razor_helper_writer, " type=\"button\"");
1666
1667 WriteLiteralTo(__razor_helper_writer, " onclick=\"swift.Cart.Update(event)\"");
1668
1669 WriteLiteralTo(__razor_helper_writer, " class=\"btn btn-primary flex-fill js-add-to-cart-button\"");
1670
1671 WriteLiteralTo(__razor_helper_writer, " ");
1672
1673
1674 #line 461 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1675 WriteTo(__razor_helper_writer, disableAddToCart);
1676
1677
1678 #line default
1679 #line hidden
1680 WriteLiteralTo(__razor_helper_writer, " title=\"");
1681
1682
1683 #line 461 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1684 WriteTo(__razor_helper_writer, Translate("Add to cart"));
1685
1686
1687 #line default
1688 #line hidden
1689 WriteLiteralTo(__razor_helper_writer, "\" id=\"AddToCartButton");
1690
1691
1692 #line 461 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1693 WriteTo(__razor_helper_writer, product.Id);
1694
1695
1696 #line default
1697 #line hidden
1698 WriteLiteralTo(__razor_helper_writer, "\"><span");
1699
1700 WriteLiteralTo(__razor_helper_writer, " class=\"icon-2\"");
1701
1702 WriteLiteralTo(__razor_helper_writer, ">");
1703
1704
1705 #line 461 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1706 WriteTo(__razor_helper_writer, ReadFile(iconPath + "shopping-cart.svg"));
1707
1708
1709 #line default
1710 #line hidden
1711 WriteLiteralTo(__razor_helper_writer, "</span></button>\r\n");
1712
1713
1714 #line 462 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1715
1716
1717 #line default
1718 #line hidden
1719
1720 #line 462 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1721 if (stepQty != "1")
1722 {
1723
1724
1725 #line default
1726 #line hidden
1727 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t\t\t\t<div");
1728
1729 WriteLiteralTo(__razor_helper_writer, " class=\"invalid-feedback d-none\"");
1730
1731 WriteLiteralTo(__razor_helper_writer, ">\r\n");
1732
1733 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t\t\t\t\t");
1734
1735
1736 #line 465 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1737 WriteTo(__razor_helper_writer, Translate("Please select a quantity that is dividable by"));
1738
1739
1740 #line default
1741 #line hidden
1742 WriteLiteralTo(__razor_helper_writer, " ");
1743
1744
1745 #line 465 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1746 WriteTo(__razor_helper_writer, stepQty);
1747
1748
1749 #line default
1750 #line hidden
1751 WriteLiteralTo(__razor_helper_writer, "\r\n\t\t\t\t\t\t\t</div>\r\n");
1752
1753
1754 #line 467 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1755 }
1756
1757
1758 #line default
1759 #line hidden
1760 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t\t</div>\r\n");
1761
1762
1763 #line 469 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1764 }
1765 else
1766 {
1767
1768
1769 #line default
1770 #line hidden
1771 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t\t<input");
1772
1773 WriteAttributeTo(__razor_helper_writer, "id", Tuple.Create(" id=\"", 19518), Tuple.Create("\"", 19564)
1774 , Tuple.Create(Tuple.Create("", 19523), Tuple.Create("Quantity_", 19523), true)
1775
1776 #line 472 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1777 , Tuple.Create(Tuple.Create("", 19532), Tuple.Create<System.Object, System.Int32>(product.Id
1778
1779 #line default
1780 #line hidden
1781 , 19532), false)
1782 , Tuple.Create(Tuple.Create("", 19545), Tuple.Create("_", 19545), true)
1783
1784 #line 472 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1785 , Tuple.Create(Tuple.Create("", 19546), Tuple.Create<System.Object, System.Int32>(product.VariantId
1786
1787 #line default
1788 #line hidden
1789 , 19546), false)
1790 );
1791
1792 WriteLiteralTo(__razor_helper_writer, " name=\"Quantity\"");
1793
1794 WriteAttributeTo(__razor_helper_writer, "value", Tuple.Create(" value=\"", 19581), Tuple.Create("\"", 19598)
1795
1796 #line 472 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1797 , Tuple.Create(Tuple.Create("", 19589), Tuple.Create<System.Object, System.Int32>(valueQty
1798
1799 #line default
1800 #line hidden
1801 , 19589), false)
1802 );
1803
1804 WriteLiteralTo(__razor_helper_writer, " type=\"hidden\"");
1805
1806 WriteLiteralTo(__razor_helper_writer, ">\r\n");
1807
1808 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t\t<button");
1809
1810 WriteLiteralTo(__razor_helper_writer, " type=\"button\"");
1811
1812 WriteLiteralTo(__razor_helper_writer, " onclick=\"swift.Cart.Update(event)\"");
1813
1814 WriteLiteralTo(__razor_helper_writer, " class=\"btn btn-primary js-add-to-cart-button\"");
1815
1816 WriteLiteralTo(__razor_helper_writer, " ");
1817
1818
1819 #line 473 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1820 WriteTo(__razor_helper_writer, disableAddToCart);
1821
1822
1823 #line default
1824 #line hidden
1825 WriteLiteralTo(__razor_helper_writer, " title=\"");
1826
1827
1828 #line 473 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1829 WriteTo(__razor_helper_writer, Translate("Add to cart"));
1830
1831
1832 #line default
1833 #line hidden
1834 WriteLiteralTo(__razor_helper_writer, "\" id=\"AddToCartButton");
1835
1836
1837 #line 473 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1838 WriteTo(__razor_helper_writer, product.Id);
1839
1840
1841 #line default
1842 #line hidden
1843 WriteLiteralTo(__razor_helper_writer, "\"><span");
1844
1845 WriteLiteralTo(__razor_helper_writer, " class=\"icon-2\"");
1846
1847 WriteLiteralTo(__razor_helper_writer, ">");
1848
1849
1850 #line 473 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1851 WriteTo(__razor_helper_writer, ReadFile(iconPath + "shopping-cart.svg"));
1852
1853
1854 #line default
1855 #line hidden
1856 WriteLiteralTo(__razor_helper_writer, "</span></button>\r\n");
1857
1858
1859 #line 474 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1860 }
1861
1862
1863 #line default
1864 #line hidden
1865 WriteLiteralTo(__razor_helper_writer, "\t\t\t</form>\r\n");
1866
1867
1868 #line 476 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1869 }
1870 else
1871 {
1872 string buttonWidth = quantitySelector ? "width: calc(80px + 3.5rem);" : "max-width: 3.5rem;";
1873 string buttonText = quantitySelector ? Translate("Select") : "<span class=\"icon-2\">" + @ReadFile(iconPath + "shopping-cart.svg") + "</span>";
1874
1875 string variantSelectorServicePageId = !string.IsNullOrEmpty(Model.Item.GetString("VariantSelectorServicePageId")) ? Model.Item.GetLink("VariantSelectorServicePageId").PageId.ToString() : "";
1876 variantSelectorServicePageId = variantSelectorServicePageId != "" ? variantSelectorServicePageId : GetPageIdByNavigationTag("RelatedProductsListService").ToString();
1877
1878
1879
1880 #line default
1881 #line hidden
1882 WriteLiteralTo(__razor_helper_writer, "<form");
1883
1884 WriteAttributeTo(__razor_helper_writer, "action", Tuple.Create(" action=\"", 20550), Tuple.Create("\"", 20605)
1885 , Tuple.Create(Tuple.Create("", 20559), Tuple.Create("/Default.aspx?ID=", 20559), true)
1886
1887 #line 485 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1888 , Tuple.Create(Tuple.Create("", 20576), Tuple.Create<System.Object, System.Int32>(variantSelectorServicePageId
1889
1890 #line default
1891 #line hidden
1892 , 20576), false)
1893 );
1894
1895 WriteLiteralTo(__razor_helper_writer, " data-response-target-element=\"VariantSelectorModalContent_");
1896
1897
1898 #line 485 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1899 WriteTo(__razor_helper_writer, Model.ID);
1900
1901
1902 #line default
1903 #line hidden
1904 WriteLiteralTo(__razor_helper_writer, "\"");
1905
1906 WriteLiteralTo(__razor_helper_writer, " data-preloader=\"inline\"");
1907
1908 WriteLiteralTo(__razor_helper_writer, " class=\"d-inline-block my-auto\"");
1909
1910 WriteLiteralTo(__razor_helper_writer, ">\r\n\t\t\t\t<input");
1911
1912 WriteLiteralTo(__razor_helper_writer, " type=\"hidden\"");
1913
1914 WriteLiteralTo(__razor_helper_writer, " name=\"ProductID\"");
1915
1916 WriteAttributeTo(__razor_helper_writer, "value", Tuple.Create(" value=\"", 20774), Tuple.Create("\"", 20793)
1917
1918 #line 486 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1919 , Tuple.Create(Tuple.Create("", 20782), Tuple.Create<System.Object, System.Int32>(product.Id
1920
1921 #line default
1922 #line hidden
1923 , 20782), false)
1924 );
1925
1926 WriteLiteralTo(__razor_helper_writer, " />\r\n\t\t\t\t<input");
1927
1928 WriteLiteralTo(__razor_helper_writer, " type=\"hidden\"");
1929
1930 WriteLiteralTo(__razor_helper_writer, " name=\"QuantitySelector\"");
1931
1932 WriteAttributeTo(__razor_helper_writer, "value", Tuple.Create(" value=\"", 20847), Tuple.Create("\"", 20883)
1933
1934 #line 487 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1935 , Tuple.Create(Tuple.Create("", 20855), Tuple.Create<System.Object, System.Int32>(quantitySelector.ToString()
1936
1937 #line default
1938 #line hidden
1939 , 20855), false)
1940 );
1941
1942 WriteLiteralTo(__razor_helper_writer, " />\r\n\t\t\t\t<input");
1943
1944 WriteLiteralTo(__razor_helper_writer, " type=\"hidden\"");
1945
1946 WriteLiteralTo(__razor_helper_writer, " name=\"ViewType\"");
1947
1948 WriteLiteralTo(__razor_helper_writer, " value=\"ModalContent\"");
1949
1950 WriteLiteralTo(__razor_helper_writer, " />\r\n\t\t\t\t<button");
1951
1952 WriteLiteralTo(__razor_helper_writer, " type=\"button\"");
1953
1954 WriteLiteralTo(__razor_helper_writer, " onclick=\"swift.PageUpdater.Update(event)\"");
1955
1956 WriteLiteralTo(__razor_helper_writer, " class=\"btn btn-primary\"");
1957
1958 WriteAttributeTo(__razor_helper_writer, "title", Tuple.Create(" title=\"", 21046), Tuple.Create("\"", 21074)
1959
1960 #line 489 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1961 , Tuple.Create(Tuple.Create("", 21054), Tuple.Create<System.Object, System.Int32>(Translate("Select")
1962
1963 #line default
1964 #line hidden
1965 , 21054), false)
1966 );
1967
1968 WriteAttributeTo(__razor_helper_writer, "style", Tuple.Create(" style=\"", 21075), Tuple.Create("\"", 21095)
1969
1970 #line 489 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1971 , Tuple.Create(Tuple.Create("", 21083), Tuple.Create<System.Object, System.Int32>(buttonWidth
1972
1973 #line default
1974 #line hidden
1975 , 21083), false)
1976 );
1977
1978 WriteLiteralTo(__razor_helper_writer, " data-bs-toggle=\"modal\"");
1979
1980 WriteLiteralTo(__razor_helper_writer, " data-bs-target=\"#VariantSelectorModal_");
1981
1982
1983 #line 489 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1984 WriteTo(__razor_helper_writer, Model.ID);
1985
1986
1987 #line default
1988 #line hidden
1989 WriteLiteralTo(__razor_helper_writer, "\"");
1990
1991 WriteLiteralTo(__razor_helper_writer, ">");
1992
1993
1994 #line 489 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
1995 WriteTo(__razor_helper_writer, buttonText);
1996
1997
1998 #line default
1999 #line hidden
2000 WriteLiteralTo(__razor_helper_writer, "</button>\r\n\t\t\t</form>\r\n");
2001
2002
2003 #line 491 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2004 }
2005 }
2006
2007
2008 #line default
2009 #line hidden
2010 });
2011
2012 #line 493 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2013 }
2014 #line default
2015 #line hidden
2016
2017
2018 #line 495 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2019 public RazorEngine.Templating.TemplateWriter RenderPrice(ProductViewModel product)
2020 {
2021 #line default
2022 #line hidden
2023 return new RazorEngine.Templating.TemplateWriter(__razor_helper_writer => {
2024
2025 #line 496 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2026
2027 string showPricesWithVat = Pageview.Area.EcomPricesWithVat.ToLower();
2028 bool neverShowVat = string.IsNullOrEmpty(showPricesWithVat);
2029 string priceMin = "";
2030 string priceMax = "";
2031
2032
2033
2034 #line default
2035 #line hidden
2036 WriteLiteralTo(__razor_helper_writer, "\t<div");
2037
2038 WriteLiteralTo(__razor_helper_writer, " class=\"text-end lh-1 my-auto my-lg-0\"");
2039
2040 WriteLiteralTo(__razor_helper_writer, ">\r\n\t\t<div>\r\n\t\t\t<span");
2041
2042 WriteLiteralTo(__razor_helper_writer, " itemprop=\"priceCurrency\"");
2043
2044 WriteAttributeTo(__razor_helper_writer, "content", Tuple.Create(" content=\"", 21540), Tuple.Create("\"", 21577)
2045
2046 #line 504 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2047 , Tuple.Create(Tuple.Create("", 21550), Tuple.Create<System.Object, System.Int32>(product.Price.CurrencyCode
2048
2049 #line default
2050 #line hidden
2051 , 21550), false)
2052 );
2053
2054 WriteLiteralTo(__razor_helper_writer, " class=\"d-none\"");
2055
2056 WriteLiteralTo(__razor_helper_writer, "></span>\r\n\r\n");
2057
2058
2059 #line 506 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2060
2061
2062 #line default
2063 #line hidden
2064
2065 #line 506 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2066 if (showPricesWithVat == "false" && !neverShowVat)
2067 {
2068 string beforePrice = product.PriceBeforeDiscount.PriceWithoutVatFormatted;
2069
2070
2071
2072 #line default
2073 #line hidden
2074 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t<span");
2075
2076 WriteLiteralTo(__razor_helper_writer, " itemprop=\"price\"");
2077
2078 WriteAttributeTo(__razor_helper_writer, "content", Tuple.Create(" content=\"", 21775), Tuple.Create("\"", 21815)
2079
2080 #line 510 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2081 , Tuple.Create(Tuple.Create("", 21785), Tuple.Create<System.Object, System.Int32>(product.Price.PriceWithoutVat
2082
2083 #line default
2084 #line hidden
2085 , 21785), false)
2086 );
2087
2088 WriteLiteralTo(__razor_helper_writer, " class=\"d-none\"");
2089
2090 WriteLiteralTo(__razor_helper_writer, "></span>\r\n");
2091
2092
2093 #line 511 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2094 if (product.Price.Price != product.PriceBeforeDiscount.Price)
2095 {
2096
2097
2098 #line default
2099 #line hidden
2100 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t\t<span");
2101
2102 WriteLiteralTo(__razor_helper_writer, " class=\"text-decoration-line-through opacity-75 me-2 text-price\"");
2103
2104 WriteLiteralTo(__razor_helper_writer, ">");
2105
2106
2107 #line 513 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2108 WriteTo(__razor_helper_writer, beforePrice);
2109
2110
2111 #line default
2112 #line hidden
2113 WriteLiteralTo(__razor_helper_writer, "</span>\r\n");
2114
2115
2116 #line 514 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2117 }
2118 }
2119 else
2120 {
2121 string beforePrice = product.PriceBeforeDiscount.PriceFormatted;
2122
2123
2124
2125 #line default
2126 #line hidden
2127 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t<span");
2128
2129 WriteLiteralTo(__razor_helper_writer, " itemprop=\"price\"");
2130
2131 WriteAttributeTo(__razor_helper_writer, "content", Tuple.Create(" content=\"", 22137), Tuple.Create("\"", 22167)
2132
2133 #line 520 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2134 , Tuple.Create(Tuple.Create("", 22147), Tuple.Create<System.Object, System.Int32>(product.Price.Price
2135
2136 #line default
2137 #line hidden
2138 , 22147), false)
2139 );
2140
2141 WriteLiteralTo(__razor_helper_writer, " class=\"d-none\"");
2142
2143 WriteLiteralTo(__razor_helper_writer, "></span>\r\n");
2144
2145
2146 #line 521 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2147 if (product.Price.Price != product.PriceBeforeDiscount.Price)
2148 {
2149
2150
2151 #line default
2152 #line hidden
2153 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t\t<span");
2154
2155 WriteLiteralTo(__razor_helper_writer, " class=\"text-decoration-line-through opacity-75 me-2 text-price\"");
2156
2157 WriteLiteralTo(__razor_helper_writer, ">");
2158
2159
2160 #line 523 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2161 WriteTo(__razor_helper_writer, beforePrice);
2162
2163
2164 #line default
2165 #line hidden
2166 WriteLiteralTo(__razor_helper_writer, "</span>\r\n");
2167
2168
2169 #line 524 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2170 }
2171 }
2172
2173
2174 #line default
2175 #line hidden
2176 WriteLiteralTo(__razor_helper_writer, "\r\n");
2177
2178
2179 #line 527 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2180
2181
2182 #line default
2183 #line hidden
2184
2185 #line 527 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2186 if (showPricesWithVat == "false" && !neverShowVat)
2187 {
2188 string price = product.Price.PriceWithoutVatFormatted;
2189 if (product?.VariantInfo?.VariantInfo != null)
2190 {
2191 priceMin = product?.VariantInfo?.PriceMin?.PriceWithoutVatFormatted != null ? product.VariantInfo.PriceMin.PriceWithoutVatFormatted : "";
2192 priceMax = product?.VariantInfo?.PriceMax?.PriceWithoutVatFormatted != null ? product.VariantInfo.PriceMax.PriceWithoutVatFormatted : "";
2193 }
2194 if (priceMin != priceMax)
2195 {
2196 price = priceMin + " - " + priceMax;
2197 }
2198
2199
2200 #line default
2201 #line hidden
2202 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t<span");
2203
2204 WriteLiteralTo(__razor_helper_writer, " class=\"text-price\"");
2205
2206 WriteLiteralTo(__razor_helper_writer, ">");
2207
2208
2209 #line 539 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2210 WriteTo(__razor_helper_writer, price);
2211
2212
2213 #line default
2214 #line hidden
2215 WriteLiteralTo(__razor_helper_writer, "</span>\r\n");
2216
2217
2218 #line 540 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2219 }
2220 else
2221 {
2222 string price = product.Price.PriceFormatted;
2223 if (product?.VariantInfo?.VariantInfo != null)
2224 {
2225 priceMin = product?.VariantInfo?.PriceMin?.PriceFormatted != null ? product.VariantInfo.PriceMin.PriceFormatted : "";
2226 priceMax = product?.VariantInfo?.PriceMax?.PriceFormatted != null ? product.VariantInfo.PriceMax.PriceFormatted : "";
2227 }
2228 if (priceMin != priceMax)
2229 {
2230 price = priceMin + " - " + priceMax;
2231 }
2232
2233
2234 #line default
2235 #line hidden
2236 WriteLiteralTo(__razor_helper_writer, "\t\t\t\t<span");
2237
2238 WriteLiteralTo(__razor_helper_writer, " class=\"text-price\"");
2239
2240 WriteLiteralTo(__razor_helper_writer, ">");
2241
2242
2243 #line 553 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2244 WriteTo(__razor_helper_writer, price);
2245
2246
2247 #line default
2248 #line hidden
2249 WriteLiteralTo(__razor_helper_writer, "</span>\r\n");
2250
2251
2252 #line 554 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2253 }
2254
2255
2256 #line default
2257 #line hidden
2258 WriteLiteralTo(__razor_helper_writer, "\t\t</div>\r\n\r\n");
2259
2260
2261 #line 557 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2262
2263
2264 #line default
2265 #line hidden
2266
2267 #line 557 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2268 if (showPricesWithVat == "false" && !neverShowVat)
2269 {
2270 string price = product.Price.PriceWithVatFormatted;
2271 if (product?.VariantInfo?.VariantInfo != null)
2272 {
2273 priceMin = product?.VariantInfo?.PriceMin?.PriceWithVatFormatted != null ? product.VariantInfo.PriceMin.PriceWithVatFormatted : "";
2274 priceMax = product?.VariantInfo?.PriceMax?.PriceWithVatFormatted != null ? product.VariantInfo.PriceMax.PriceWithVatFormatted : "";
2275 }
2276 if (priceMin != priceMax)
2277 {
2278 price = priceMin + " - " + priceMax;
2279 }
2280 var ps = new Dynamicweb.Ecommerce.Products.ProductService();
2281 var productObject = ps.GetProductById(product.Id,"",true);
2282 var vatGroupCountry = Dynamicweb.Ecommerce.Services.VatGroups.GetVatGroupCountryRelation(productObject.VatGroupId,"AU");
2283 double tax = Convert.ToInt32(vatGroupCountry.VatValue);
2284 string price = (Convert.ToDouble(product.Price.Price) * ((tax/100)+1)).ToString("0.00");
2285
2286
2287 #line default
2288 #line hidden
2289 WriteLiteralTo(__razor_helper_writer, "\t\t\t<div");
2290
2291 WriteLiteralTo(__razor_helper_writer, " class=\"fs-7 opacity-85 text-price\"");
2292
2293 WriteLiteralTo(__razor_helper_writer, ">");
2294
2295
2296 #line 574 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2297 WriteTo(__razor_helper_writer, price);
2298
2299
2300 #line default
2301 #line hidden
2302 WriteLiteralTo(__razor_helper_writer, " ");
2303
2304
2305 #line 574 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2306 WriteTo(__razor_helper_writer, Translate("Incl. VAT"));
2307
2308
2309 #line default
2310 #line hidden
2311 WriteLiteralTo(__razor_helper_writer, "</div>\r\n");
2312
2313
2314 #line 575 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2315 }
2316
2317
2318 #line default
2319 #line hidden
2320 WriteLiteralTo(__razor_helper_writer, "\t</div>\r\n");
2321
2322
2323 #line 577 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2324
2325
2326 #line default
2327 #line hidden
2328 });
2329
2330 #line 577 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2331 }
2332 #line default
2333 #line hidden
2334
2335
2336 public RazorEngine_3206c3487eec4315a014f85352f1f322() {
2337 }
2338
2339 public override void Execute() {
2340 WriteLiteral("\r\n");
2341
2342
2343 #line 5 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2344
2345 string theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? " theme " + Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : "";
2346
2347
2348 #line default
2349 #line hidden
2350 WriteLiteral("\r\n\r\n");
2351
2352
2353 #line 9 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2354 if (!string.IsNullOrEmpty(theme))
2355 {
2356
2357
2358 #line default
2359 #line hidden
2360 WriteLiteral("\t<div");
2361
2362 WriteAttribute("class", Tuple.Create(" class=\"", 428), Tuple.Create("\"", 449)
2363 , Tuple.Create(Tuple.Create("", 436), Tuple.Create("h-100", 436), true)
2364
2365 #line 11 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2366 , Tuple.Create(Tuple.Create("", 441), Tuple.Create<System.Object, System.Int32>(theme
2367
2368 #line default
2369 #line hidden
2370 , 441), false)
2371 );
2372
2373 WriteLiteral(">\r\n");
2374
2375 WriteLiteral("\t\t");
2376
2377
2378 #line 12 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2379 Write(RenderProductList());
2380
2381
2382 #line default
2383 #line hidden
2384 WriteLiteral("\r\n\t</div>\r\n");
2385
2386
2387 #line 14 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2388 }
2389 else
2390 {
2391
2392
2393 #line default
2394 #line hidden
2395
2396 #line 17 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2397 Write(RenderProductList());
2398
2399
2400 #line default
2401 #line hidden
2402
2403 #line 17 "F:\Dynamicweb\Solution\Production\Files\Templates\Designs\Swift\Paragraph\Swift_ProductListCompactView.cshtml"
2404
2405 }
2406
2407
2408 #line default
2409 #line hidden
2410 WriteLiteral("\r\n");
2411
2412 WriteLiteral("\r\n");
2413
2414 WriteLiteral("\r\n");
2415
2416 WriteLiteral("\r\n");
2417
2418 WriteLiteral("\r\n");
2419
2420 WriteLiteral("\r\n");
2421
2422 }
2423 }
2424 }
2425
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel>
2 @using Dynamicweb.Ecommerce.ProductCatalog
3 @using Dynamicweb.Ecommerce.CustomerExperienceCenter.Favorites
4
5 @{
6 string theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? " theme " + Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : "";
7 }
8
9 @if (!string.IsNullOrEmpty(theme))
10 {
11 <div class="h-100@(theme)">
12 @RenderProductList()
13 </div>
14 }
15 else
16 {
17 @RenderProductList()
18 }
19
20 @helper RenderProductList()
21 {
22 ProductListViewModel productList = new ProductListViewModel();
23
24 if (Dynamicweb.Context.Current.Items.Contains("ProductList"))
25 {
26 productList = (ProductListViewModel)Dynamicweb.Context.Current.Items["ProductList"];
27 }
28
29 string anonymousUsersLimitations = Pageview.AreaSettings.GetRawValueString("AnonymousUsers", "");
30 bool anonymousUser = Pageview.User == null;
31 bool hideProductNumber = !string.IsNullOrEmpty(Model.Item.GetString("HideProductNumber")) ? Model.Item.GetBoolean("HideProductNumber") : false;
32 bool hidePrice = anonymousUsersLimitations.Contains("price") && anonymousUser;
33 bool hideAddToCart = !string.IsNullOrEmpty(Model.Item.GetString("HideAddToCart")) ? Model.Item.GetBoolean("HideAddToCart") : false;
34 hideAddToCart = anonymousUsersLimitations.Contains("cart") && anonymousUser ? true : hideAddToCart;
35 bool hideFavoritesSelector = !string.IsNullOrEmpty(Model.Item.GetString("HideFavoritesSelector")) ? Model.Item.GetBoolean("HideFavoritesSelector") : false;
36
37 string listItemLayout = !string.IsNullOrEmpty(Model.Item.GetString("ListItemLayout")) ? Model.Item.GetString("ListItemLayout") : "full";
38
39 string detailsPageLink = Dynamicweb.Context.Current.Items["DetailsPageLink"] != null ? Dynamicweb.Context.Current.Items["DetailsPageLink"].ToString() : "";
40 string productTheme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("ProductTheme")) ? " theme p-3 " + Model.Item.GetRawValueString("ProductTheme").Replace(" ", "").Trim().ToLower() : "";
41 string modalTheme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("ModalTheme")) ? " theme " + Model.Item.GetRawValueString("ModalTheme").Replace(" ", "").Trim().ToLower() : "theme light";
42 string textPadding = !string.IsNullOrEmpty(Model.Item.GetString("ContentPadding")) ? Model.Item.GetRawValueString("ContentPadding") : "none";
43 textPadding = textPadding == "none" ? "" : textPadding;
44 textPadding = textPadding == "small" ? "p-2 p-lg-3" : textPadding;
45
46 string groupId = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString.Get("GroupID")) ? Dynamicweb.Context.Current.Request.QueryString.Get("GroupID") : "";
47 string url = Dynamicweb.Context.Current.Request.RawUrl;
48
49 var badgeParms = new Dictionary<string, object>();
50 badgeParms.Add("saleBadgeType", Model.Item.GetRawValue("SaleBadgeType"));
51 badgeParms.Add("saleBadgeCssClassName", Model.Item.GetRawValue("SaleBadgeDesign"));
52 badgeParms.Add("newBadgeCssClassName", Model.Item.GetRawValue("NewBadgeDesign"));
53 badgeParms.Add("newPublicationDays", Model.Item.GetInt32("NewPublicationDays"));
54 badgeParms.Add("campaignBadgesValues", Model.Item.GetRawValueString("CampaignBadges"));
55
56 var favoriteParameters = new Dictionary<string, object>();
57 if (!anonymousUser && !hideFavoritesSelector)
58 {
59 int defaultFavoriteListId = 0;
60
61 IEnumerable<FavoriteList> favoreiteLists = Pageview.User.GetFavoriteLists();
62 if (favoreiteLists.Count() == 1)
63 {
64 foreach (FavoriteList list in favoreiteLists)
65 {
66 defaultFavoriteListId = list.ListId;
67 }
68 }
69
70 favoriteParameters.Add("ListId", defaultFavoriteListId);
71 }
72
73 if (productList.TotalProductsCount > 0)
74 {
75 int pageSizeSetting = 30;
76 int pageSize = productList.PageSize;
77 pageSize += pageSizeSetting;
78
79 int loadedProducts = productList.PageSize > productList.TotalProductsCount ? productList.TotalProductsCount : productList.PageSize;
80
81 foreach (ProductViewModel product in productList.Products)
82 {
83 var defaultGroupId = product.PrimaryOrDefaultGroup.Id;
84 var selectedDetailPage = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(defaultGroupId)?.Meta.PrimaryPage ?? string.Empty;
85
86 string link = string.IsNullOrEmpty(selectedDetailPage) ? $"{detailsPageLink}&groupid={defaultGroupId}" : selectedDetailPage;
87 link += "&productid=" + product.Id;
88 link += !string.IsNullOrEmpty(product.VariantId) ? "&variantid=" + product.VariantId : "";
89
90 string imagePath = product?.DefaultImage?.Value ?? "";
91 imagePath = Dynamicweb.Context.Current.Server.UrlEncode(imagePath);
92 imagePath = "/Admin/Public/GetImage.ashx?width=" + 48 + "&image=" + imagePath + "&format=webp";
93
94 string ratio = Model.Item.GetRawValueString("ImageAspectRatio", "");
95 ratio = ratio != "0" ? ratio : "";
96 string ratioCssClass = ratio != "" ? " ratio" : "";
97 string ratioVariable = ratio != "" ? "--bs-aspect-ratio: " + ratio : "";
98
99 string imageTheme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("ImageTheme")) ? " theme " + Model.Item.GetRawValueString("ImageTheme").Replace(" ", "").Trim().ToLower() : "";
100 string imageId = "ProductImage_" + product.Id + product.VariantId;
101
102 @* Alternative image *@
103 var supportedImageFormats = new string[] { ".jpg", ".webp", ".png", ".gif" };
104 string defaultImage = product.DefaultImage != null ? product.DefaultImage.Value : "";
105 var selectedAssetCategories = Model.Item.GetRawValueString("AlternativeImageAssets");
106 IEnumerable<MediaViewModel> alternativeImagesList = product.AssetCategories.Where(x => selectedAssetCategories.Contains(x.SystemName)).SelectMany(x => x.Assets);
107
108 if (alternativeImagesList.FirstOrDefault() != null) {
109 alternativeImagesList = alternativeImagesList.OrderByDescending(x => x.Value.Equals(defaultImage));
110
111 if (alternativeImagesList.First().Value == defaultImage) {
112 alternativeImagesList = alternativeImagesList.Skip(1);
113 }
114 }
115
116 string alternativeImage = alternativeImagesList.FirstOrDefault() != null ? alternativeImagesList.FirstOrDefault().Value : "";
117 alternativeImage = !string.IsNullOrEmpty(alternativeImage) ? "/Admin/Public/GetImage.ashx?width=" + 48 + "&image=" + alternativeImage + "&format=webp" : "";
118
119 @* Main features *@
120 IEnumerable<string> selectedDisplayGroups = Model.Item.GetRawValueString("MainFeatures").Split(',').ToList();
121 List<CategoryFieldViewModel> mainFeatures = new List<CategoryFieldViewModel>();
122
123 foreach (var selection in selectedDisplayGroups)
124 {
125 foreach (CategoryFieldViewModel group in product.FieldDisplayGroups.Values)
126 {
127 if (selection == group.Id)
128 {
129 mainFeatures.Add(group);
130 }
131 }
132 }
133
134 <article class="grid gap-2 gap-lg-3 mb-3 @(productTheme)">
135 <a href="@link" class="g-col-12 g-col-lg-8 d-flex text-decoration-none mb-2 mb-lg-0">
136
137 @if (!Model.Item.GetBoolean("HideImage"))
138 {
139 <div class="d-flex align-items-center me-3" style="min-width: 48px">
140 <div class="@ratioCssClass m-0" style="@(ratioVariable)">
141 <figure class="m-0">
142 <div class="d-flex justify-content-center align-items-center h-100 w-100">
143 @if (string.IsNullOrEmpty(alternativeImage)) {
144 <img src="@imagePath" alt="@product.Name" class="mw-100 mh-100" loading="lazy" style="object-fit: cover;" />
145 } else {
146 <img src="@imagePath" onmouseover="this.src='@alternativeImage'" onmouseout="this.src='@imagePath'" alt="@product.Name" class="mw-100 mh-100" loading="lazy" style="object-fit: cover;" />
147 }
148 </div>
149 </figure>
150 </div>
151 </div>
152 }
153
154 <div class="grid gap-1 flex-fill">
155 <div class="g-col-12 g-col-lg-6">
156 <h3 class="h6 mb-0">@product.Name @if (!string.IsNullOrEmpty(product.VariantName)) { <text>(@product.VariantName)</text> }</h3>
157
158 @if (!hideProductNumber) {
159 <div class="fs-7 opacity-75">@product.Number</div>
160 }
161 @if (!Model.Item.GetBoolean("HideStockState"))
162 {
163 <div class="g-col-12 fs-7 d-block d-lg-none">
164 @RenderStockState(product)
165 </div>
166 }
167
168 @RenderPartial("Components/EcommerceBadge.cshtml", product, badgeParms)
169 </div>
170 @if (selectedDisplayGroups.Count() > 0)
171 {
172 <div class="g-col-12 g-col-lg-4">
173 @RenderMainFeatures(mainFeatures)
174 </div>
175 }
176 @if (!Model.Item.GetBoolean("HideStockState"))
177 {
178 <div class="g-col-12 g-col-lg-2 text-end align-self-center d-none d-lg-block">
179 @RenderStockState(product)
180 </div>
181 }
182 </div>
183 </a>
184
185 <div class="g-col-12 g-col-lg-4 d-flex justify-content-end">
186 @if (!hidePrice)
187 {
188 <div class="me-3 my-auto">
189 @RenderPrice(product)
190 </div>
191 }
192 @if (!anonymousUser && !hideFavoritesSelector && product.VariantInfo.VariantInfo == null)
193 {
194 @RenderPartial("Components/ToggleFavorite.cshtml", product, favoriteParameters)
195 }
196 @RenderAddToCart(product)
197 </div>
198 </article>
199 }
200
201 <div class="my-3">
202 <div class="text-center d-flex flex-column gap-3">
203 <div class="opacity-85">@loadedProducts @Translate("out of") @productList.TotalProductsCount @Translate("products")</div>
204 @if (productList.PageCount != 1)
205 {
206 string sortBySelection = Dynamicweb.Context.Current.Request?.Form["SortBy"] ?? "NameForSort";
207 sortBySelection = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString.Get("SortBy")) ? Dynamicweb.Context.Current.Request.QueryString.Get("SortBy") : sortBySelection;
208
209 <form method="get" action="@url" data-response-target-element="content" class="w-100">
210 @foreach (FacetGroupViewModel facetGroup in productList.FacetGroups)
211 {
212 foreach (FacetViewModel facetItem in facetGroup.Facets)
213 {
214 foreach (FacetOptionViewModel facetOption in facetItem.Options)
215 {
216 if (facetOption.Selected)
217 {
218 <input type="hidden" name="@facetItem.QueryParameter" value="[@facetOption.Value]" />
219 }
220 }
221 }
222 }
223
224 @if (productList?.Group?.Id != null)
225 {
226 <input type="hidden" name="GroupId" value="@productList.Group.Id" />
227 }
228
229 <input type="hidden" name="PageSize" value="@pageSize" />
230 <input type="hidden" name="SortBy" value="@sortBySelection" />
231 <input type="hidden" name="RequestType" value="UpdateList" />
232
233 <button class="btn btn-primary" type="button" onclick="swift.ProductList.Update(event)">@Translate("Load more products")</button>
234 </form>
235 }
236 </div>
237 </div>
238
239 if (!hideAddToCart)
240 {
241 <div class="modal fade js-product" id="VariantSelectorModal_@Model.ID" tabindex="-1" aria-hidden="true">
242 <div class="modal-dialog modal-dialog-centered modal-md">
243 <div class="modal-content @modalTheme" id="VariantSelectorModalContent_@Model.ID">
244 @* The content here comes from an external request *@
245 </div>
246 </div>
247 </div>
248 }
249
250 } else {
251 if (!Pageview.IsVisualEditorMode) {
252 <div class="alert alert-dark m-0">
253 @Translate("We did not find anything matching your search result")
254 </div>
255 } else {
256 <div class="alert alert-dark m-0" role="alert">
257 <span>@Translate("Product list: The list will be shown here, if any")</span>
258 </div>
259 }
260 }
261 }
262
263 @helper RenderMainFeatures(List<CategoryFieldViewModel> mainFeatures)
264 {
265 if (mainFeatures.Count > 0)
266 {
267 string featuresLayout = Model.Item.GetRawValueString("FeaturesLayout", "bullets");
268
269 if (featuresLayout == "bullets")
270 {
271 <ul class="m-0 p-0 lh-1 fs-7 opacity-75" style="list-style-position: inside">
272 @foreach (CategoryFieldViewModel mainFeatureGroup in mainFeatures)
273 {
274 foreach (var field in mainFeatureGroup.Fields)
275 {
276 @RenderField(field.Value)
277 }
278 }
279 </ul>
280 }
281 else
282 {
283 List<string> featuresList = new List<string>();
284 foreach (CategoryFieldViewModel mainFeatureGroup in mainFeatures)
285 {
286 foreach (var field in mainFeatureGroup.Fields)
287 {
288 if (field.Value.Value.GetType() == typeof(System.Collections.Generic.List<FieldOptionValueViewModel>))
289 {
290 List<string> options = new List<string>();
291 foreach (FieldOptionValueViewModel option in field.Value.Value as System.Collections.Generic.List<FieldOptionValueViewModel>)
292 {
293 if (!string.IsNullOrWhiteSpace(option.Value))
294 {
295 if (option.Value.ToString().Contains("#") && (Translate(field.Value.Name) == Translate("Color") || Translate(field.Value.Name) == Translate("Colour")))
296 {
297 string colorSpan = "<span class=\"colorbox-sm\" style=\"background-color: " + option.Value + "\"></span>";
298 options.Add(colorSpan);
299 }
300 else
301 {
302 options.Add(option.Name);
303 }
304 }
305 }
306 string optionsString = (string.Join(", ", options.Select(x => x.ToString()).ToArray()));
307 if ((Translate(field.Value.Name) == Translate("Color") || Translate(field.Value.Name) == Translate("Colour")))
308 {
309 optionsString = (string.Join(" ", options.Select(x => x.ToString()).ToArray()));
310 }
311 featuresList.Add(field.Value.Name + ": " + optionsString);
312 }
313 else
314 {
315 if (!string.IsNullOrWhiteSpace(field.Value.Value.ToString()))
316 {
317 if (field.Value.Value.ToString().Contains("#") && (Translate(field.Value.Name) == Translate("Color") || Translate(field.Value.Name) == Translate("Colour")))
318 {
319 string colorSpan = "<span class=\"colorbox-sm\" style=\"background-color: " + field.Value.Value + "\"></span>";
320 featuresList.Add(field.Value.Name + ": " + colorSpan);
321 }
322 else
323 {
324 featuresList.Add(field.Value.Name + ": " + field.Value.Value.ToString());
325 }
326 }
327 }
328 }
329 }
330 string featuresString = (string.Join(", ", featuresList.Select(x => x.ToString()).ToArray()));
331
332 <div class="opacity-75 fs-7">@featuresString</div>
333 }
334 }
335 }
336
337 @helper RenderField(FieldValueViewModel field)
338 {
339 string fieldValue = field?.Value != null ? field.Value.ToString() : "";
340
341 if (fieldValue != "")
342 {
343 fieldValue = fieldValue == "False" ? Translate("No") : fieldValue;
344 fieldValue = fieldValue == "True" ? Translate("Yes") : fieldValue;
345
346 if (field.Value.GetType() == typeof(System.Collections.Generic.List<FieldOptionValueViewModel>))
347 {
348 fieldValue = "";
349 List<string> options = new List<string>();
350 foreach (FieldOptionValueViewModel option in field.Value as System.Collections.Generic.List<FieldOptionValueViewModel>)
351 {
352 if (!string.IsNullOrWhiteSpace(option.Value))
353 {
354 if (option.Value.ToString().Contains("#") && (Translate(field.Name) == Translate("Color") || Translate(field.Name) == Translate("Colour")))
355 {
356 string colorSpan = "<span class=\"colorbox-sm\" style=\"background-color: " + option.Value + "\"></span>";
357 options.Add(colorSpan);
358 }
359 else
360 {
361 options.Add(option.Value);
362 }
363 }
364 }
365 string optionsString = (string.Join(", ", options.Select(x => x.ToString()).ToArray()));
366 if ((Translate(field.Name) == Translate("Color") || Translate(field.Name) == Translate("Colour")))
367 {
368 optionsString = (string.Join(" ", options.Select(x => x.ToString()).ToArray()));
369 }
370
371 fieldValue = optionsString;
372 }
373
374 if (!string.IsNullOrEmpty(fieldValue))
375 {
376 <li>@(field.Name): @fieldValue</li>
377 }
378 }
379 }
380
381 @helper RenderStockState(ProductViewModel product)
382 {
383 bool isNeverOutOfStock = product.NeverOutOfstock;
384 bool hasExpectedDelivery = product.ExpectedDelivery != null && product.ExpectedDelivery > DateTime.Now;
385 string expectedDeliveryDate = product.ExpectedDelivery?.ToShortDateString() ?? "";
386
387 string stockLevel = product.StockLevel > 100 ? "100+" : product.StockLevel.ToString();
388
389 if (!isNeverOutOfStock)
390 {
391 if (product.StockLevel > 0)
392 {
393 if (!Model.Item.GetBoolean("HideInventory"))
394 {
395 <p class="fs-7 text-success m-0">@stockLevel @Translate("In stock")</p>
396 }
397 else
398 {
399 <p class="fs-7 text-success m-0">@Translate("In stock")</p>
400 }
401 }
402 else
403 {
404 <p class="fs-7 text-danger m-0">@Translate("Out of Stock")</p>
405 }
406
407 if (hasExpectedDelivery)
408 {
409 <p>
410 <span>@Translate("Expected:")</span>
411 <span>@expectedDeliveryDate</span>
412 </p>
413 }
414 }
415 }
416
417 @helper RenderAddToCart(ProductViewModel product)
418 {
419 string iconPath = "/Files/icons/";
420 string url = "/Default.aspx?ID=" + (GetPageIdByNavigationTag("CartService"));
421 if (!url.Contains("LayoutTemplate"))
422 {
423 url += url.Contains("?") ? "&LayoutTemplate=Swift_MiniCart.cshtml" : "?LayoutTemplate=Swift_MiniCart.cshtml";
424 }
425
426 string anonymousUsersLimitations = Pageview.AreaSettings.GetRawValueString("AnonymousUsers", "");
427 bool anonymousUser = Pageview.User == null;
428
429 bool hideAddToCart = !string.IsNullOrEmpty(Model.Item.GetString("HideAddToCart")) ? Model.Item.GetBoolean("HideAddToCart") : false;
430 hideAddToCart = anonymousUsersLimitations.Contains("cart") && anonymousUser ? true : hideAddToCart;
431 bool quantitySelector = !string.IsNullOrEmpty(Model.Item.GetString("QuantitySelector")) ? Model.Item.GetBoolean("QuantitySelector") : false;
432
433 string disableAddToCart = (product.StockLevel <= 0) ? "disabled" : "";
434 bool isNeverOutOfStock = product.NeverOutOfstock;
435 disableAddToCart = isNeverOutOfStock ? "" : disableAddToCart;
436
437 if (!hideAddToCart)
438 {
439 if (product.VariantInfo.VariantInfo == null)
440 {
441 string minQty = product.PurchaseMinimumQuantity != 1 ? "min=\"" + product.PurchaseMinimumQuantity.ToString() + "\"" : "min=\"1\"";
442 string stepQty = product.PurchaseQuantityStep > 1 ? product.PurchaseQuantityStep.ToString() : "1";
443 string valueQty = product.PurchaseMinimumQuantity > product.PurchaseQuantityStep ? product.PurchaseMinimumQuantity.ToString() : stepQty;
444 string qtyValidCheck = stepQty != "1" ? "onkeyup=\"swift.Cart.QuantityValidate(event)\"" : "";
445
446 <form method="post" action="@url" class="d-inline-block my-auto">
447 <input type="hidden" name="redirect" value="false" />
448 <input type="hidden" name="ProductId" value="@product.Id" />
449 <input type="hidden" name="cartcmd" value="add" />
450
451 @if (!string.IsNullOrEmpty(product.VariantId))
452 {
453 <input type="hidden" name="VariantId" value="@product.VariantId" />
454 }
455
456 @if (quantitySelector)
457 {
458 <div class="input-group input-primary-button-group d-flex flex-row w-100">
459 <label for="Quantity_@(product.Id)_@product.VariantId" class="visually-hidden">@Translate("Quantity")</label>
460 <input id="Quantity_@(product.Id)_@product.VariantId" name="Quantity" value="@valueQty" step="@stepQty" @minQty class="form-control" style="max-width: 100px" type="number">
461 <button type="button" onclick="swift.Cart.Update(event)" class="btn btn-primary flex-fill js-add-to-cart-button" @disableAddToCart title="@Translate("Add to cart")" id="AddToCartButton@(product.Id)"><span class="icon-2">@ReadFile(iconPath + "shopping-cart.svg")</span></button>
462 @if (stepQty != "1")
463 {
464 <div class="invalid-feedback d-none">
465 @Translate("Please select a quantity that is dividable by") @stepQty
466 </div>
467 }
468 </div>
469 }
470 else
471 {
472 <input id="Quantity_@(product.Id)_@product.VariantId" name="Quantity" value="@valueQty" type="hidden">
473 <button type="button" onclick="swift.Cart.Update(event)" class="btn btn-primary js-add-to-cart-button" @disableAddToCart title="@Translate("Add to cart")" id="AddToCartButton@(product.Id)"><span class="icon-2">@ReadFile(iconPath + "shopping-cart.svg")</span></button>
474 }
475 </form>
476 }
477 else
478 {
479 string buttonWidth = quantitySelector ? "width: calc(80px + 3.5rem);" : "max-width: 3.5rem;";
480 string buttonText = quantitySelector ? Translate("Select") : "<span class=\"icon-2\">" + @ReadFile(iconPath + "shopping-cart.svg") + "</span>";
481
482 string variantSelectorServicePageId = !string.IsNullOrEmpty(Model.Item.GetString("VariantSelectorServicePageId")) ? Model.Item.GetLink("VariantSelectorServicePageId").PageId.ToString() : "";
483 variantSelectorServicePageId = variantSelectorServicePageId != "" ? variantSelectorServicePageId : GetPageIdByNavigationTag("RelatedProductsListService").ToString();
484
485 <form action="/Default.aspx?ID=@variantSelectorServicePageId" data-response-target-element="VariantSelectorModalContent_@Model.ID" data-preloader="inline" class="d-inline-block my-auto">
486 <input type="hidden" name="ProductID" value="@product.Id" />
487 <input type="hidden" name="QuantitySelector" value="@quantitySelector.ToString()" />
488 <input type="hidden" name="ViewType" value="ModalContent" />
489 <button type="button" onclick="swift.PageUpdater.Update(event)" class="btn btn-primary" title="@Translate("Select")" style="@buttonWidth" data-bs-toggle="modal" data-bs-target="#VariantSelectorModal_@Model.ID">@buttonText</button>
490 </form>
491 }
492 }
493 }
494
495 @helper RenderPrice(ProductViewModel product)
496 {
497 string showPricesWithVat = Pageview.Area.EcomPricesWithVat.ToLower();
498 bool neverShowVat = string.IsNullOrEmpty(showPricesWithVat);
499 string priceMin = "";
500 string priceMax = "";
501
502 <div class="text-end lh-1 my-auto my-lg-0">
503 <div>
504 <span itemprop="priceCurrency" content="@product.Price.CurrencyCode" class="d-none"></span>
505
506 @if (showPricesWithVat == "false" && !neverShowVat)
507 {
508 string beforePrice = product.PriceBeforeDiscount.PriceWithoutVatFormatted;
509
510 <span itemprop="price" content="@product.Price.PriceWithoutVat" class="d-none"></span>
511 if (product.Price.Price != product.PriceBeforeDiscount.Price)
512 {
513 <span class="text-decoration-line-through opacity-75 me-2 text-price">@beforePrice</span>
514 }
515 }
516 else
517 {
518 string beforePrice = product.PriceBeforeDiscount.PriceFormatted;
519
520 <span itemprop="price" content="@product.Price.Price" class="d-none"></span>
521 if (product.Price.Price != product.PriceBeforeDiscount.Price)
522 {
523 <span class="text-decoration-line-through opacity-75 me-2 text-price">@beforePrice</span>
524 }
525 }
526
527 @if (showPricesWithVat == "false" && !neverShowVat)
528 {
529 string price = product.Price.PriceWithoutVatFormatted;
530 if (product?.VariantInfo?.VariantInfo != null)
531 {
532 priceMin = product?.VariantInfo?.PriceMin?.PriceWithoutVatFormatted != null ? product.VariantInfo.PriceMin.PriceWithoutVatFormatted : "";
533 priceMax = product?.VariantInfo?.PriceMax?.PriceWithoutVatFormatted != null ? product.VariantInfo.PriceMax.PriceWithoutVatFormatted : "";
534 }
535 if (priceMin != priceMax)
536 {
537 price = priceMin + " - " + priceMax;
538 }
539 <span class="text-price">@price</span>
540 }
541 else
542 {
543 string price = product.Price.PriceFormatted;
544 if (product?.VariantInfo?.VariantInfo != null)
545 {
546 priceMin = product?.VariantInfo?.PriceMin?.PriceFormatted != null ? product.VariantInfo.PriceMin.PriceFormatted : "";
547 priceMax = product?.VariantInfo?.PriceMax?.PriceFormatted != null ? product.VariantInfo.PriceMax.PriceFormatted : "";
548 }
549 if (priceMin != priceMax)
550 {
551 price = priceMin + " - " + priceMax;
552 }
553 <span class="text-price">@price</span>
554 }
555 </div>
556
557 @if (showPricesWithVat == "false" && !neverShowVat)
558 {
559 string price = product.Price.PriceWithVatFormatted;
560 if (product?.VariantInfo?.VariantInfo != null)
561 {
562 priceMin = product?.VariantInfo?.PriceMin?.PriceWithVatFormatted != null ? product.VariantInfo.PriceMin.PriceWithVatFormatted : "";
563 priceMax = product?.VariantInfo?.PriceMax?.PriceWithVatFormatted != null ? product.VariantInfo.PriceMax.PriceWithVatFormatted : "";
564 }
565 if (priceMin != priceMax)
566 {
567 price = priceMin + " - " + priceMax;
568 }
569 var ps = new Dynamicweb.Ecommerce.Products.ProductService();
570 var productObject = ps.GetProductById(product.Id,"",true);
571 var vatGroupCountry = Dynamicweb.Ecommerce.Services.VatGroups.GetVatGroupCountryRelation(productObject.VatGroupId,"AU");
572 double tax = Convert.ToInt32(vatGroupCountry.VatValue);
573 string price = (Convert.ToDouble(product.Price.Price) * ((tax/100)+1)).ToString("0.00");
574 <div class="fs-7 opacity-85 text-price">@price @Translate("Incl. VAT")</div>
575 }
576 </div>
577 }
578