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_9a92419c45c444f49cf8b9e5f23442b1.Execute() in C:\inetpub\wwwroot\AllMedia\Production\Files\Templates\Designs\Swift\_parsed\Swift_Page.parsed.cshtml:line 591
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 int paramCount = query.Count; // câți parametri are query-ul total
475
476 bool noIndex = false;
477
478
479 if (hasProduct && !hasGroup && paramCount > 2){ //id-ul paginii + productid + altceva
480 noIndex = true;
481 }
482 else if (hasGroup && !hasProduct && paramCount > 2) //id-ul paginii + GroupID + altceva
483 {
484 noIndex = true;
485 }
486 else if (hasGroup && hasProduct && paramCount > 3) { //id-ulpaginii + groupid + productid + altceva
487 noIndex = true;
488 }
489
490 if (noIndex && (hasGroup || hasProduct))
491 {
492 <meta name="robots" content="noindex,nofollow" />
493 }
494 //regula pentru eq si q
495 if (!string.IsNullOrEmpty(query.Get("q")) || !string.IsNullOrEmpty(query.Get("eq")))
496 {
497 noIndex = true;
498 }
499
500 if (noIndex && (!string.IsNullOrEmpty(query.Get("q")) || !string.IsNullOrEmpty(query.Get("eq"))))
501 {
502 <meta name="robots" content="noindex,nofollow" />
503 }
504 }
505
506
507
508 </head>
509
510 @{
511 string cartServicePageId = GetPageIdByNavigationTag("CartService").ToString();
512 string cartSummaryPageId = GetPageIdByNavigationTag("CartSummary").ToString();
513 string allCAtegoriesPageID = GetPageIdByNavigationTag("AllCategories").ToString();
514 string profileCartActionsPageId = GetPageIdByNavigationTag("CartProfilesActions").ToString();
515 }
516
517 <body
518 class="brand @(masterTheme)"
519 id="page@(Model.ID)"
520 data-checkUserAddressB2C="@checkB2CUserAddressFeed"
521 data-checkUserAddressB2B="@checkB2BUserAddressFeed"
522 data-cartService-pageid="@cartServicePageId"
523 data-cartSummary-pageid="@cartSummaryPageId"
524 data-allcategories-pageid="@allCAtegoriesPageID"
525 data-profileCartAction-pageid="@profileCartActionsPageId"
526 >
527 @*Samba Id*@
528 @if (!string.IsNullOrWhiteSpace(sambaId))
529 {
530 <script async src="@sambaUrl" referrerpolicy="origin-when-cross-origin"></script>
531 }
532
533 @if (renderAsResponsive || !renderMobile)
534 {
535 <header class="page-header @headerCssClass top-0@(responsiveClassDesktop)" id="page-header-desktop">
536 @if (@Model.Area.Item.GetLink("HeaderDesktop") != null)
537 {
538 @RenderGrid(@Model.Area.Item.GetLink("HeaderDesktop").PageId)
539 }
540 </header>
541 }
542
543 @if ((renderAsResponsive || renderMobile))
544 {
545 <header class="page-header @headerCssClass top-0@(responsiveClassMobile)" id="page-header-mobile">
546 @if (@Model.Area.Item.GetLink("HeaderMobile") != null)
547 {
548 @RenderGrid(@Model.Area.Item.GetLink("HeaderMobile").PageId)
549 }
550 </header>
551 }
552
553 <main id="content" @(schemaOrgType)>
554 <div data-intersect></div>
555 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
556 @using System
557 @using Dynamicweb.Ecommerce.ProductCatalog
558
559
560 @{
561 string productIdFromUrl = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString.Get("ProductID")) ? Dynamicweb.Context.Current.Request.QueryString.Get("ProductID") : string.Empty;
562 bool isProductDetail = !string.IsNullOrEmpty(productIdFromUrl) && Pageview.Page.NavigationTag.ToLower() == "shop";
563
564 bool isArticlePagePage = Model.ItemType == "Swift_Article";
565 string schemaOrgProp = string.Empty;
566 if(isArticlePagePage)
567 {
568 schemaOrgProp = "itemprop=\"articleBody\"";
569 }
570
571 string theme = "";
572 string gridContent = "";
573
574 if (Model.PropertyItem != null)
575 {
576 theme = !string.IsNullOrWhiteSpace(Model.PropertyItem.GetRawValueString("Theme")) ? " theme " + Model.PropertyItem.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : "";
577 }
578
579 if (Model.Item != null || Pageview.IsVisualEditorMode)
580 {
581 if (!isProductDetail)
582 {
583 gridContent = Model.Grid("Grid", "Grid", "default:true;sort:1", "Page");
584 }
585 else
586 {
587 var productObject = Dynamicweb.Ecommerce.Products.Product.GetProductById(productIdFromUrl);
588 var detailPage = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(productObject.PrimaryGroupId)?.Meta.PrimaryPage ?? string.Empty;
589 var detailPageId = detailPage != string.Empty ? Convert.ToInt16(detailPage.Substring(detailPage.LastIndexOf('=') + 1)) : GetPageIdByNavigationTag("ProductDetailPage");
590
591 @RenderGrid(detailPageId)
592 }
593 }
594
595 bool doNotRenderPage = false;
596
597 //Check if we are on the poduct detail page, and if there is data to render
598 ProductViewModel product = new ProductViewModel();
599 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails"))
600 {
601 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"];
602 if (string.IsNullOrEmpty(product.Id)) {
603 doNotRenderPage = true;
604 }
605 }
606
607 //Render the page
608 if (!doNotRenderPage) {
609 string itemIdentifier = Model?.Item?.SystemName != null ? "item_" + Model.Item.SystemName.ToLower() : "item_Swift_Page";
610
611 if (theme != "")
612 {
613 <div class="@theme item_@itemIdentifier" @schemaOrgProp>
614 @gridContent
615 </div>
616 }
617 else
618 {
619 <div class="item_@itemIdentifier" @schemaOrgProp>
620 @gridContent
621 </div>
622 }
623 } else {
624 <div class="container">
625 <div class="alert alert-info" role="alert">@Translate("Sorry. There is nothing to view here")</div>
626 </div>
627 }
628
629 if (!Model.IsCurrentUserAllowed)
630 {
631 int signInPage = GetPageIdByNavigationTag("SignInPage");
632 int dashboardPage = GetPageIdByNavigationTag("MyAccountDashboardPage");
633
634 if (!Pageview.IsVisualEditorMode)
635 {
636 if (signInPage != 0)
637 {
638 if (signInPage != Model.ID) {
639 Dynamicweb.Context.Current.Response.Redirect("/Default.aspx?ID=" + signInPage);
640 } else {
641 if (dashboardPage != 0) {
642 Dynamicweb.Context.Current.Response.Redirect("/Default.aspx?ID=" + dashboardPage);
643 } else {
644 Dynamicweb.Context.Current.Response.Redirect("/");
645 }
646 }
647 }
648 else
649 {
650 <div class="alert alert-dark m-0" role="alert">
651 <span>@Translate("You do not have access to this page")</span>
652 </div>
653 }
654 }
655 else
656 {
657 <div class="alert alert-dark m-0" role="alert">
658 <span>@Translate("To work on this page, you must be signed in, in the frontend")</span>
659 </div>
660 }
661 }
662 }
663
664 </main>
665
666 @if (renderAsResponsive || !renderMobile)
667 {
668 <footer class="page-footer@(responsiveClassDesktop)" id="page-footer-desktop">
669 @if (@Model.Area.Item.GetLink("FooterDesktop") != null)
670 {
671 @RenderGrid(@Model.Area.Item.GetLink("FooterDesktop").PageId)
672 }
673 </footer>
674 }
675
676 @if (renderAsResponsive || renderMobile)
677 {
678 <footer class="page-footer@(responsiveClassMobile)" id="page-footer-mobile">
679 @if (@Model.Area.Item.GetLink("FooterMobile") != null)
680 {
681 @RenderGrid(@Model.Area.Item.GetLink("FooterMobile").PageId)
682 }
683 </footer>
684 }
685
686 @* Render any offcanvas menu here *@
687 @RenderSnippet("offcanvas")
688
689 @{
690 bool isErpConnectionDown = false;//!Dynamicweb.Ecommerce.DynamicwebLiveIntegration.TemplatesHelper.IsWebServiceConnectionAvailable();
691 }
692
693 @* Language selector modal *@
694 @if (languages.Count > 1 || ecomCountries.Count > 1 || ecomCurrencies.Count() > 1)
695 {
696 <div class="modal fade" id="PreferencesModal" tabindex="-1" aria-hidden="true">
697 <div class="modal-dialog modal-dialog-centered modal-sm" id="PreferencesModalContent">
698 @* The content here comes from an external request *@
699 </div>
700 </div>
701 }
702
703 @* Favorite toast *@
704 <div aria-live="polite" aria-atomic="true">
705 <div class="position-fixed bottom-0 end-0 p-3" style="z-index: 11">
706 <div id="favoriteNotificationToast" class="toast" role="alert" aria-live="assertive" aria-atomic="true">
707 <div class="toast-header">
708 <strong class="me-auto">@Translate("Favorite list updated")</strong>
709 <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
710 </div>
711 <div class="toast-body d-flex gap-3">
712 <div id="favoriteNotificationToast_Image"></div>
713 <div id="favoriteNotificationToast_Text"></div>
714 </div>
715 </div>
716 </div>
717 </div>
718
719 @* Modal for dynamic content *@
720 <div class="modal fade js-product" id="DynamicModal" tabindex="-1" aria-hidden="true">
721 <div class="modal-dialog modal-dialog-centered modal-md">
722 <div class="modal-content theme light" id="DynamicModalContent">
723 @* The content here comes from an external request *@
724 </div>
725 </div>
726 </div>
727
728 @* Offcanvas for dynamic content *@
729 <div class="offcanvas offcanvas-end theme light" tabindex="-1" id="DynamicOffcanvas" style="width: 30rem">
730 @* The content here comes from an external request *@
731 </div>
732
733 @if (isErpConnectionDown && Model.Area.Item.GetBoolean("ShowErpDownMessage"))
734 {
735 string erpDownMessageTheme = !string.IsNullOrWhiteSpace(Model.Area.Item.GetRawValueString("ErpDownMessageTheme")) ? " theme " + Model.Area.Item.GetRawValueString("ErpDownMessageTheme").Replace(" ", "").Trim().ToLower() : "theme light";
736
737 <div class="position-fixed bottom-0 end-0 p-3" style="z-index: 1040">
738 <div class="toast fade show border-0 @erpDownMessageTheme" role="alert" aria-live="assertive" aria-atomic="true">
739 <div class="toast-header">
740 <strong class="me-auto">@Translate("Connection down")</strong>
741 <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
742 </div>
743 <div class="toast-body">
744 @Translate("We are experiencing some connectivity issues. Not all features may be available to you.")
745 </div>
746 </div>
747 </div>
748 }
749
750 @if (!string.IsNullOrWhiteSpace(sambaId))
751 {
752 <script>
753 var _yottlyOnload = _yottlyOnload || []
754 _yottlyOnload.push(function() {
755 var userID = @userId;
756 var cartLayer = dataLayer.find(function (layer) { return layer.event === 'checkout' });
757 //var orderPage = cartLayer.ecommerce.purchase.actionField.revenue ? true : false;
758 if (cartLayer && cartLayer.ecommerce && cartLayer.ecommerce.checkout) {
759 console.log("cart found");
760 diffAnalytics.cartInteraction({
761 content: cartLayer.ecommerce.checkout.products.map(function(product) {
762 return {
763 productId: product.number,
764 amount: product.quantity
765 }
766 })
767 //onOrderPage: true
768 })
769 }
770 //if (cartLayer && cartLayer.ecommerce && cartLayer.ecommerce.customer && cartLayer.ecommerce.customer.userid) {
771 //diffAnalytics.customerLoggedIn(cartLayer.ecommerce.customer.userid)
772 //}
773
774 if(userID)
775 {
776 diffAnalytics.customerLoggedIn(userID);
777 }
778
779 var purchaseLayer = dataLayer.find(function(layer) {return (!!layer.ecommerce && !!layer.ecommerce.purchase)})
780 if (purchaseLayer) {
781 diffAnalytics.order({
782 content: purchaseLayer.ecommerce.purchase.products.map(function(product) {
783 return {
784 productId: product.number,
785 price: product.quantity * Number(product.price.replace(',', '.')),
786 }
787 })
788 //onOrderPage: true
789 })
790 }
791 })
792 </script>
793 }
794
795
796 </body>
797 </html>
798 @functions {
799 void SetMetaTags()
800 {
801 //Verification Tokens
802 string siteVerificationGoogle = Model.Area.Item.GetString("Google_Site_Verification") != null ? Model.Area.Item.GetString("Google_Site_Verification") : "";
803 //string siteVerificationYandex = Model.Area.Item.GetString("Yandex_Verification") != null ? Model.Area.Item.GetString("Yandex_Verification") : "";
804 //string siteVerificationMS = Model.Area.Item.GetString("Msvalidate_01") != null ? Model.Area.Item.GetString("Msvalidate_01") : "";
805 //string siteVerificationAlexa = Model.Area.Item.GetString("AlexaVerifyID") != null ? Model.Area.Item.GetString("AlexaVerifyID") : "";
806 //string siteVerificationPinterest = Model.Area.Item.GetString("P_domain_verify") != null ? Model.Area.Item.GetString("P_domain_verify") : "";
807 //string siteVerificationNorton = Model.Area.Item.GetString("Norton_safeweb_site_verification") != null ? Model.Area.Item.GetString("Norton_safeweb_site_verification") : "";
808
809 //Generic Site Values
810 string openGraphFacebookAppID = Model.Area.Item.GetString("Fb_app_id") != null ? Model.Area.Item.GetString("Fb_app_id") : "";
811 string openGraphType = Model.Area.Item.GetString("Open_Graph_Type") != null ? Model.Area.Item.GetString("Open_Graph_Type") : "";
812 string openGraphSiteName = Model.Area.Item.GetString("Open_Graph_Site_Name") != null ? Model.Area.Item.GetString("Open_Graph_Site_Name") : "";
813
814 string twitterCardSite = Model.Area.Item.GetString("Twitter_Site") != null ? Model.Area.Item.GetString("Twitter_Site") : "";
815
816 //Page specific values
817 string openGraphSiteTitle = Model.Area.Item.GetString("Open_Graph_Title") != null ? Model.Area.Item.GetString("Open_Graph_Title") : "";
818 FileViewModel openGraphImage = Model.Area.Item.GetFile("Open_Graph_Image");
819 string openGraphImageALT = Model.Area.Item.GetString("Open_Graph_Image_ALT") != null ? Model.Area.Item.GetString("Open_Graph_Image_ALT") : "";
820 string openGraphDescription = Model.Area.Item.GetString("Open_Graph_Description") != null ? Model.Area.Item.GetString("Open_Graph_Description") : "";
821
822 string twitterCardURL = Model.Area.Item.GetString("Twitter_URL") != null ? Model.Area.Item.GetString("Twitter_URL") : "";
823 string twitterCardTitle = Model.Area.Item.GetString("Twitter_Title") != null ? Model.Area.Item.GetString("Twitter_Title") : "";
824 string twitterCardDescription = Model.Area.Item.GetString("Twitter_Description") != null ? Model.Area.Item.GetString("Twitter_Description") : "";
825 FileViewModel twitterCardImage = Model.Area.Item.GetFile("Twitter_Image");
826 string twitterCardImageALT = Model.Area.Item.GetString("Twitter_Image_ALT") != null ? Model.Area.Item.GetString("Twitter_Image_ALT") : "";
827
828 if (!string.IsNullOrEmpty(siteVerificationGoogle))
829 {
830 Pageview.Meta.AddTag("google-site-verification", siteVerificationGoogle);
831 }
832
833 if (!string.IsNullOrEmpty(openGraphFacebookAppID))
834 {
835 Pageview.Meta.AddTag("fb:app_id", openGraphFacebookAppID);
836 }
837
838 if (!string.IsNullOrEmpty(openGraphType))
839 {
840 Pageview.Meta.AddTag("og:type", openGraphType);
841 }
842
843 if (!string.IsNullOrEmpty(openGraphSiteName))
844 {
845 Pageview.Meta.AddTag("og:site_name", openGraphSiteName);
846 }
847
848 if (!string.IsNullOrEmpty(Model.Title))
849 {
850 Pageview.Meta.AddTag("og:title", Model.Title);
851 }
852 else
853 {
854 Pageview.Meta.AddTag("og:title", openGraphSiteTitle);
855 }
856
857 if (!string.IsNullOrEmpty(Pageview.Page.TopImage) && openGraphImage == null)
858 {
859 Pageview.Meta.AddTag("og:image", Dynamicweb.Context.Current.Request.Url.Scheme + "://" + Dynamicweb.Context.Current.Request.Url.Host + Pageview.Page.TopImage);
860 }
861
862 if (string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString["ProductID"]))
863 {
864 if (!string.IsNullOrEmpty(Model.Description))
865 {
866 Pageview.Meta.AddTag("og:description", Model.Description);
867 }
868 else
869 {
870 Pageview.Meta.AddTag("og:description", openGraphDescription);
871 }
872 if (openGraphImage != null)
873 {
874 Pageview.Meta.AddTag("og:image", openGraphImage.Path);
875 }
876
877 if (!string.IsNullOrEmpty(openGraphImageALT))
878 {
879 Pageview.Meta.AddTag("og:image:alt", openGraphImageALT);
880 }
881 if (!string.IsNullOrEmpty(twitterCardDescription))
882 {
883 Pageview.Meta.AddTag("twitter:description", twitterCardDescription);
884 }
885
886 if (twitterCardImage != null)
887 {
888 Pageview.Meta.AddTag("twitter:image", twitterCardImage.Path);
889 }
890
891 if (!string.IsNullOrEmpty(twitterCardImageALT))
892 {
893 Pageview.Meta.AddTag("twitter:image:alt", twitterCardImageALT);
894 }
895 }
896
897 if (!string.IsNullOrEmpty(twitterCardSite))
898 {
899 Pageview.Meta.AddTag("twitter:site", twitterCardSite);
900 }
901
902 if (!string.IsNullOrEmpty(twitterCardURL))
903 {
904 Pageview.Meta.AddTag("twitter:url", twitterCardURL);
905 }
906
907 if (!string.IsNullOrEmpty(twitterCardTitle))
908 {
909 Pageview.Meta.AddTag("twitter:title", twitterCardTitle);
910 }
911 }
912 }
913
914 @*{
915 bool consentIsGranted = System.Web.HttpContext.Current.Request?.Cookies["Dynamicweb.CookieOptInLevel"]?.Value == "2";
916 }
917
918 @if (consentIsGranted)
919 {
920 <script>
921 document.addEventListener("DOMContentLoaded", function() {
922 consentGranted();
923 });
924 </script>
925 }
926
927 <script>
928 function consentGranted() {
929 gtag('consent', 'update', {
930 'ad_storage': 'granted',
931 'ad_user_data': 'granted',
932 'ad_personalization': 'granted',
933 'analytics_storage': 'granted',
934 'functionality_storage': 'granted',
935 'personalization_storage': 'granted',
936 'security_storage': 'granted'
937 });
938 }
939 </script>
940 *@
941
942 <script>
943 function resetSelect(button) {
944 var container = button.closest('.selection-wrapper');
945 if (container) {
946 var selectElement = container.querySelector('select');
947 if (selectElement) {
948 selectElement.value = "-1";
949 selectElement.dispatchEvent(new Event('change', { bubbles: true }));
950 }
951 }
952 }
953 </script>
954
955
956
957
958 @RenderModalAddToCart()
959 @RenderModalStepQuantity()
960 @RenderModalStockNoty()
961 @RenderModalMultiAddToCart()
962 @RenderModalCartErrors()
963 @RenderModalAddAddressB2B()
964
965
966 @helper RenderModalAddToCart() {
967
968 string iconPath = "/Files/Templates/Designs/Swift/Assets/icons/";
969 int cartPageId = GetPageIdByNavigationTag("CartPage");
970 string cartPageUrl= "Default.aspx?ID=" + cartPageId;
971
972 <div class="modal fade" id="AddtoCartModal" tabindex="-1" aria-labelledby="AddtoCartModalLabel" aria-hidden="true">
973 <div class="modal-dialog modal-dialog-centered">
974 <div class="modal-content p-4">
975 <div class="modal-header border-0 align-items-start">
976 <div class="addtocartmodal__modal-title h5" id="AddtoCartModalLabel">@Translate("Pridané do košíka")</div>
977 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
978 </div>
979 <div class="modal-body">
980 <div class="grid mb-3">
981 <div class="g-col-4">
982 <div class="addtocartmodal__product-image text-center"><img src="" alt="product title"/></div>
983 </div>
984 <div class="g-col-8">
985 <div class="addtocartmodal__product-title h5 fs-6 mb-1"></div>
986 @*<div class="addtocartmodal__product-stock custom-stock pos fs-7"></div>*@
987 </div>
988 </div>
989 <div class="grid grid-1">
990 <div class="g-col-12 pt-3 border-top">
991 <div class="addtocartmodal__product-shipping-information custom-green"></div>
992 </div>
993 </div>
994 </div>
995 <div class="modal-footer d-flex flex-column border-0">
996 <a href="@cartPageUrl" class="btn btn-primary p-2 m-0 mb-2 w-100" >@Translate("Prejsť do košíka")</a>
997 <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>
998 </div>
999 </div>
1000 </div>
1001 </div>
1002 }
1003 <!-- Modal -->
1004
1005 @helper RenderModalStepQuantity() {
1006
1007 string iconPath = "/Files/Templates/Designs/Swift/Assets/icons/";
1008
1009 <div class="modal fade" id="StepQuantityModal" tabindex="-1" aria-labelledby="StepQuantityModalLabel" aria-hidden="true">
1010 <div class="modal-dialog modal-dialog-centered">
1011 <div class="modal-content p-4">
1012 <div class="modal-header border-0 p-0 align-items-start">
1013 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
1014 </div>
1015 <div class="modal-body">
1016 <div class="grid mb-3">
1017 <div class="g-col-12">
1018 <div class="stepquantitymodal__message"></div>
1019 </div>
1020 </div>
1021 </div>
1022 </div>
1023 </div>
1024 </div>
1025 }
1026 <!-- Modal -->
1027
1028
1029 @helper RenderModalStockNoty() {
1030
1031 string iconPath = "/Files/Templates/Designs/Swift/Assets/icons/";
1032 string productPageId = GetPageIdByNavigationTag("Shop").ToString();
1033 string createNotificationText = Translate("createnotification", "Create notification");
1034 var productLanguageID = Dynamicweb.Ecommerce.Common.Context.LanguageID;
1035
1036 <div class="modal fade" id="StockNotifyModal" tabindex="-1" aria-labelledby="StockNotifyModalLabel" aria-hidden="true">
1037 <div class="modal-dialog modal-dialog-centered">
1038 <div class="modal-content p-4">
1039 <div class="modal-header border-0 align-items-start">
1040 <div class="stocknotify__modal-title h5" id="StockNotifyModalLabel">@Translate("getNotification", "Find out when product is back on stock")</div>
1041 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
1042 </div>
1043 <div class="modal-body">
1044 <div class="grid mb-3">
1045 <div class="g-col-12 form-stock-noty-wrapper">
1046 <form name="" id="NotificationForm_" method="post" class="u-margin-auto grid__col-auto-width" action="/Default.aspx?ID=@productPageId">
1047 <input type="hidden" name="ProductID" id="ProductID" value="" />
1048 <input type="hidden" name="VariantID" id="VariantID" value="" />
1049 <input type="hidden" name="LanguageID" id="LanguageID" value="@productLanguageID" />
1050 <input type="hidden" name="CartCmd" id="CartCmd" value="createnotificationforthisproduct" />
1051
1052
1053 <div class="g-col-12">
1054 <div class="form-floating">
1055 <input type="email" class="form-control" name="NotificationEmail" id="NotificationEmail" value="" placeholder="@Translate("Email")">
1056 <label for="EcomOrderDeliveryEmail">@Translate("Email")</label>
1057 </div>
1058 </div>
1059 <button type="submit" value="@createNotificationText" class="btn btn-primary w-100 mt-2 stocknotify__send-trigger">@Translate("Send")</button>
1060 </form>
1061 </div>
1062 <div class="g-col-12 stock-notify-sent-success d-none">
1063 <h4 class="h5 custom-green"><span class="me-1">@ReadFile(iconPath + "check-circle-green.svg")</span>@Translate("stock notify sent")</h4>
1064 </div>
1065 <div class="g-col-12 stock-notify-sent-error d-none">
1066 <h4 class="h5 custom-red" style="color: red;"><span class="me-1">@ReadFile(iconPath + "x-square-red.svg")</span>@Translate("stock notify error")</h4>
1067 </div>
1068 </div>
1069 </div>
1070 </div>
1071 </div>
1072 </div>
1073 }
1074 @helper RenderModalMultiAddToCart() {
1075
1076 string iconPath = "/Files/Templates/Designs/Swift/Assets/icons/";
1077 int cartPageId = GetPageIdByNavigationTag("CartPage");
1078 string cartPageUrl= "Default.aspx?ID=" + cartPageId;
1079
1080 <div class="modal fade" id="MultiAddtoCartModal" tabindex="-1" aria-labelledby="MultiAddtoCartModalLabel" aria-hidden="true">
1081 <div class="modal-dialog modal-dialog-centered">
1082 <div class="modal-content p-4">
1083 <div class="modal-header border-0 align-items-start">
1084 <div class="multiaddtocartmodal__modal-title h5" id="MultiAddtoCartModalLabel">@Translate("Pridané do košíka")</div>
1085 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
1086 </div>
1087 <div class="modal-body">
1088 @* insert code with javascript*@
1089 <div class="modal-body_template">
1090 </div>
1091 <div class="modal-body-shipping__information custom-green">
1092 </div>
1093 </div>
1094 <div class="modal-footer d-flex flex-column border-0">
1095 <a href="@cartPageUrl" class="btn btn-primary p-2 m-0 mb-2 w-100" >@Translate("Prejsť do košíka")</a>
1096 <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>
1097 </div>
1098 </div>
1099 </div>
1100 </div>
1101 }
1102 <!-- Modal -->
1103
1104 @helper RenderModalCartErrors() {
1105
1106 string iconPath = "/Files/Templates/Designs/Swift/Assets/icons/";
1107
1108 <div class="modal fade" id="CartErrorsModal" tabindex="-1" aria-labelledby="CartErrorsModalLabel" aria-hidden="true">
1109 <div class="modal-dialog modal-dialog-centered">
1110 <div class="modal-content p-4">
1111 <div class="modal-header border-0 p-0 align-items-start">
1112 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
1113 </div>
1114 <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")">
1115 <div class="grid mb-3">
1116 <div class="g-col-12">
1117 <div
1118 class="cartErrorsmodal__message d-flex gap-2 align-items-center"
1119 data-email-format-msg="@Translate("The email must be in the correct format")"
1120 data-tel-format-msg="@Translate("The phone number must be in the correct format")"
1121 >
1122 <span>@ReadFile(iconPath + "alert-triangle-red.svg")</span><span class="error-text">@Translate("Fill all required fields")</span>
1123 </div>
1124 </div>
1125 </div>
1126 </div>
1127 </div>
1128 </div>
1129 </div>
1130 }
1131 <!-- Modal -->
1132
1133 @helper RenderModalAddAddressB2B() {
1134
1135 var currentUser = Dynamicweb.Security.UserManagement.User.GetCurrentExtranetUser();
1136 string userEmail = "";
1137 if(currentUser != null ){
1138 userEmail = currentUser.Email;
1139 }
1140
1141 var currentAreaId = Pageview.Area.ID;
1142 string countryCode = currentAreaId == 27 ? "SK" : "CZ";
1143 string countryName = currentAreaId == 27 ? "Slovensko" : "Česká republika";
1144
1145
1146
1147 <div class="modal fade" id="AddAddressB2BModal" tabindex="-1" aria-labelledby="AddAddressB2BModalLabel" aria-hidden="true">
1148 <div class="modal-dialog modal-dialog-centered">
1149 <div class="modal-content p-4">
1150 <div class="modal-header border-0 align-items-start">
1151 <div class="addaddressb2bmodal__modal-title h5" id="AddAddressB2BModalLabel"></div>
1152 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
1153 </div>
1154 <div class="modal-body">
1155 <form id="FormSendAddress">
1156 <div class="grid gap-3">
1157 <input type="hidden" name="isShipping" id="isShipping" value="true"/>
1158 <input type="hidden" id="UserManagement_Form_Email" name="email" value="@userEmail"/>
1159 <input type="hidden" name="id" id="id" value="">
1160
1161 <div class="g-col-12">
1162 <div class="form-floating">
1163 <input type="text" class="form-control" placeholder="@Translate("Description")" id="description" name="description" value="" required>
1164 <label for="description" class="form-label">@Translate("Description")<span class="is-required">*</span></label>
1165 </div>
1166 </div>
1167 <div class="g-col-12">
1168 <div class="form-floating">
1169 <input type="text" class="form-control" placeholder="@Translate("Name and surname")" id="name" name="name" value="" required>
1170 <label for="name" class="form-label">@Translate("Name and surname")<span class="is-required">*</span></label>
1171 </div>
1172 </div>
1173 <div class="g-col-12">
1174 <div class="form-floating">
1175 <input type="text" class="form-control" placeholder="@Translate("Address")" id="address" name="address" value="" required>
1176 <label for="address" class="form-label">@Translate("Address")<span class="is-required">*</span></label>
1177 </div>
1178 </div>
1179 <div class="g-col-12">
1180 <div class="form-floating">
1181 <input type="text" class="form-control" placeholder="@Translate("Town / City")" id="city" name="city" value="" required>
1182 <label for="city" class="form-label">@Translate("Town / City")<span class="is-required">*</span></label>
1183 </div>
1184 </div>
1185 <div class="g-col-12 g-col-lg-6">
1186 <div class="form-floating">
1187 <input type="text" class="form-control" placeholder="@Translate("Zip")" id="zip" name="zip" value="" required>
1188 <label for="zip" class="form-label">@Translate("Zip code")<span class="is-required">*</span></label>
1189 </div>
1190 </div>
1191 <div class="g-col-12 g-col-lg-6">
1192 <div class="form-floating">
1193 <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>
1194 <label for="phone" class="form-label">@Translate("Phone number")<span class="is-required">*</span></label>
1195 </div>
1196 </div>
1197 <div class="g-col-12">
1198 <div class="form-floating">
1199 <input type="hidden" name="countryCodeValue" id="countryCodeValue" value="@countryCode">
1200 <input type="text" class="form-control" id="countryCode" value="@countryName" placeholder="Krajina" disabled="disabled">
1201 <label for="countryCode" class="form-label">@Translate("Country")</label>
1202 </div>
1203 </div>
1204 <div class="g-col-12">
1205 <div class="form-check">
1206 <input class="form-check-input" type="checkbox" id="isDefault" name="isDefault">
1207 <label class="form-check-label" for="isDefault">
1208 @Translate("Set this address as your default address")
1209 </label>
1210 </div>
1211 </div>
1212 <div class="g-col-12 text-end mt-2">
1213 <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>
1214 </div>
1215 </div>
1216 </form>
1217 <div class="sendAddressSuccess custom-green d-none">@Translate("Adresa bola uložená")</div>
1218 <div class="sendAddressError custom-alert d-none">@Translate("Vyskytla sa chyba, skúste to znova")</div>
1219 </div>
1220 </div>
1221 </div>
1222 </div>
1223 }