Error executing template "Designs/Swift/_parsed/Swift_Page.parsed.cshtml"
System.ArgumentException: Page ID must be greater than 0, but it was 0
at Dynamicweb.Core.Ensure.That[TException](Boolean condition, String message)
at Dynamicweb.Content.ParagraphService.GetParagraphsByPageId(Int32 pageId, ParagraphSort sortBy)
at Dynamicweb.Frontend.Content.GetParagraphs(Int32 pageId)
at Dynamicweb.Frontend.Content.CreateGridContent(Int32 contentId, Boolean ignoreVisualEdit)
at Dynamicweb.Frontend.Content.RenderExternalGrid(Int32 pageId, String container)
at CompiledRazorTemplates.Dynamic.RazorEngine_237f899b529747df91277f0477cd6f09.Execute() in C:\inetpub\wwwroot\AllMedia\Production\Files\Templates\Designs\Swift\_parsed\Swift_Page.parsed.cshtml:line 593
at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
2 @using System
3 @using Dynamicweb
4 @using Dynamicweb.Environment
5 @using Dynamicweb.Frontend
6 @using BrandFusion.Dw.AllMedia.Ecommerce
7 @using Dynamicweb.Ecommerce.Prices
8
9 @functions {
10 string GetCookieOptInPermission(string category)
11 {
12 bool categoryOrAllGranted = false;
13
14 if (CookieManager.IsCookieManagementActive)
15 {
16 var cookieOptInLevel = CookieManager.GetCookieOptInLevel();
17 var cookieOptInCategories = CookieManager.GetCookieOptInCategories();
18 categoryOrAllGranted = cookieOptInCategories.Contains(category) || cookieOptInLevel == CookieOptInLevel.All;
19
20 }
21
22 return categoryOrAllGranted ? "granted" : "denied";
23 }
24
25 bool AllowTracking()
26 {
27 bool allowTracking = true;
28 if (CookieManager.IsCookieManagementActive)
29 {
30 var cookieOptInLevel = CookieManager.GetCookieOptInLevel();
31 var cookieOptInCategories = CookieManager.GetCookieOptInCategories();
32
33 bool consentEither = (cookieOptInCategories.Contains("Statistical") || cookieOptInCategories.Contains("Marketing"));
34 bool consentFunctional = cookieOptInLevel == CookieOptInLevel.Functional;
35 bool consentAtLeastOne = cookieOptInLevel == CookieOptInLevel.All || (consentFunctional && consentEither);
36
37 allowTracking = consentAtLeastOne;
38 }
39 return allowTracking;
40 }
41 }
42
43 @{
44 string swiftVersion = ReadFile("/Files/Templates/Designs/Swift/swift_version.txt");
45 bool renderAsResponsive = Model.Area.Item.GetString("DeviceRendering", "responsive").Equals("responsive", StringComparison.OrdinalIgnoreCase);
46 bool renderMobile = Pageview.Device == Dynamicweb.Frontend.Devices.DeviceType.Mobile || Pageview.Device == Dynamicweb.Frontend.Devices.DeviceType.Tablet;
47 string responsiveClassDesktop = string.Empty;
48 string responsiveClassMobile = string.Empty;
49 if (renderAsResponsive)
50 {
51 responsiveClassDesktop = " d-none d-xl-block";
52 responsiveClassMobile = " d-block d-xl-none";
53 }
54
55 var disableWideBreakpoints = Model.Area?.Item?.GetRawValueString("DisableWideBreakpoints", "default");
56
57 var brandingPageId = Model.Area.Item.GetLink("BrandingPage") != null ? Model.Area.Item.GetLink("BrandingPage").PageId : 0;
58 var themePageId = Model.Area.Item.GetLink("ThemesPage") != null ? Model.Area.Item.GetLink("ThemesPage").PageId : 0;
59 string customHeaderInclude = Model.Area.Item.GetFile("CustomHeaderInclude") != null ? Model.Area.Item.GetFile("CustomHeaderInclude").Name : string.Empty;
60
61 var brandingPage = Dynamicweb.Services.Pages?.GetPage(brandingPageId) ?? null;
62 var themesParagraphLastChanged = Services.Paragraphs.GetParagraphsByPageId(themePageId).OrderByDescending(p => p.Audit.LastModifiedAt).FirstOrDefault();
63
64 var cssLastModified = brandingPage.Audit.LastModifiedAt > themesParagraphLastChanged.Audit.LastModifiedAt ? brandingPage.Audit.LastModifiedAt : themesParagraphLastChanged.Audit.LastModifiedAt;
65 var cssThemeAndBrandingStyleFileInfo = new System.IO.FileInfo(Dynamicweb.Core.SystemInformation.MapPath($"/Files/Templates/Designs/Swift/_parsed/Swift_css/Swift_styles_{Model.Area.ID}.min.css"));
66
67 // Schema.org details for PDP
68 string productId = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString.Get("ProductID")) ? Dynamicweb.Context.Current.Request.QueryString.Get("ProductID") : "";
69 bool isProductDetailsPage = !string.IsNullOrEmpty(productId);
70 bool isArticlePage = Model.ItemType == "Swift_Article";
71 string schemaOrgType = string.Empty;
72
73 string sambaId = Pageview.AreaSettings.GetString("SambaID");
74 string sambaUrl = $"https://yottlyscript.com/script.js?tp={sambaId}";
75 string userId = Pageview.User != null ? Pageview.User.ID.ToString() : "";//ExternalID
76 userId = "\"" + userId +"\"";
77
78 if (isProductDetailsPage)
79 {
80 schemaOrgType = "itemscope=\"\" itemtype=\"https://schema.org/Product\"";
81 }
82
83 if (isArticlePage)
84 {
85 schemaOrgType = "itemscope=\"\" itemtype=\"https://schema.org/Article\"";
86 }
87
88 if (!cssThemeAndBrandingStyleFileInfo.Exists || cssThemeAndBrandingStyleFileInfo.LastWriteTime < brandingPage.Audit.LastModifiedAt)
89 {
90 //Branding page has been saved or the file is missing. Rewrite the file to disc.
91 if (brandingPageId > 0)
92 {
93 var brandingPageview = Dynamicweb.Frontend.PageView.GetPageviewByPageID(brandingPageId);
94 brandingPageview.Redirect = false;
95 brandingPageview.Output();
96 }
97 }
98
99 if (!cssThemeAndBrandingStyleFileInfo.Exists || cssThemeAndBrandingStyleFileInfo.LastWriteTime < themesParagraphLastChanged.Audit.LastModifiedAt)
100 {
101 //Branding page has been saved or the file is missing. Rewrite the file to disc.
102 if (themePageId > 0)
103 {
104 var themePageview = Dynamicweb.Frontend.PageView.GetPageviewByPageID(themePageId);
105 themePageview.Redirect = false;
106 themePageview.Output();
107 }
108 }
109
110 var cssStyleFileInfo = new System.IO.FileInfo(Dynamicweb.Core.SystemInformation.MapPath("/Files/Templates/Designs/Swift/Assets/css/styles.css"));
111 var cssFixFileInfo = new System.IO.FileInfo(Dynamicweb.Core.SystemInformation.MapPath("/Files/Templates/Designs/Swift/Assets/css/fix.css"));
112 var jsFileInfo = new System.IO.FileInfo(Dynamicweb.Core.SystemInformation.MapPath("/Files/Templates/Designs/Swift/Assets/js/scripts.js"));
113
114 string masterTheme = !string.IsNullOrWhiteSpace(Model.Area.Item.GetRawValueString("Theme")) ? " theme " + Model.Area.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : "";
115
116 string favicon = Model.Area.Item.GetFile("Favicon") != null ? Model.Area.Item.GetFile("Favicon").Path : "/Files/Templates/Designs/Swift/Assets/Images/favicon.png";
117
118 string headerCssClass = "sticky-top";
119 bool movePageBehind = false;
120
121 if (Pageview.Page.PropertyItem != null)
122 {
123 headerCssClass = Pageview.Page.PropertyItem["MoveThisPageBehindTheHeader"] != null ? Pageview.Page.PropertyItem["MoveThisPageBehindTheHeader"].ToString() : "sticky-top";
124 movePageBehind = headerCssClass == "fixed-top" && !Pageview.IsVisualEditorMode ? true : false;
125 }
126
127 headerCssClass = headerCssClass == "" ? "sticky-top" : headerCssClass;
128 headerCssClass = Pageview.IsVisualEditorMode ? "" : headerCssClass;
129
130 string googleAnalyticsTrackingID = Model.Area.Item.GetString("GoogleAnalyticsTrackingID");
131 string googleAnalyticsMeasurementID = Model.Area.Item.GetString("GoogleAnalyticsMeasurementID");
132 string googleTagManagerID = Model.Area.Item.GetString("GoogleTagManagerID");
133 var cookieOptInLevel = CookieManager.GetCookieOptInLevel();
134 //bool allowTracking = //cookieOptInLevel == CookieOptInLevel.All || (cookieOptInLevel == CookieOptInLevel.Functional && CookieManager.GetCookieOptInCategories().Contains("Statistical"));
135
136 bool allowTracking = AllowTracking();
137
138 Dynamicweb.Context.Current.Response.AddHeader("link", $"</Files/Templates/Designs/Swift/Assets/css/styles.css?{cssStyleFileInfo.LastWriteTime.Ticks}>; rel=preload; as=style;");
139 Dynamicweb.Context.Current.Response.AddHeader("link", $"</Files/Templates/Designs/Swift/_parsed/Swift_css/Swift_styles_{Model.Area.ID}.min.css?{cssLastModified.Ticks}>; rel=preload; as=style;");
140 Dynamicweb.Context.Current.Response.AddHeader("link", $"</Files/Templates/Designs/Swift/Assets/js/aos.js?{jsFileInfo.LastWriteTime.Ticks}>; rel=preload; as=script;");
141 Dynamicweb.Context.Current.Response.AddHeader("link", $"</Files/Templates/Designs/Swift/Assets/js/scripts.js?{jsFileInfo.LastWriteTime.Ticks}>; rel=preload; as=script;");
142 //Dynamicweb.Context.Current.Response.Flush(); //This sends the headers where we are now in the rendering making the TTFB faster
143
144 SetMetaTags();
145
146 List<Dynamicweb.Content.Page> languages = new List<Dynamicweb.Content.Page>();
147
148 if (Pageview.Area.IsMaster)
149 {
150 languages.Add(Pageview.Page);
151 if (Pageview.Page.Languages != null)
152 {
153 foreach (var language in Pageview.Page.Languages)
154 {
155 languages.Add(language);
156 }
157 }
158 }
159 else
160 {
161 languages.Add(Pageview.Page.MasterPage);
162 if (Pageview.Page.MasterPage != null)
163 {
164 if (Pageview.Page.MasterPage.Languages != null)
165 {
166 foreach (var language in Pageview.Page.MasterPage.Languages)
167 {
168 languages.Add(language);
169 }
170 }
171 }
172 }
173
174 string siteLanguage = Pageview.Area.CultureInfo.Name;
175 Uri url = Dynamicweb.Context.Current.Request.Url;
176 string hostName = url.Host; // domain.com/da-dk or domain.com/en-us
177
178 var ecomCountries = Dynamicweb.Ecommerce.Services.Countries.GetCountries();
179 var ecomCurrencies = Dynamicweb.Ecommerce.Services.Currencies.GetAllCurrencies();
180
181 // Check user address
182 bool isB2B = false;
183 var currentUser = Dynamicweb.Security.UserManagement.User.GetCurrentExtranetUser();
184 if(currentUser != null){
185 string customerNumber = currentUser.CustomerNumber;
186 isB2B = !string.IsNullOrEmpty(customerNumber);
187 }
188 var userB2CAddressFeedPageId = GetPageIdByNavigationTag("Checkuseraddressesb2c").ToString();
189 var userB2BAddressFeedPageId = GetPageIdByNavigationTag("Checkuseraddressesb2b").ToString();
190 var checkB2CUserAddressFeed = currentUser != null && string.IsNullOrEmpty(currentUser.CustomerNumber) && currentUser != null ? $"/Default.aspx?ID={userB2CAddressFeedPageId}" : "";
191 var checkB2BUserAddressFeed = isB2B ? $"/Default.aspx?ID={userB2BAddressFeedPageId}" : "";
192
193 //var userAddressFeedUrl = $"/Default.aspx?ID={userAddressFeedPageId}";
194 }
195
196 <!doctype html>
197 <html lang="@Pageview.Area.CultureInfo.TwoLetterISOLanguageName">
198 <head>
199 <!-- @swiftVersion -->
200 @* Required meta tags *@
201 <meta charset="utf-8">
202 <meta name="viewport" content="height=device-height, width=device-width, initial-scale=1.0">
203 <link rel="shortcut icon" href="@favicon">
204 <link rel="apple-touch-icon" href="@favicon">
205
206
207 @Model.MetaTags
208
209 @{
210 @* Languages meta data *@
211 foreach (var language in languages)
212 {
213 if (language?.Area != null)
214 {
215 if (language != null && language.Published && language.Active && language.Area.Active && language.Area.Published && language.Area.ID != Dynamicweb.Frontend.PageView.Current().AreaID)
216 {
217 if (!string.IsNullOrEmpty(language.Area.DomainLock))
218 {
219 hostName = language.Area.DomainLock; //dk.domain.com or dk-domain.dk
220 }
221 string querystring = $"Default.aspx?ID={language.ID}";
222 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString["GroupID"]))
223 {
224 querystring += $"&GroupID={Dynamicweb.Context.Current.Request.QueryString["GroupID"]}";
225 }
226 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString["ProductID"]))
227 {
228 querystring += $"&ProductID={Dynamicweb.Context.Current.Request.QueryString["ProductID"]}";
229 }
230 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString["VariantID"]))
231 {
232 querystring += $"&VariantID={Dynamicweb.Context.Current.Request.QueryString["VariantID"]}";
233 }
234
235 string friendlyUrl = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(querystring);
236 string href = $"{url.Scheme}://{hostName}{friendlyUrl}";
237
238 <link rel="alternate" hreflang="@language.Area.CultureInfo.Name.ToLower()" href="@href">
239 }
240 }
241 }
242 }
243
244 <title>@Model.Title</title>
245 @* Bootstrap + Swift stylesheet *@
246 <link href="/Files/Templates/Designs/Swift/Assets/css/styles.css?@cssStyleFileInfo.LastWriteTime.Ticks" rel="stylesheet" media="all" type="text/css">
247 <link href="/Files/Templates/Designs/Swift/Assets/css/fix.css?@cssFixFileInfo.LastWriteTime.Ticks" rel="stylesheet" media="all" type="text/css">
248
249 @if (disableWideBreakpoints != "disableBoth")
250 {
251 <style>
252 @@media ( min-width: 1600px ) {
253 .container-xxl,
254 .container-xl,
255 .container-lg,
256 .container-md,
257 .container-sm,
258 .container {
259 max-width: 1520px;
260 }
261 }
262 </style>
263
264 if (disableWideBreakpoints != "disableUltraWideOnly")
265 {
266 <style>
267 @@media ( min-width: 1920px ) {
268 .container-xxl,
269 .container-xl,
270 .container-lg,
271 .container-md,
272 .container-sm,
273 .container {
274 max-width: 1820px;
275 }
276 }
277 </style>
278 }
279 }
280
281 @* Branding and Themes min stylesheet *@
282 <link href="/Files/Templates/Designs/Swift/_parsed/Swift_css/Swift_styles_@(Model.Area.ID).min.css?@cssLastModified.Ticks" rel="stylesheet" media="all" type="text/css" data-last-modified-content="@cssLastModified">
283 <script src="/Files/Templates/Designs/Swift/Assets/js/aos.js?@jsFileInfo.LastWriteTime.Ticks" defer></script>
284 <script src="/Files/Templates/Designs/Swift/Assets/js/scripts.js?@jsFileInfo.LastWriteTime.Ticks" defer></script>
285
286 <script type="module">
287 AOS.init({ offset: 0, duration: 400, delay: 100, easing: 'ease-in-out', mirror: true, disable: window.matchMedia('(prefers-reduced-motion: reduce)') });
288 swift.Scroll.hideHeadersOnScroll();
289 swift.Scroll.handleAlternativeTheme();
290 </script>
291
292
293 @* Google gtag method - always include even if it is not used for anything *@
294 <script>
295 window.dataLayer = window.dataLayer || [];
296 function gtag() { dataLayer.push(arguments); }
297 </script>
298
299 @* Google tag manager *@
300 @if (!string.IsNullOrWhiteSpace(googleTagManagerID))
301 {
302 <script>
303 gtag('consent', 'default', {
304 'ad_storage': 'denied',
305 'ad_user_data': 'denied',
306 'ad_personalization': 'denied',
307 'analytics_storage': 'denied'
308 });
309
310 window.dataLayer.push({
311 'event': 'cookie_cat_functional',
312 'cookie_cat_functional': 'true'
313
314 });
315 </script>
316 <script>
317 (function (w, d, s, l, i) {
318 w[l] = w[l] || []; w[l].push({
319 'gtm.start':
320 new Date().getTime(), event: 'gtm.js'
321 }); var f = d.getElementsByTagName(s)[0],
322 j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src =
323 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f);
324 })(window, document, 'script', 'dataLayer', '@(googleTagManagerID)');
325 </script>
326
327
328 if (allowTracking)
329 {
330 string adConsent = GetCookieOptInPermission("Marketing");
331 string analyticsConsent = GetCookieOptInPermission("Statistical");
332
333 string dataLayerMarketing = adConsent == "granted" ? "'event': 'cookie_cat_marketing','cookie_cat_marketing': 'true'" : "'event': 'cookie_cat_marketing','cookie_cat_marketing': 'false'";
334 string dataLayerStatistical = analyticsConsent == "granted" ? "'event': 'cookie_cat_statistic','cookie_cat_statistic': 'true'" : "'event': 'cookie_cat_statistic','cookie_cat_statistic': 'false'";
335
336 <script>
337 gtag('consent', 'update', {
338 'ad_storage': '@adConsent',
339 'ad_user_data': '@adConsent',
340 'ad_personalization': '@adConsent',
341 'analytics_storage': '@analyticsConsent'
342 });
343
344
345 dataLayer.push({@dataLayerMarketing});
346 dataLayer.push({@dataLayerStatistical});
347
348 </script>
349 } else {
350 <script>
351 window.dataLayer.push({
352 'event': 'cookie_cat_marketing',
353 'cookie_cat_marketing' : 'false'
354
355 });
356 window.dataLayer.push({
357 'event': 'cookie_cat_statistic',
358 'cookie_cat_statistic' : 'false'
359 });
360 </script>
361 }
362 }
363
364
365
366 @* Global site tag (gtag.js) - Google Analytics
367 @if (!string.IsNullOrWhiteSpace(googleAnalyticsTrackingID) && allowTracking)
368 {
369 <script src="https://www.googletagmanager.com/gtag/js?id=@googleAnalyticsTrackingID" async></script>
370 <script>
371 window.dataLayer = window.dataLayer || [];
372 function gtag() { window.dataLayer.push(arguments); }
373 gtag('js', new Date());
374 gtag('config', '@googleAnalyticsTrackingID');
375 </script>
376 }
377
378 @*if (!string.IsNullOrWhiteSpace(googleAnalyticsMeasurementID) && allowTracking)
379 {
380 var GoogleAnalyticsDebugMode = "";
381 bool isLoggedInBackendUser = false;
382
383 if (Dynamicweb.Environment.ExecutingContext.IsAdminLoggedIn())
384 {
385 isLoggedInBackendUser = true;
386 }
387
388 if (Model.Area.Item.GetBoolean("EnableGoogleAnalyticsDebugMode") && @isLoggedInBackendUser)
389 {
390 GoogleAnalyticsDebugMode = ", {'debug_mode': true}";
391 }
392 }
393
394 @if (!string.IsNullOrWhiteSpace(googleTagManagerID) && allowTracking)
395 {
396
397
398 <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
399 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
400 j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
401 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
402 })(window,document,'script','dataLayer','@googleTagManagerID');</script>
403
404
405
406 <script async src="https://www.googletagmanager.com/gtag/js?id=@googleTagManagerID"></script>
407 <script>
408 window.dataLayer = window.dataLayer || [];
409 function gtag() { dataLayer.push(arguments); }
410 gtag('js', new Date());
411 gtag('config', '@googleTagManagerID');
412
413 gtag('consent', 'default', {
414 'ad_storage': 'denied',
415 'ad_user_data': 'denied',
416 'ad_personalization': 'denied',
417 'analytics_storage': 'denied',
418 'functionality_storage': 'denied',
419 'personalization_storage': 'denied',
420 'security_storage': 'denied'
421 });
422
423 </script>
424
425 <noscript><iframe src="[https://www.googletagmanager.com/ns.html?id=@googleTagManagerID"\
426 height="0](https://www.googletagmanager.com/ns.html?id=@googleTagManagerID%22%EF%BF%BCheight=%220)" width="0" style="display:none;visibility:hidden"></iframe></noscript>
427
428 }
429
430
431 @*<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
432 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
433 j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
434 '[https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
435 })(window,document,'script','dataLayer','GTM-5SN32G57');</script>
436
437
438
439 <noscript><iframe src="[https://www.googletagmanager.com/ns.html?id=GTM-5SN32G57"\
440 height="0](https://www.googletagmanager.com/ns.html?id=GTM-5SN32G57%22%EF%BF%BCheight=%220)" width="0" style="display:none;visibility:hidden"></iframe></noscript>*@
441
442
443 @if (!string.IsNullOrWhiteSpace(googleAnalyticsMeasurementID) && allowTracking)
444 {
445 var GoogleAnalyticsDebugMode = "";
446
447 if (Model.Area.Item.GetBoolean("EnableGoogleAnalyticsDebugMode"))
448 {
449 GoogleAnalyticsDebugMode = ", {'debug_mode': true}";
450 }
451
452 <script async src="https://www.googletagmanager.com/gtag/js?id=@googleAnalyticsMeasurementID"></script>
453 <script>
454 gtag('js', new Date());
455 gtag('config', '@googleAnalyticsMeasurementID'@GoogleAnalyticsDebugMode);
456 </script>
457 }
458
459
460 @if (!string.IsNullOrWhiteSpace(customHeaderInclude))
461 {
462 @RenderPartial($"Components/Custom/{customHeaderInclude}")
463 }
464
465
466 @*Reguli noindex no follow pentru pagini produse + parametru sau pagini cautare eq si q*@
467 @{
468 var query = Dynamicweb.Context.Current.Request.QueryString;
469
470 string productIdParam = query.Get("ProductID");
471 string groupIdParam = query.Get("GroupID");
472
473 bool hasProduct = !string.IsNullOrEmpty(productIdParam);
474 bool hasGroup = !string.IsNullOrEmpty(groupIdParam);
475
476 int paramCount = query.Count; // câți parametri are query-ul total
477
478 bool noIndex = false;
479
480
481 if (hasProduct && !hasGroup && paramCount > 2){ //id-ul paginii + productid + altceva
482 noIndex = true;
483 }
484 else if (hasGroup && !hasProduct && paramCount > 2) //id-ul paginii + GroupID + altceva
485 {
486 noIndex = true;
487 }
488 else if (hasGroup && hasProduct && paramCount > 3) { //id-ulpaginii + groupid + productid + altceva
489 noIndex = true;
490 }
491
492 if (noIndex && (hasGroup || hasProduct))
493 {
494 <meta name="robots" content="noindex,follow" />
495 }
496 //regula pentru eq si q
497 if (!string.IsNullOrEmpty(query.Get("q")) || !string.IsNullOrEmpty(query.Get("eq")))
498 {
499 noIndex = true;
500 }
501
502 if (noIndex && (!string.IsNullOrEmpty(query.Get("q")) || !string.IsNullOrEmpty(query.Get("eq"))))
503 {
504 <meta name="robots" content="noindex,follow" />
505 }
506 }
507
508
509
510 </head>
511
512 @{
513 string cartServicePageId = GetPageIdByNavigationTag("CartService").ToString();
514 string cartSummaryPageId = GetPageIdByNavigationTag("CartSummary").ToString();
515 string allCAtegoriesPageID = GetPageIdByNavigationTag("AllCategories").ToString();
516 string profileCartActionsPageId = GetPageIdByNavigationTag("CartProfilesActions").ToString();
517 }
518
519 <body
520 class="brand @(masterTheme)"
521 id="page@(Model.ID)"
522 data-checkUserAddressB2C="@checkB2CUserAddressFeed"
523 data-checkUserAddressB2B="@checkB2BUserAddressFeed"
524 data-cartService-pageid="@cartServicePageId"
525 data-cartSummary-pageid="@cartSummaryPageId"
526 data-allcategories-pageid="@allCAtegoriesPageID"
527 data-profileCartAction-pageid="@profileCartActionsPageId"
528 >
529 @*Samba Id*@
530 @if (!string.IsNullOrWhiteSpace(sambaId))
531 {
532 <script async src="@sambaUrl" referrerpolicy="origin-when-cross-origin"></script>
533 }
534
535 @if (renderAsResponsive || !renderMobile)
536 {
537 <header class="page-header @headerCssClass top-0@(responsiveClassDesktop)" id="page-header-desktop">
538 @if (@Model.Area.Item.GetLink("HeaderDesktop") != null)
539 {
540 @RenderGrid(@Model.Area.Item.GetLink("HeaderDesktop").PageId)
541 }
542 </header>
543 }
544
545 @if ((renderAsResponsive || renderMobile))
546 {
547 <header class="page-header @headerCssClass top-0@(responsiveClassMobile)" id="page-header-mobile">
548 @if (@Model.Area.Item.GetLink("HeaderMobile") != null)
549 {
550 @RenderGrid(@Model.Area.Item.GetLink("HeaderMobile").PageId)
551 }
552 </header>
553 }
554
555 <main id="content" @(schemaOrgType)>
556 <div data-intersect></div>
557 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
558 @using System
559 @using Dynamicweb.Ecommerce.ProductCatalog
560
561
562 @{
563 string productIdFromUrl = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString.Get("ProductID")) ? Dynamicweb.Context.Current.Request.QueryString.Get("ProductID") : string.Empty;
564 bool isProductDetail = !string.IsNullOrEmpty(productIdFromUrl) && Pageview.Page.NavigationTag.ToLower() == "shop";
565
566 bool isArticlePagePage = Model.ItemType == "Swift_Article";
567 string schemaOrgProp = string.Empty;
568 if(isArticlePagePage)
569 {
570 schemaOrgProp = "itemprop=\"articleBody\"";
571 }
572
573 string theme = "";
574 string gridContent = "";
575
576 if (Model.PropertyItem != null)
577 {
578 theme = !string.IsNullOrWhiteSpace(Model.PropertyItem.GetRawValueString("Theme")) ? " theme " + Model.PropertyItem.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : "";
579 }
580
581 if (Model.Item != null || Pageview.IsVisualEditorMode)
582 {
583 if (!isProductDetail)
584 {
585 gridContent = Model.Grid("Grid", "Grid", "default:true;sort:1", "Page");
586 }
587 else
588 {
589 var productObject = Dynamicweb.Ecommerce.Products.Product.GetProductById(productIdFromUrl);
590 var detailPage = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(productObject.PrimaryGroupId)?.Meta.PrimaryPage ?? string.Empty;
591 var detailPageId = detailPage != string.Empty ? Convert.ToInt16(detailPage.Substring(detailPage.LastIndexOf('=') + 1)) : GetPageIdByNavigationTag("ProductDetailPage");
592
593 @RenderGrid(detailPageId)
594 }
595 }
596
597 bool doNotRenderPage = false;
598
599 //Check if we are on the poduct detail page, and if there is data to render
600 ProductViewModel product = new ProductViewModel();
601 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails"))
602 {
603 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"];
604 if (string.IsNullOrEmpty(product.Id)) {
605 doNotRenderPage = true;
606 }
607 }
608
609 //Render the page
610 if (!doNotRenderPage) {
611 string itemIdentifier = Model?.Item?.SystemName != null ? "item_" + Model.Item.SystemName.ToLower() : "item_Swift_Page";
612
613 if (theme != "")
614 {
615 <div class="@theme item_@itemIdentifier" @schemaOrgProp>
616 @gridContent
617 </div>
618 }
619 else
620 {
621 <div class="item_@itemIdentifier" @schemaOrgProp>
622 @gridContent
623 </div>
624 }
625 } else {
626 <div class="container">
627 <div class="alert alert-info" role="alert">@Translate("Sorry. There is nothing to view here")</div>
628 </div>
629 }
630
631 if (!Model.IsCurrentUserAllowed)
632 {
633 int signInPage = GetPageIdByNavigationTag("SignInPage");
634 int dashboardPage = GetPageIdByNavigationTag("MyAccountDashboardPage");
635
636 if (!Pageview.IsVisualEditorMode)
637 {
638 if (signInPage != 0)
639 {
640 if (signInPage != Model.ID) {
641 Dynamicweb.Context.Current.Response.Redirect("/Default.aspx?ID=" + signInPage);
642 } else {
643 if (dashboardPage != 0) {
644 Dynamicweb.Context.Current.Response.Redirect("/Default.aspx?ID=" + dashboardPage);
645 } else {
646 Dynamicweb.Context.Current.Response.Redirect("/");
647 }
648 }
649 }
650 else
651 {
652 <div class="alert alert-dark m-0" role="alert">
653 <span>@Translate("You do not have access to this page")</span>
654 </div>
655 }
656 }
657 else
658 {
659 <div class="alert alert-dark m-0" role="alert">
660 <span>@Translate("To work on this page, you must be signed in, in the frontend")</span>
661 </div>
662 }
663 }
664 }
665
666 </main>
667
668 @if (renderAsResponsive || !renderMobile)
669 {
670 <footer class="page-footer@(responsiveClassDesktop)" id="page-footer-desktop">
671 @if (@Model.Area.Item.GetLink("FooterDesktop") != null)
672 {
673 @RenderGrid(@Model.Area.Item.GetLink("FooterDesktop").PageId)
674 }
675 </footer>
676 }
677
678 @if (renderAsResponsive || renderMobile)
679 {
680 <footer class="page-footer@(responsiveClassMobile)" id="page-footer-mobile">
681 @if (@Model.Area.Item.GetLink("FooterMobile") != null)
682 {
683 @RenderGrid(@Model.Area.Item.GetLink("FooterMobile").PageId)
684 }
685 </footer>
686 }
687
688 @* Render any offcanvas menu here *@
689 @RenderSnippet("offcanvas")
690
691 @{
692 bool isErpConnectionDown = false;//!Dynamicweb.Ecommerce.DynamicwebLiveIntegration.TemplatesHelper.IsWebServiceConnectionAvailable();
693 }
694
695 @* Language selector modal *@
696 @if (languages.Count > 1 || ecomCountries.Count > 1 || ecomCurrencies.Count() > 1)
697 {
698 <div class="modal fade" id="PreferencesModal" tabindex="-1" aria-hidden="true">
699 <div class="modal-dialog modal-dialog-centered modal-sm" id="PreferencesModalContent">
700 @* The content here comes from an external request *@
701 </div>
702 </div>
703 }
704
705 @* Favorite toast *@
706 <div aria-live="polite" aria-atomic="true">
707 <div class="position-fixed bottom-0 end-0 p-3" style="z-index: 11">
708 <div id="favoriteNotificationToast" class="toast" role="alert" aria-live="assertive" aria-atomic="true">
709 <div class="toast-header">
710 <strong class="me-auto">@Translate("Favorite list updated")</strong>
711 <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
712 </div>
713 <div class="toast-body d-flex gap-3">
714 <div id="favoriteNotificationToast_Image"></div>
715 <div id="favoriteNotificationToast_Text"></div>
716 </div>
717 </div>
718 </div>
719 </div>
720
721 @* Modal for dynamic content *@
722 <div class="modal fade js-product" id="DynamicModal" tabindex="-1" aria-hidden="true">
723 <div class="modal-dialog modal-dialog-centered modal-md">
724 <div class="modal-content theme light" id="DynamicModalContent">
725 @* The content here comes from an external request *@
726 </div>
727 </div>
728 </div>
729
730 @* Offcanvas for dynamic content *@
731 <div class="offcanvas offcanvas-end theme light" tabindex="-1" id="DynamicOffcanvas" style="width: 30rem">
732 @* The content here comes from an external request *@
733 </div>
734
735 @if (isErpConnectionDown && Model.Area.Item.GetBoolean("ShowErpDownMessage"))
736 {
737 string erpDownMessageTheme = !string.IsNullOrWhiteSpace(Model.Area.Item.GetRawValueString("ErpDownMessageTheme")) ? " theme " + Model.Area.Item.GetRawValueString("ErpDownMessageTheme").Replace(" ", "").Trim().ToLower() : "theme light";
738
739 <div class="position-fixed bottom-0 end-0 p-3" style="z-index: 1040">
740 <div class="toast fade show border-0 @erpDownMessageTheme" role="alert" aria-live="assertive" aria-atomic="true">
741 <div class="toast-header">
742 <strong class="me-auto">@Translate("Connection down")</strong>
743 <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
744 </div>
745 <div class="toast-body">
746 @Translate("We are experiencing some connectivity issues. Not all features may be available to you.")
747 </div>
748 </div>
749 </div>
750 }
751
752 @if (!string.IsNullOrWhiteSpace(sambaId))
753 {
754 <script>
755 var _yottlyOnload = _yottlyOnload || []
756 _yottlyOnload.push(function() {
757 var userID = @userId;
758 var cartLayer = dataLayer.find(function (layer) { return layer.event === 'checkout' });
759 //var orderPage = cartLayer.ecommerce.purchase.actionField.revenue ? true : false;
760 if (cartLayer && cartLayer.ecommerce && cartLayer.ecommerce.checkout) {
761 console.log("cart found");
762 diffAnalytics.cartInteraction({
763 content: cartLayer.ecommerce.checkout.products.map(function(product) {
764 return {
765 productId: product.number,
766 amount: product.quantity
767 }
768 })
769 //onOrderPage: true
770 })
771 }
772 //if (cartLayer && cartLayer.ecommerce && cartLayer.ecommerce.customer && cartLayer.ecommerce.customer.userid) {
773 //diffAnalytics.customerLoggedIn(cartLayer.ecommerce.customer.userid)
774 //}
775
776 if(userID)
777 {
778 diffAnalytics.customerLoggedIn(userID);
779 }
780
781 var purchaseLayer = dataLayer.find(function(layer) {return (!!layer.ecommerce && !!layer.ecommerce.purchase)})
782 if (purchaseLayer) {
783 diffAnalytics.order({
784 content: purchaseLayer.ecommerce.purchase.products.map(function(product) {
785 return {
786 productId: product.number,
787 price: product.quantity * Number(product.price.replace(',', '.')),
788 }
789 })
790 //onOrderPage: true
791 })
792 }
793 })
794 </script>
795 }
796
797
798 </body>
799 </html>
800 @functions {
801 void SetMetaTags()
802 {
803 //Verification Tokens
804 string siteVerificationGoogle = Model.Area.Item.GetString("Google_Site_Verification") != null ? Model.Area.Item.GetString("Google_Site_Verification") : "";
805 //string siteVerificationYandex = Model.Area.Item.GetString("Yandex_Verification") != null ? Model.Area.Item.GetString("Yandex_Verification") : "";
806 //string siteVerificationMS = Model.Area.Item.GetString("Msvalidate_01") != null ? Model.Area.Item.GetString("Msvalidate_01") : "";
807 //string siteVerificationAlexa = Model.Area.Item.GetString("AlexaVerifyID") != null ? Model.Area.Item.GetString("AlexaVerifyID") : "";
808 //string siteVerificationPinterest = Model.Area.Item.GetString("P_domain_verify") != null ? Model.Area.Item.GetString("P_domain_verify") : "";
809 //string siteVerificationNorton = Model.Area.Item.GetString("Norton_safeweb_site_verification") != null ? Model.Area.Item.GetString("Norton_safeweb_site_verification") : "";
810
811 //Generic Site Values
812 string openGraphFacebookAppID = Model.Area.Item.GetString("Fb_app_id") != null ? Model.Area.Item.GetString("Fb_app_id") : "";
813 string openGraphType = Model.Area.Item.GetString("Open_Graph_Type") != null ? Model.Area.Item.GetString("Open_Graph_Type") : "";
814 string openGraphSiteName = Model.Area.Item.GetString("Open_Graph_Site_Name") != null ? Model.Area.Item.GetString("Open_Graph_Site_Name") : "";
815
816 string twitterCardSite = Model.Area.Item.GetString("Twitter_Site") != null ? Model.Area.Item.GetString("Twitter_Site") : "";
817
818 //Page specific values
819 string openGraphSiteTitle = Model.Area.Item.GetString("Open_Graph_Title") != null ? Model.Area.Item.GetString("Open_Graph_Title") : "";
820 FileViewModel openGraphImage = Model.Area.Item.GetFile("Open_Graph_Image");
821 string openGraphImageALT = Model.Area.Item.GetString("Open_Graph_Image_ALT") != null ? Model.Area.Item.GetString("Open_Graph_Image_ALT") : "";
822 string openGraphDescription = Model.Area.Item.GetString("Open_Graph_Description") != null ? Model.Area.Item.GetString("Open_Graph_Description") : "";
823
824 string twitterCardURL = Model.Area.Item.GetString("Twitter_URL") != null ? Model.Area.Item.GetString("Twitter_URL") : "";
825 string twitterCardTitle = Model.Area.Item.GetString("Twitter_Title") != null ? Model.Area.Item.GetString("Twitter_Title") : "";
826 string twitterCardDescription = Model.Area.Item.GetString("Twitter_Description") != null ? Model.Area.Item.GetString("Twitter_Description") : "";
827 FileViewModel twitterCardImage = Model.Area.Item.GetFile("Twitter_Image");
828 string twitterCardImageALT = Model.Area.Item.GetString("Twitter_Image_ALT") != null ? Model.Area.Item.GetString("Twitter_Image_ALT") : "";
829
830 if (!string.IsNullOrEmpty(siteVerificationGoogle))
831 {
832 Pageview.Meta.AddTag("google-site-verification", siteVerificationGoogle);
833 }
834
835 if (!string.IsNullOrEmpty(openGraphFacebookAppID))
836 {
837 Pageview.Meta.AddTag("fb:app_id", openGraphFacebookAppID);
838 }
839
840 if (!string.IsNullOrEmpty(openGraphType))
841 {
842 Pageview.Meta.AddTag("og:type", openGraphType);
843 }
844
845 if (!string.IsNullOrEmpty(openGraphSiteName))
846 {
847 Pageview.Meta.AddTag("og:site_name", openGraphSiteName);
848 }
849
850 if (!string.IsNullOrEmpty(Model.Title))
851 {
852 Pageview.Meta.AddTag("og:title", Model.Title);
853 }
854 else
855 {
856 Pageview.Meta.AddTag("og:title", openGraphSiteTitle);
857 }
858
859 if (!string.IsNullOrEmpty(Pageview.Page.TopImage) && openGraphImage == null)
860 {
861 Pageview.Meta.AddTag("og:image", Dynamicweb.Context.Current.Request.Url.Scheme + "://" + Dynamicweb.Context.Current.Request.Url.Host + Pageview.Page.TopImage);
862 }
863
864 if (string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString["ProductID"]))
865 {
866 if (!string.IsNullOrEmpty(Model.Description))
867 {
868 Pageview.Meta.AddTag("og:description", Model.Description);
869 }
870 else
871 {
872 Pageview.Meta.AddTag("og:description", openGraphDescription);
873 }
874 if (openGraphImage != null)
875 {
876 Pageview.Meta.AddTag("og:image", openGraphImage.Path);
877 }
878
879 if (!string.IsNullOrEmpty(openGraphImageALT))
880 {
881 Pageview.Meta.AddTag("og:image:alt", openGraphImageALT);
882 }
883 if (!string.IsNullOrEmpty(twitterCardDescription))
884 {
885 Pageview.Meta.AddTag("twitter:description", twitterCardDescription);
886 }
887
888 if (twitterCardImage != null)
889 {
890 Pageview.Meta.AddTag("twitter:image", twitterCardImage.Path);
891 }
892
893 if (!string.IsNullOrEmpty(twitterCardImageALT))
894 {
895 Pageview.Meta.AddTag("twitter:image:alt", twitterCardImageALT);
896 }
897 }
898
899 if (!string.IsNullOrEmpty(twitterCardSite))
900 {
901 Pageview.Meta.AddTag("twitter:site", twitterCardSite);
902 }
903
904 if (!string.IsNullOrEmpty(twitterCardURL))
905 {
906 Pageview.Meta.AddTag("twitter:url", twitterCardURL);
907 }
908
909 if (!string.IsNullOrEmpty(twitterCardTitle))
910 {
911 Pageview.Meta.AddTag("twitter:title", twitterCardTitle);
912 }
913 }
914 }
915
916 @*{
917 bool consentIsGranted = System.Web.HttpContext.Current.Request?.Cookies["Dynamicweb.CookieOptInLevel"]?.Value == "2";
918 }
919
920 @if (consentIsGranted)
921 {
922 <script>
923 document.addEventListener("DOMContentLoaded", function() {
924 consentGranted();
925 });
926 </script>
927 }
928
929 <script>
930 function consentGranted() {
931 gtag('consent', 'update', {
932 'ad_storage': 'granted',
933 'ad_user_data': 'granted',
934 'ad_personalization': 'granted',
935 'analytics_storage': 'granted',
936 'functionality_storage': 'granted',
937 'personalization_storage': 'granted',
938 'security_storage': 'granted'
939 });
940 }
941 </script>
942 *@
943
944 <script>
945 function resetSelect(button) {
946 var container = button.closest('.selection-wrapper');
947 if (container) {
948 var selectElement = container.querySelector('select');
949 if (selectElement) {
950 selectElement.value = "-1";
951 selectElement.dispatchEvent(new Event('change', { bubbles: true }));
952 }
953 }
954 }
955 </script>
956
957
958
959
960 @RenderModalAddToCart()
961 @RenderModalStepQuantity()
962 @RenderModalStockNoty()
963 @RenderModalMultiAddToCart()
964 @RenderModalCartErrors()
965 @RenderModalAddAddressB2B()
966
967
968 @helper RenderModalAddToCart() {
969
970 string iconPath = "/Files/Templates/Designs/Swift/Assets/icons/";
971 int cartPageId = GetPageIdByNavigationTag("CartPage");
972 string cartPageUrl= "Default.aspx?ID=" + cartPageId;
973
974 <div class="modal fade" id="AddtoCartModal" tabindex="-1" aria-labelledby="AddtoCartModalLabel" aria-hidden="true">
975 <div class="modal-dialog modal-dialog-centered">
976 <div class="modal-content p-4">
977 <div class="modal-header border-0 align-items-start">
978 <div class="addtocartmodal__modal-title h5" id="AddtoCartModalLabel">@Translate("Pridané do košíka")</div>
979 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
980 </div>
981 <div class="modal-body">
982 <div class="grid mb-3">
983 <div class="g-col-4">
984 <div class="addtocartmodal__product-image text-center"><img src="" alt="product title"/></div>
985 </div>
986 <div class="g-col-8">
987 <div class="addtocartmodal__product-title h5 fs-6 mb-1"></div>
988 @*<div class="addtocartmodal__product-stock custom-stock pos fs-7"></div>*@
989 </div>
990 </div>
991 <div class="grid grid-1">
992 <div class="g-col-12 pt-3 border-top">
993 <div class="addtocartmodal__product-shipping-information custom-green"></div>
994 </div>
995 <div class="g-col-12 addtocart_stock-notification d-none custom-orange fw-bold d-flex align-items-center gap-2">
996 <span class="fs-5">@ReadFile(iconPath + "alert-triangle.svg")</span><span class="fs-7">@Translate("Stock notification")</span>
997 </div>
998 </div>
999 </div>
1000 <div class="modal-footer d-flex flex-column border-0">
1001 <a href="@cartPageUrl" class="btn btn-primary p-2 m-0 mb-2 w-100" >@Translate("Prejsť do košíka")</a>
1002 <button type="button" class="btn btn-secondary p-2 m-0 w-100" data-bs-dismiss="modal"><span class="me-2">@ReadFile(iconPath + "arrow-left.svg")</span>@Translate("Pokračovať v nákupe")</button>
1003 </div>
1004 </div>
1005 </div>
1006 </div>
1007 }
1008 <!-- Modal -->
1009
1010 @helper RenderModalStepQuantity() {
1011
1012 string iconPath = "/Files/Templates/Designs/Swift/Assets/icons/";
1013
1014 <div class="modal fade" id="StepQuantityModal" tabindex="-1" aria-labelledby="StepQuantityModalLabel" aria-hidden="true">
1015 <div class="modal-dialog modal-dialog-centered">
1016 <div class="modal-content p-4">
1017 <div class="modal-header border-0 p-0 align-items-start">
1018 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
1019 </div>
1020 <div class="modal-body">
1021 <div class="grid mb-3">
1022 <div class="g-col-12">
1023 <div class="stepquantitymodal__message"></div>
1024 </div>
1025 </div>
1026 </div>
1027 </div>
1028 </div>
1029 </div>
1030 }
1031 <!-- Modal -->
1032
1033
1034 @helper RenderModalStockNoty() {
1035
1036 string iconPath = "/Files/Templates/Designs/Swift/Assets/icons/";
1037 string productPageId = GetPageIdByNavigationTag("Shop").ToString();
1038 string createNotificationText = Translate("createnotification", "Create notification");
1039 var productLanguageID = Dynamicweb.Ecommerce.Common.Context.LanguageID;
1040
1041 <div class="modal fade" id="StockNotifyModal" tabindex="-1" aria-labelledby="StockNotifyModalLabel" aria-hidden="true">
1042 <div class="modal-dialog modal-dialog-centered">
1043 <div class="modal-content p-4">
1044 <div class="modal-header border-0 align-items-start">
1045 <div class="stocknotify__modal-title h5" id="StockNotifyModalLabel">@Translate("getNotification", "Find out when product is back on stock")</div>
1046 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
1047 </div>
1048 <div class="modal-body">
1049 <div class="grid mb-3">
1050 <div class="g-col-12 form-stock-noty-wrapper">
1051 <form name="" id="NotificationForm_" method="post" class="u-margin-auto grid__col-auto-width" action="/Default.aspx?ID=@productPageId">
1052 <input type="hidden" name="ProductID" id="ProductID" value="" />
1053 <input type="hidden" name="VariantID" id="VariantID" value="" />
1054 <input type="hidden" name="LanguageID" id="LanguageID" value="@productLanguageID" />
1055 <input type="hidden" name="CartCmd" id="CartCmd" value="createnotificationforthisproduct" />
1056
1057
1058 <div class="g-col-12">
1059 <div class="form-floating">
1060 <input type="email" class="form-control" name="NotificationEmail" id="NotificationEmail" value="" placeholder="@Translate("Email")">
1061 <label for="EcomOrderDeliveryEmail">@Translate("Email")</label>
1062 </div>
1063 </div>
1064 <button type="submit" value="@createNotificationText" class="btn btn-primary w-100 mt-2 stocknotify__send-trigger">@Translate("Send")</button>
1065 </form>
1066 </div>
1067 <div class="g-col-12 stock-notify-sent-success d-none">
1068 <h4 class="h5 custom-green"><span class="me-1">@ReadFile(iconPath + "check-circle-green.svg")</span>@Translate("stock notify sent")</h4>
1069 </div>
1070 <div class="g-col-12 stock-notify-sent-error d-none">
1071 <h4 class="h5 custom-red" style="color: red;"><span class="me-1">@ReadFile(iconPath + "x-square-red.svg")</span>@Translate("stock notify error")</h4>
1072 </div>
1073 </div>
1074 </div>
1075 </div>
1076 </div>
1077 </div>
1078 }
1079 @helper RenderModalMultiAddToCart() {
1080
1081 string iconPath = "/Files/Templates/Designs/Swift/Assets/icons/";
1082 int cartPageId = GetPageIdByNavigationTag("CartPage");
1083 string cartPageUrl= "Default.aspx?ID=" + cartPageId;
1084
1085 <div class="modal fade" id="MultiAddtoCartModal" tabindex="-1" aria-labelledby="MultiAddtoCartModalLabel" aria-hidden="true">
1086 <div class="modal-dialog modal-dialog-centered">
1087 <div class="modal-content p-4">
1088 <div class="modal-header border-0 align-items-start">
1089 <div class="multiaddtocartmodal__modal-title h5" id="MultiAddtoCartModalLabel">@Translate("Pridané do košíka")</div>
1090 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
1091 </div>
1092 <div class="modal-body">
1093 @* insert code with javascript*@
1094 <div class="modal-body_template">
1095 </div>
1096 <div class="modal-body-shipping__information custom-green">
1097 </div>
1098 <div class="addtocart_stock-notification d-none">
1099 @Translate("Stock notification")
1100 </div>
1101 </div>
1102 <div class="modal-footer d-flex flex-column border-0">
1103 <a href="@cartPageUrl" class="btn btn-primary p-2 m-0 mb-2 w-100" >@Translate("Prejsť do košíka")</a>
1104 <button type="button" class="btn btn-secondary p-2 m-0 w-100" data-bs-dismiss="modal"><span class="me-2">@ReadFile(iconPath + "arrow-left.svg")</span>@Translate("Pokračovať v nákupe")</button>
1105 </div>
1106 </div>
1107 </div>
1108 </div>
1109 }
1110 <!-- Modal -->
1111
1112 @helper RenderModalCartErrors() {
1113
1114 string iconPath = "/Files/Templates/Designs/Swift/Assets/icons/";
1115
1116 <div class="modal fade" id="CartErrorsModal" tabindex="-1" aria-labelledby="CartErrorsModalLabel" aria-hidden="true">
1117 <div class="modal-dialog modal-dialog-centered">
1118 <div class="modal-content p-4">
1119 <div class="modal-header border-0 p-0 align-items-start">
1120 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
1121 </div>
1122 <div class="modal-body" data-select-address="@Translate("Select delivery address")" data-select-payment="@Translate("Select payment method")" data-select-shipping="@Translate("Select shipping method")">
1123 <div class="grid mb-3">
1124 <div class="g-col-12">
1125 <div
1126 class="cartErrorsmodal__message d-flex gap-2 align-items-center"
1127 data-email-format-msg="@Translate("The email must be in the correct format")"
1128 data-tel-format-msg="@Translate("The phone number must be in the correct format")"
1129 >
1130 <span>@ReadFile(iconPath + "alert-triangle-red.svg")</span><span class="error-text">@Translate("Fill all required fields")</span>
1131 </div>
1132 </div>
1133 </div>
1134 </div>
1135 </div>
1136 </div>
1137 </div>
1138 }
1139 <!-- Modal -->
1140
1141 @helper RenderModalAddAddressB2B() {
1142
1143 var currentUser = Dynamicweb.Security.UserManagement.User.GetCurrentExtranetUser();
1144 string userEmail = "";
1145 if(currentUser != null ){
1146 userEmail = currentUser.Email;
1147 }
1148
1149 var currentAreaId = Pageview.Area.ID;
1150 string countryCode = currentAreaId == 27 ? "SK" : "CZ";
1151 string countryName = currentAreaId == 27 ? "Slovensko" : "Česká republika";
1152
1153
1154
1155 <div class="modal fade" id="AddAddressB2BModal" tabindex="-1" aria-labelledby="AddAddressB2BModalLabel" aria-hidden="true">
1156 <div class="modal-dialog modal-dialog-centered">
1157 <div class="modal-content p-4">
1158 <div class="modal-header border-0 align-items-start">
1159 <div class="addaddressb2bmodal__modal-title h5" id="AddAddressB2BModalLabel"></div>
1160 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
1161 </div>
1162 <div class="modal-body">
1163 <form id="FormSendAddress">
1164 <div class="grid gap-3">
1165 <input type="hidden" name="isShipping" id="isShipping" value="true"/>
1166 <input type="hidden" id="UserManagement_Form_Email" name="email" value="@userEmail"/>
1167 <input type="hidden" name="id" id="id" value="">
1168
1169 <div class="g-col-12">
1170 <div class="form-floating">
1171 <input type="text" class="form-control" placeholder="@Translate("Description")" id="description" name="description" value="" required>
1172 <label for="description" class="form-label">@Translate("Description")<span class="is-required">*</span></label>
1173 </div>
1174 </div>
1175 <div class="g-col-12">
1176 <div class="form-floating">
1177 <input type="text" class="form-control" placeholder="@Translate("Name and surname")" id="name" name="name" value="" required>
1178 <label for="name" class="form-label">@Translate("Name and surname")<span class="is-required">*</span></label>
1179 </div>
1180 </div>
1181 <div class="g-col-12">
1182 <div class="form-floating">
1183 <input type="text" class="form-control" placeholder="@Translate("Address")" id="address" name="address" value="" required>
1184 <label for="address" class="form-label">@Translate("Address")<span class="is-required">*</span></label>
1185 </div>
1186 </div>
1187 <div class="g-col-12">
1188 <div class="form-floating">
1189 <input type="text" class="form-control" placeholder="@Translate("Town / City")" id="city" name="city" value="" required>
1190 <label for="city" class="form-label">@Translate("Town / City")<span class="is-required">*</span></label>
1191 </div>
1192 </div>
1193 <div class="g-col-12 g-col-lg-6">
1194 <div class="form-floating">
1195 <input type="text" class="form-control" placeholder="@Translate("Zip")" id="zip" name="zip" value="" required>
1196 <label for="zip" class="form-label">@Translate("Zip code")<span class="is-required">*</span></label>
1197 </div>
1198 </div>
1199 <div class="g-col-12 g-col-lg-6">
1200 <div class="form-floating">
1201 <input type="tel" class="form-control" placeholder="@Translate("Phone")" id="phone" name="phone" value="" maxlength="12" data-minlength="10" data-tel-format-msg="@Translate("The phone number must be in the correct format")" required>
1202 <label for="phone" class="form-label">@Translate("Phone number")<span class="is-required">*</span></label>
1203 </div>
1204 </div>
1205 <div class="g-col-12">
1206 <div class="form-floating">
1207 <input type="hidden" name="countryCodeValue" id="countryCodeValue" value="@countryCode">
1208 <input type="text" class="form-control" id="countryCode" value="@countryName" placeholder="Krajina" disabled="disabled">
1209 <label for="countryCode" class="form-label">@Translate("Country")</label>
1210 </div>
1211 </div>
1212 <div class="g-col-12">
1213 <div class="form-check">
1214 <input class="form-check-input" type="checkbox" id="isDefault" name="isDefault">
1215 <label class="form-check-label" for="isDefault">
1216 @Translate("Set this address as your default address")
1217 </label>
1218 </div>
1219 </div>
1220 <div class="g-col-12 text-end mt-2">
1221 <button type="submit" class="btn btn-primary" id="submitAddress" data-successmessage="Adresa bola uložená" data-errormessage="Vyskytla sa chyba, skúste to znova" name="Submit">@Translate("Send")</button>
1222 </div>
1223 </div>
1224 </form>
1225 <div class="sendAddressSuccess custom-green d-none">@Translate("Adresa bola uložená")</div>
1226 <div class="sendAddressError custom-alert d-none">@Translate("Vyskytla sa chyba, skúste to znova")</div>
1227 </div>
1228 </div>
1229 </div>
1230 </div>
1231 }