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