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