Error executing template "Designs/Swift/_parsed/Swift_Page.parsed.cshtml"
System.Data.SqlClient.SqlException (0x80131904): Connection Timeout Expired.  The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement.  This could be because the pre-login handshake failed or the server was unable to respond back in time.  The duration spent while attempting to connect to this server was - [Pre-Login] initialization=476; handshake=14969;  ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.Open()
   at Dynamicweb.Data.DatabaseConnectionProvider.CreateConnection(Boolean open)
   at Dynamicweb.Data.Database.CreateConnection()
   at Dynamicweb.Data.Database.CreateDataReader(CommandBuilder commandBuilder, IDbConnection connection, IDbTransaction transaction, Int32 commandTimeout)
   at Dynamicweb.Ecommerce.Products.ProductRepository.GetProductById(String productId, String productVariantId, String productLanguageId)
   at Dynamicweb.Ecommerce.Products.ProductService.FetchMissingProductsInternal(IProductRepository repo, IEnumerable`1 keys)
   at Dynamicweb.Caching.ServiceCache`2.GetCache(IEnumerable`1 keys)
   at Dynamicweb.Caching.ServiceCache`2.GetCache(TKey key)
   at Dynamicweb.Ecommerce.Products.ProductService.GetProductById(String productId, String productVariantId, String productLanguageId, User user, Boolean showUntranslated)
   at Dynamicweb.Ecommerce.Products.ProductService.GetProductById(String productId, String productVariantId, String productLanguageId, Boolean useAssortments)
   at Dynamicweb.Ecommerce.Products.Product.GetProductById(String productId)
   at CompiledRazorTemplates.Dynamic.RazorEngine_768cdcf95b9649c0b7bebd13c4b58202.Execute() in D:\dynamicweb.net\Solutions\Altex Holding\altexrtc.cloud.dynamicweb-cms.com\Files\Templates\Designs\Swift\_parsed\Swift_Page.parsed.cshtml:line 468
   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()
ClientConnectionId:edacdaf9-6ee3-42bf-8a2a-372a3447960a
Error Number:-2,State:0,Class:11

1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 2 @using System 3 @using System.Web; 4 @using Dynamicweb 5 @using Dynamicweb.Environment 6 @using Dynamicweb.Frontend 7 8 @{ 9 string swiftVersion = ReadFile("/Files/Templates/Designs/Swift/swift_version.txt"); 10 bool renderAsResponsive = Model.Area.Item.GetString("DeviceRendering", "responsive").Equals("responsive", StringComparison.OrdinalIgnoreCase); 11 bool renderMobile = Pageview.Device == Dynamicweb.Frontend.Devices.DeviceType.Mobile || Pageview.Device == Dynamicweb.Frontend.Devices.DeviceType.Tablet; 12 string responsiveClassDesktop = string.Empty; 13 string responsiveClassMobile = string.Empty; 14 if (renderAsResponsive) 15 { 16 responsiveClassDesktop = " d-none d-xl-block"; 17 responsiveClassMobile = " d-block d-xl-none"; 18 } 19 20 var disableWideBreakpoints = Model.Area?.Item?.GetRawValueString("DisableWideBreakpoints", "default"); 21 22 var brandingPageId = Model.Area.Item.GetLink("BrandingPage") != null ? Model.Area.Item.GetLink("BrandingPage").PageId : 0; 23 var themePageId = Model.Area.Item.GetLink("ThemesPage") != null ? Model.Area.Item.GetLink("ThemesPage").PageId : 0; 24 string customHeaderInclude = Model.Area.Item.GetFile("CustomHeaderInclude") != null ? Model.Area.Item.GetFile("CustomHeaderInclude").Name : string.Empty; 25 26 var brandingPage = Dynamicweb.Services.Pages?.GetPage(brandingPageId) ?? null; 27 var themesParagraphLastChanged = Services.Paragraphs.GetParagraphsByPageId(themePageId).OrderByDescending(p => p.Audit.LastModifiedAt).FirstOrDefault(); 28 29 var cssLastModified = brandingPage.Audit.LastModifiedAt > themesParagraphLastChanged.Audit.LastModifiedAt ? brandingPage.Audit.LastModifiedAt : themesParagraphLastChanged.Audit.LastModifiedAt; 30 var cssThemeAndBrandingStyleFileInfo = new System.IO.FileInfo(Dynamicweb.Core.SystemInformation.MapPath($"/Files/Templates/Designs/Swift/_parsed/Swift_css/Swift_styles_{Model.Area.ID}.min.css")); 31 32 // Schema.org details for PDP 33 string productId = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString.Get("ProductID")) ? Dynamicweb.Context.Current.Request.QueryString.Get("ProductID") : ""; 34 bool isProductDetailsPage = !string.IsNullOrEmpty(productId); 35 bool isArticlePage = Model.ItemType == "Swift_Article"; 36 string schemaOrgType = string.Empty; 37 int homepageId = GetPageIdByNavigationTag("Homepage"); 38 string isHomePage = Model.ID == homepageId ? "is-homepage" : ""; 39 40 if (isProductDetailsPage) 41 { 42 schemaOrgType = "itemscope=\"\" itemtype=\"https://schema.org/Product\""; 43 } 44 45 if (isArticlePage) 46 { 47 schemaOrgType = "itemscope=\"\" itemtype=\"https://schema.org/Article\""; 48 } 49 50 if (!cssThemeAndBrandingStyleFileInfo.Exists || cssThemeAndBrandingStyleFileInfo.LastWriteTime < brandingPage.Audit.LastModifiedAt) 51 { 52 //Branding page has been saved or the file is missing. Rewrite the file to disc. 53 if (brandingPageId > 0) 54 { 55 var brandingPageview = Dynamicweb.Frontend.PageView.GetPageviewByPageID(brandingPageId); 56 brandingPageview.Redirect = false; 57 brandingPageview.Output(); 58 } 59 } 60 61 if (!cssThemeAndBrandingStyleFileInfo.Exists || cssThemeAndBrandingStyleFileInfo.LastWriteTime < themesParagraphLastChanged.Audit.LastModifiedAt) 62 { 63 //Branding page has been saved or the file is missing. Rewrite the file to disc. 64 if (themePageId > 0) 65 { 66 var themePageview = Dynamicweb.Frontend.PageView.GetPageviewByPageID(themePageId); 67 themePageview.Redirect = false; 68 themePageview.Output(); 69 } 70 } 71 72 var cssStyleFileInfo = new System.IO.FileInfo(Dynamicweb.Core.SystemInformation.MapPath("/Files/Templates/Designs/Swift/Assets/css/styles.css")); 73 var jsFileInfo = new System.IO.FileInfo(Dynamicweb.Core.SystemInformation.MapPath("/Files/Templates/Designs/Swift/Assets/js/scripts.js")); 74 75 76 77 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 var cookieOptInLevel = CookieManager.GetCookieOptInLevel(); 98 bool allowTracking = cookieOptInLevel == CookieOptInLevel.All || (cookieOptInLevel == CookieOptInLevel.Functional && CookieManager.GetCookieOptInCategories().Contains("Statistical")); 99 100 Dynamicweb.Context.Current.Response.AddHeader("link", $"</Files/Templates/Designs/Swift/Assets/css/styles.css?{cssStyleFileInfo.LastWriteTime.Ticks}>; rel=preload; as=style;"); 101 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;"); 102 Dynamicweb.Context.Current.Response.AddHeader("link", $"</Files/Templates/Designs/Swift/Assets/js/aos.js?{jsFileInfo.LastWriteTime.Ticks}; rel=preload; as=script;"); 103 Dynamicweb.Context.Current.Response.AddHeader("link", $"</Files/Templates/Designs/Swift/Assets/js/scripts.js?{jsFileInfo.LastWriteTime.Ticks}; rel=preload; as=script;"); 104 105 106 bool isProductsInCart = Model.Cart.TotalProductsCount > 0; 107 var currentUser = Dynamicweb.Security.UserManagement.User.GetCurrentExtranetUser(); 108 var isLoggedIn = false; 109 isLoggedIn = Pageview.User != null ? true : false; 110 bool customerFromSite = Pageview.User != null ? RTC.eCommerce.CreateCustomer.UserExtensions.GetCustomerFromSite(Pageview.User) : false; 111 var userAdresaNouaPageId = GetPageIdByNavigationTag("UserAdresaNoua"); 112 var userAdresaNouaURL = $"/Default.aspx?ID={userAdresaNouaPageId}"; 113 114 var mesageVodafonePageId = GetPageIdByNavigationTag("mesajvodafone"); 115 var mesageVodafonePageURL = $"/Default.aspx?ID={mesageVodafonePageId}"; 116 var mesagementenantaPageId = GetPageIdByNavigationTag("mesajmentenanta"); 117 var mesagementenantaPageURL = $"/Default.aspx?ID={mesagementenantaPageId}"; 118 var mesageOmniasigPageId = GetPageIdByNavigationTag("mesajomniasig"); 119 var mesageOmniasigPageURL = $"/Default.aspx?ID={mesageOmniasigPageId}"; 120 121 if(isLoggedIn) { 122 if(customerFromSite && Dynamicweb.Frontend.PageView.Current().Page.ID != userAdresaNouaPageId) { 123 HttpContext.Current.Response.Redirect(userAdresaNouaURL); 124 } 125 126 if(currentUser.CustomerNumber.Contains("24511") && currentUser.Title !="Clienti_Mari") { 127 if(Dynamicweb.Frontend.PageView.Current().Page.ID != mesageVodafonePageId) 128 { 129 HttpContext.Current.Response.Redirect(mesageVodafonePageURL); 130 } 131 } 132 133 134 if(currentUser.CustomerNumber.Contains("101577") && currentUser.Title !="ClientiMariOmniasig") { 135 if(Dynamicweb.Frontend.PageView.Current().Page.ID != mesageOmniasigPageId) 136 { 137 HttpContext.Current.Response.Redirect(mesageOmniasigPageURL); 138 } 139 } 140 141 if ((currentUser.CustomerNumber == "x77527x" || currentUser.CustomerNumber == "xNO19021x" || currentUser.CustomerNumber == "xIL19T024x" || currentUser.CustomerNumber == "xNO19022x") && currentUser.Title != "testEngie") 142 { 143 if(Dynamicweb.Frontend.PageView.Current().Page.ID != 2121) 144 { 145 HttpContext.Current.Response.Redirect("/Default.aspx?ID=2121"); 146 } 147 } 148 149 if((currentUser.CustomerNumber.Contains("x24ss511x"))) { 150 if(Dynamicweb.Frontend.PageView.Current().Page.ID != mesagementenantaPageId) 151 { 152 HttpContext.Current.Response.Redirect(mesagementenantaPageURL); 153 } 154 } 155 } 156 157 158 //Dynamicweb.Context.Current.Response.Flush(); //This sends the headers where we are now in the rendering making the TTFB faster 159 160 //custom rtc js & css 161 @*<script src="https://code.jquery.com/jquery-3.6.4.js" integrity="sha256-a9jBBRygX1Bh5lt8GZjXDzyOB+bWve9EiO7tROUtj/E=" crossorigin="anonymous"></script>*@ 162 163 <link href="/Files/Templates/Designs/Swift/Assets/css/rtc_custom.css" rel="stylesheet" media="all"> 164 <script src="/Files/Templates/Designs/Swift/Assets/js/rtc_custom.js"></script> 165 166 167 168 SetMetaTags(); 169 170 List<Dynamicweb.Content.Page> languages = new List<Dynamicweb.Content.Page>(); 171 172 if (Pageview.Area.IsMaster) 173 { 174 languages.Add(Pageview.Page); 175 if (Pageview.Page.Languages != null) 176 { 177 foreach (var language in Pageview.Page.Languages) 178 { 179 languages.Add(language); 180 } 181 } 182 } 183 else 184 { 185 languages.Add(Pageview.Page.MasterPage); 186 if (Pageview.Page.MasterPage != null) 187 { 188 if (Pageview.Page.MasterPage.Languages != null) 189 { 190 foreach (var language in Pageview.Page.MasterPage.Languages) 191 { 192 languages.Add(language); 193 } 194 } 195 } 196 } 197 198 string siteLanguage = Pageview.Area.CultureInfo.Name; 199 Uri url = Dynamicweb.Context.Current.Request.Url; 200 string hostName = url.Host; // domain.com/da-dk or domain.com/en-us 201 202 var ecomCountries = Dynamicweb.Ecommerce.Services.Countries.GetCountries(); 203 var ecomCurrencies = Dynamicweb.Ecommerce.Services.Currencies.GetAllCurrencies(); 204 } 205 <!doctype html> 206 <html lang="@Pageview.Area.CultureInfo.TwoLetterISOLanguageName"> 207 <head> 208 209 210 @* 211 <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': 212 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], 213 j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 214 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); 215 })(window,document,'script','dataLayer','GTM-KCWHC6Q');</script>*@ 216 217 @*Define dataLayer and the gtag function *@ 218 <script> 219 window.dataLayer = window.dataLayer || []; 220 function gtag(){dataLayer.push(arguments);} 221 222 gtag('consent', 'default', { 223 'ad_storage': 'denied', 224 'ad_user_data': 'denied', 225 'ad_personalization': 'denied', 226 'analytics_storage': 'denied', 227 'functionality_storage': 'denied', 228 'personalization_storage': 'denied', 229 'security_storage': 'denied' 230 }); 231 </script> 232 233 @* Google Tag Manager*@ 234 <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': 235 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], 236 j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 237 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); 238 })(window,document,'script','dataLayer','GTM-KCWHC6Q');</script> 239 240 <!-- @swiftVersion --> 241 @* Required meta tags *@ 242 <meta charset="utf-8"> 243 <meta name="viewport" content="height=device-height, width=device-width, initial-scale=1.0"> 244 <link rel="shortcut icon" href="@favicon"> 245 <link rel="apple-touch-icon" href="/Files/Templates/Designs/Swift/Assets/Images/logo_transparent.png"> 246 247 @Model.MetaTags 248 249 @{ 250 @* Languages meta data *@ 251 foreach (var language in languages) 252 { 253 if (language?.Area != null) 254 { 255 if (language != null && language.Published && language.Active && language.Area.Active && language.Area.Published && language.Area.ID != Dynamicweb.Frontend.PageView.Current().AreaID) 256 { 257 if (!string.IsNullOrEmpty(language.Area.DomainLock)) 258 { 259 hostName = language.Area.DomainLock; //dk.domain.com or dk-domain.dk 260 } 261 string querystring = $"Default.aspx?ID={language.ID}"; 262 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString["GroupID"])) 263 { 264 querystring += $"&GroupID={Dynamicweb.Context.Current.Request.QueryString["GroupID"]}"; 265 } 266 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString["ProductID"])) 267 { 268 querystring += $"&ProductID={Dynamicweb.Context.Current.Request.QueryString["ProductID"]}"; 269 } 270 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString["VariantID"])) 271 { 272 querystring += $"&VariantID={Dynamicweb.Context.Current.Request.QueryString["VariantID"]}"; 273 } 274 275 string friendlyUrl = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(querystring); 276 string href = $"{url.Scheme}://{hostName}{friendlyUrl}"; 277 278 <link rel="alternate" hreflang="@language.Area.CultureInfo.Name.ToLower()" href="@href"> 279 } 280 } 281 } 282 } 283 284 <title>@Model.Title</title> 285 @* Bootstrap + Swift stylesheet *@ 286 <link href="/Files/Templates/Designs/Swift/Assets/css/styles.css?@cssStyleFileInfo.LastWriteTime.Ticks" rel="stylesheet" media="all" type="text/css"> 287 288 @if (disableWideBreakpoints != "disableBoth") 289 { 290 <style> 291 @@media ( min-width: 1600px ) { 292 .container-xxl, 293 .container-xl, 294 .container-lg, 295 .container-md, 296 .container-sm, 297 .container { 298 max-width: 1520px; 299 } 300 } 301 </style> 302 303 if (disableWideBreakpoints != "disableUltraWideOnly") 304 { 305 <style> 306 @@media ( min-width: 1920px ) { 307 .container-xxl, 308 .container-xl, 309 .container-lg, 310 .container-md, 311 .container-sm, 312 .container { 313 max-width: 1820px; 314 } 315 } 316 </style> 317 } 318 } 319 320 @* Branding and Themes min stylesheet *@ 321 <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"> 322 <script src="/Files/Templates/Designs/Swift/Assets/js/aos.js?@jsFileInfo.LastWriteTime.Ticks" defer></script> 323 <script src="/Files/Templates/Designs/Swift/Assets/js/scripts.js?@jsFileInfo.LastWriteTime.Ticks" defer></script> 324 325 <script type="module"> 326 AOS.init({ offset: 0, duration: 400, delay: 100, easing: 'ease-in-out', mirror: true, disable: window.matchMedia('(prefers-reduced-motion: reduce)') }); 327 swift.Scroll.hideHeadersOnScroll(); 328 swift.Scroll.handleAlternativeTheme(); 329 </script> 330 331 @* Global site tag (gtag.js) - Google Analytics *@ 332 @if (!string.IsNullOrWhiteSpace(googleAnalyticsTrackingID) && allowTracking) 333 { 334 <script src="https://www.googletagmanager.com/gtag/js?id=@googleAnalyticsTrackingID" async></script> 335 <script> 336 window.dataLayer = window.dataLayer || []; 337 function gtag() { window.dataLayer.push(arguments); } 338 gtag('js', new Date()); 339 gtag('config', '@googleAnalyticsTrackingID'); 340 </script> 341 } 342 343 @if (!string.IsNullOrWhiteSpace(googleAnalyticsMeasurementID) && allowTracking) 344 { 345 var GoogleAnalyticsDebugMode = ""; 346 bool isLoggedInBackendUser = false; 347 348 if (Dynamicweb.Environment.ExecutingContext.IsAdminLoggedIn()) 349 { 350 isLoggedInBackendUser = true; 351 } 352 353 if (Model.Area.Item.GetBoolean("EnableGoogleAnalyticsDebugMode") && @isLoggedInBackendUser) 354 { 355 GoogleAnalyticsDebugMode = ", {'debug_mode': true}"; 356 } 357 358 <script async src="https://www.googletagmanager.com/gtag/js?id=@googleAnalyticsMeasurementID"></script> 359 <script> 360 window.dataLayer = window.dataLayer || []; 361 function gtag() { dataLayer.push(arguments); } 362 gtag('js', new Date()); 363 gtag('config', '@googleAnalyticsMeasurementID'@GoogleAnalyticsDebugMode); 364 </script> 365 } 366 367 @if (!string.IsNullOrWhiteSpace(customHeaderInclude)) 368 { 369 @RenderPartial($"Components/Custom/{customHeaderInclude}") 370 } 371 </head> 372 <body class="brand @(masterTheme) @isHomePage position-relative" id="page@(Model.ID)" data-isproductscart="@isProductsInCart" data-is-loggedin="@isLoggedIn"> 373 <!-- Google Tag Manager (noscript) --> 374 <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KCWHC6Q" 375 height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> 376 <!-- End Google Tag Manager (noscript) --> 377 @if (renderAsResponsive || !renderMobile) 378 { 379 <header class="page-header @headerCssClass top-0@(responsiveClassDesktop)" id="page-header-desktop"> 380 @* ALERTA CRACIUN 381 @if (isLoggedIn) // Verifică dacă utilizatorul este logat 382 { 383 384 <div class="alert alert-warning alert-dismissible fade show text-center" role="alert" id="deliveryAlert" style="display: none;"> 385 <div class="container"> 386 <h4 class="alert-heading">Program de sărbători</h4> 387 <p>Stimați parteneri, vă aducem la cunoștință programul de procesare și livrare comenzi în perioada sărbătorilor:</p> 388 <ul style="list-style:none"> 389 <li>Comenzile plasate în intervalul <strong>22 - 27 decembrie 2023 (maxim ora 12.00)</strong> se procesează și livrează începând cu <strong>28 decembrie 2023</strong></li> 390 <li>Comenzile plasate în intervalul <strong>27 decembrie 2023 (după ora 12.00) - 3 ianuarie 2024</strong> se procesează și livrează începând cu <strong>4 ianuarie 2024</strong></li> 391 </ul> 392 <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close" onclick="dismissAlert()"></button> 393 </div> 394 </div> 395 396 <script> 397 function dismissAlert() { 398 var alertWrapper = document.getElementById('deliveryAlert'); 399 var date = new Date(); 400 date.setTime(date.getTime() + (60 * 15 * 1000)); // 1 ora - 5 minute 401 document.cookie = "alertDismissed=true; expires=" + date.toUTCString() + "; path=/"; 402 alertWrapper.style.display = 'none'; 403 } 404 405 document.addEventListener("DOMContentLoaded", function () { 406 var alertWrapper = document.getElementById('deliveryAlert'); 407 var showAlert = !document.cookie.split('; ').find(row => row.startsWith('alertDismissed=')); 408 409 if(showAlert) { 410 alertWrapper.style.display = 'block'; 411 } 412 }); 413 </script> 414 } 415 ALERTA CRACIUN *@ 416 @if (@Model.Area.Item.GetLink("HeaderDesktop") != null) 417 { 418 @RenderGrid(@Model.Area.Item.GetLink("HeaderDesktop").PageId) 419 } 420 </header> 421 } 422 423 @if ((renderAsResponsive || renderMobile)) 424 { 425 <header class="page-header @headerCssClass top-0@(responsiveClassMobile)" id="page-header-mobile"> 426 @if (@Model.Area.Item.GetLink("HeaderMobile") != null) 427 { 428 @RenderGrid(@Model.Area.Item.GetLink("HeaderMobile").PageId) 429 } 430 431 </header> 432 } 433 434 <main id="content" @(schemaOrgType)> 435 <div data-intersect></div> 436 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 437 @using System 438 @using Dynamicweb.Ecommerce.ProductCatalog 439 440 441 @{ 442 string productIdFromUrl = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString.Get("ProductID")) ? Dynamicweb.Context.Current.Request.QueryString.Get("ProductID") : string.Empty; 443 bool isProductDetail = !string.IsNullOrEmpty(productIdFromUrl) && Pageview.Page.NavigationTag.ToLower() == "shop"; 444 445 bool isArticlePagePage = Model.ItemType == "Swift_Article"; 446 string schemaOrgProp = string.Empty; 447 if(isArticlePagePage) 448 { 449 schemaOrgProp = "itemprop=\"articleBody\""; 450 } 451 452 string theme = ""; 453 string gridContent = ""; 454 455 if (Model.PropertyItem != null) 456 { 457 theme = !string.IsNullOrWhiteSpace(Model.PropertyItem.GetRawValueString("Theme")) ? " theme " + Model.PropertyItem.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : ""; 458 } 459 460 if (Model.Item != null || Pageview.IsVisualEditorMode) 461 { 462 if (!isProductDetail) 463 { 464 gridContent = Model.Grid("Grid", "Grid", "default:true;sort:1", "Page"); 465 } 466 else 467 { 468 var productObject = Dynamicweb.Ecommerce.Products.Product.GetProductById(productIdFromUrl); 469 var detailPage = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(productObject.PrimaryGroupId)?.Meta.PrimaryPage ?? string.Empty; 470 var detailPageId = detailPage != string.Empty ? Convert.ToInt16(detailPage.Substring(detailPage.LastIndexOf('=') + 1)) : GetPageIdByNavigationTag("ProductDetailPage"); 471 472 @RenderGrid(detailPageId) 473 } 474 } 475 476 bool doNotRenderPage = false; 477 478 //Check if we are on the poduct detail page, and if there is data to render 479 ProductViewModel product = new ProductViewModel(); 480 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 481 { 482 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"]; 483 if (string.IsNullOrEmpty(product.Id)) { 484 doNotRenderPage = true; 485 } 486 } 487 488 //Render the page 489 if (!doNotRenderPage) { 490 string itemIdentifier = Model?.Item?.SystemName != null ? "item_" + Model.Item.SystemName.ToLower() : "item_Swift_Page"; 491 492 if (theme != "") 493 { 494 <div class="@theme item_@itemIdentifier" @schemaOrgProp> 495 @gridContent 496 </div> 497 } 498 else 499 { 500 <div class="item_@itemIdentifier" @schemaOrgProp> 501 @gridContent 502 </div> 503 } 504 } else { 505 <div class="container"> 506 <div class="alert alert-info" role="alert">@Translate("Sorry. There is nothing to view here")</div> 507 </div> 508 } 509 510 if (!Model.IsCurrentUserAllowed) 511 { 512 int signInPage = GetPageIdByNavigationTag("SignInPage"); 513 int dashboardPage = GetPageIdByNavigationTag("MyAccountDashboardPage"); 514 515 if (!Pageview.IsVisualEditorMode) 516 { 517 if (signInPage != 0) 518 { 519 if (signInPage != Model.ID) { 520 Dynamicweb.Context.Current.Response.Redirect("/Default.aspx?ID=" + signInPage); 521 } else { 522 if (dashboardPage != 0) { 523 Dynamicweb.Context.Current.Response.Redirect("/Default.aspx?ID=" + dashboardPage); 524 } else { 525 Dynamicweb.Context.Current.Response.Redirect("/"); 526 } 527 } 528 } 529 else 530 { 531 <div class="alert alert-dark m-0" role="alert"> 532 <span>@Translate("You do not have access to this page")</span> 533 </div> 534 } 535 } 536 else 537 { 538 <div class="alert alert-dark m-0" role="alert"> 539 <span>@Translate("To work on this page, you must be signed in, in the frontend")</span> 540 </div> 541 } 542 } 543 } 544 545 </main> 546 547 @if (renderAsResponsive || !renderMobile) 548 { 549 <footer class="page-footer@(responsiveClassDesktop)" id="page-footer-desktop"> 550 @if (@Model.Area.Item.GetLink("FooterDesktop") != null) 551 { 552 @RenderGrid(@Model.Area.Item.GetLink("FooterDesktop").PageId) 553 } 554 </footer> 555 } 556 557 @if (renderAsResponsive || renderMobile) 558 { 559 <footer class="page-footer@(responsiveClassMobile)" id="page-footer-mobile"> 560 @if (@Model.Area.Item.GetLink("FooterMobile") != null) 561 { 562 @RenderGrid(@Model.Area.Item.GetLink("FooterMobile").PageId) 563 } 564 </footer> 565 } 566 567 @* Render any offcanvas menu here *@ 568 @RenderSnippet("offcanvas") 569 570 @{ 571 bool isErpConnectionDown = !Dynamicweb.Ecommerce.DynamicwebLiveIntegration.TemplatesHelper.IsWebServiceConnectionAvailable(); 572 } 573 574 @* Language selector modal *@ 575 @if (languages.Count > 1 || ecomCountries.Count > 1 || ecomCurrencies.Count() > 1) 576 { 577 <div class="modal fade" id="PreferencesModal" tabindex="-1" aria-hidden="true"> 578 <div class="modal-dialog modal-dialog-centered modal-sm" id="PreferencesModalContent"> 579 @* The content here comes from an external request *@ 580 </div> 581 </div> 582 } 583 584 @* Favorite toast *@ 585 <div aria-live="polite" aria-atomic="true"> 586 <div class="position-fixed bottom-0 end-0 p-3" style="z-index: 11"> 587 <div id="favoriteNotificationToast" class="toast" role="alert" aria-live="assertive" aria-atomic="true"> 588 <div class="toast-header"> 589 <strong class="me-auto">@Translate("Favorite list updated")</strong> 590 <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button> 591 </div> 592 <div class="toast-body d-flex gap-3"> 593 <div id="favoriteNotificationToast_Image"></div> 594 <div id="favoriteNotificationToast_Text"></div> 595 </div> 596 </div> 597 </div> 598 </div> 599 600 @* Modal for dynamic content *@ 601 <div class="modal fade js-product" id="DynamicModal" tabindex="-1" aria-hidden="true"> 602 <div class="modal-dialog modal-dialog-centered modal-md"> 603 <div class="modal-content theme light" id="DynamicModalContent"> 604 @* The content here comes from an external request *@ 605 </div> 606 </div> 607 </div> 608 609 @* Offcanvas for dynamic content *@ 610 <div class="offcanvas offcanvas-end theme light" tabindex="-1" id="DynamicOffcanvas" style="width: 30rem"> 611 @* The content here comes from an external request *@ 612 </div> 613 614 @if (isErpConnectionDown && Model.Area.Item.GetBoolean("ShowErpDownMessage")) 615 { 616 string erpDownMessageTheme = !string.IsNullOrWhiteSpace(Model.Area.Item.GetRawValueString("ErpDownMessageTheme")) ? " theme " + Model.Area.Item.GetRawValueString("ErpDownMessageTheme").Replace(" ", "").Trim().ToLower() : "theme light"; 617 618 <div class="position-fixed bottom-0 end-0 p-3" style="z-index: 1040"> 619 <div class="toast fade show border-0 @erpDownMessageTheme" role="alert" aria-live="assertive" aria-atomic="true"> 620 <div class="toast-header"> 621 <strong class="me-auto">@Translate("Connection down")</strong> 622 <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button> 623 </div> 624 <div class="toast-body"> 625 @Translate("We are experiencing some connectivity issues. Not all features may be available to you.") 626 </div> 627 </div> 628 </div> 629 } 630 631 @* Custom Loader *@ 632 <div class="custom_loader d-none"> 633 <div class="spinner-border" role="status"> 634 <span class="sr-only"></span> 635 </div> 636 </div> 637 638 639 </body> 640 </html> 641 @functions { 642 void SetMetaTags() 643 { 644 //Verification Tokens 645 string siteVerificationGoogle = Model.Area.Item.GetString("Google_Site_Verification") != null ? Model.Area.Item.GetString("Google_Site_Verification") : ""; 646 //string siteVerificationYandex = Model.Area.Item.GetString("Yandex_Verification") != null ? Model.Area.Item.GetString("Yandex_Verification") : ""; 647 //string siteVerificationMS = Model.Area.Item.GetString("Msvalidate_01") != null ? Model.Area.Item.GetString("Msvalidate_01") : ""; 648 //string siteVerificationAlexa = Model.Area.Item.GetString("AlexaVerifyID") != null ? Model.Area.Item.GetString("AlexaVerifyID") : ""; 649 //string siteVerificationPinterest = Model.Area.Item.GetString("P_domain_verify") != null ? Model.Area.Item.GetString("P_domain_verify") : ""; 650 //string siteVerificationNorton = Model.Area.Item.GetString("Norton_safeweb_site_verification") != null ? Model.Area.Item.GetString("Norton_safeweb_site_verification") : ""; 651 652 //Generic Site Values 653 string openGraphFacebookAppID = Model.Area.Item.GetString("Fb_app_id") != null ? Model.Area.Item.GetString("Fb_app_id") : ""; 654 string openGraphType = Model.Area.Item.GetString("Open_Graph_Type") != null ? Model.Area.Item.GetString("Open_Graph_Type") : ""; 655 string openGraphSiteName = Model.Area.Item.GetString("Open_Graph_Site_Name") != null ? Model.Area.Item.GetString("Open_Graph_Site_Name") : ""; 656 657 string twitterCardSite = Model.Area.Item.GetString("Twitter_Site") != null ? Model.Area.Item.GetString("Twitter_Site") : ""; 658 659 //Page specific values 660 string openGraphSiteTitle = Model.Area.Item.GetString("Open_Graph_Title") != null ? Model.Area.Item.GetString("Open_Graph_Title") : ""; 661 FileViewModel openGraphImage = Model.Area.Item.GetFile("Open_Graph_Image"); 662 string openGraphImageALT = Model.Area.Item.GetString("Open_Graph_Image_ALT") != null ? Model.Area.Item.GetString("Open_Graph_Image_ALT") : ""; 663 string openGraphDescription = Model.Area.Item.GetString("Open_Graph_Description") != null ? Model.Area.Item.GetString("Open_Graph_Description") : ""; 664 665 string twitterCardURL = Model.Area.Item.GetString("Twitter_URL") != null ? Model.Area.Item.GetString("Twitter_URL") : ""; 666 string twitterCardTitle = Model.Area.Item.GetString("Twitter_Title") != null ? Model.Area.Item.GetString("Twitter_Title") : ""; 667 string twitterCardDescription = Model.Area.Item.GetString("Twitter_Description") != null ? Model.Area.Item.GetString("Twitter_Description") : ""; 668 FileViewModel twitterCardImage = Model.Area.Item.GetFile("Twitter_Image"); 669 string twitterCardImageALT = Model.Area.Item.GetString("Twitter_Image_ALT") != null ? Model.Area.Item.GetString("Twitter_Image_ALT") : ""; 670 671 if (!string.IsNullOrEmpty(siteVerificationGoogle)) 672 { 673 Pageview.Meta.AddTag("google-site-verification", siteVerificationGoogle); 674 } 675 676 if (!string.IsNullOrEmpty(openGraphFacebookAppID)) 677 { 678 Pageview.Meta.AddTag("fb:app_id", openGraphFacebookAppID); 679 } 680 681 if (!string.IsNullOrEmpty(openGraphType)) 682 { 683 Pageview.Meta.AddTag("og:type", openGraphType); 684 } 685 686 if (!string.IsNullOrEmpty(openGraphSiteName)) 687 { 688 Pageview.Meta.AddTag("og:site_name", openGraphSiteName); 689 } 690 691 if (!string.IsNullOrEmpty(Model.Title)) 692 { 693 Pageview.Meta.AddTag("og:title", Model.Title); 694 } 695 else 696 { 697 Pageview.Meta.AddTag("og:title", openGraphSiteTitle); 698 } 699 700 if (!string.IsNullOrEmpty(Pageview.Page.TopImage) && openGraphImage == null) 701 { 702 Pageview.Meta.AddTag("og:image", Dynamicweb.Context.Current.Request.Url.Scheme + "://" + Dynamicweb.Context.Current.Request.Url.Host + Pageview.Page.TopImage); 703 } 704 705 if (string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString["ProductID"])) 706 { 707 if (!string.IsNullOrEmpty(Model.Description)) 708 { 709 Pageview.Meta.AddTag("og:description", Model.Description); 710 } 711 else 712 { 713 Pageview.Meta.AddTag("og:description", openGraphDescription); 714 } 715 if (openGraphImage != null) 716 { 717 Pageview.Meta.AddTag("og:image", openGraphImage.Path); 718 } 719 720 if (!string.IsNullOrEmpty(openGraphImageALT)) 721 { 722 Pageview.Meta.AddTag("og:image:alt", openGraphImageALT); 723 } 724 if (!string.IsNullOrEmpty(twitterCardDescription)) 725 { 726 Pageview.Meta.AddTag("twitter:description", twitterCardDescription); 727 } 728 729 if (twitterCardImage != null) 730 { 731 Pageview.Meta.AddTag("twitter:image", twitterCardImage.Path); 732 } 733 734 if (!string.IsNullOrEmpty(twitterCardImageALT)) 735 { 736 Pageview.Meta.AddTag("twitter:image:alt", twitterCardImageALT); 737 } 738 } 739 740 if (!string.IsNullOrEmpty(twitterCardSite)) 741 { 742 Pageview.Meta.AddTag("twitter:site", twitterCardSite); 743 } 744 745 if (!string.IsNullOrEmpty(twitterCardURL)) 746 { 747 Pageview.Meta.AddTag("twitter:url", twitterCardURL); 748 } 749 750 if (!string.IsNullOrEmpty(twitterCardTitle)) 751 { 752 Pageview.Meta.AddTag("twitter:title", twitterCardTitle); 753 } 754 } 755 } 756 757 @{ 758 bool consentIsGranted = System.Web.HttpContext.Current.Request?.Cookies["Dynamicweb.CookieOptInLevel"]?.Value == "2"; 759 } 760 761 @if (consentIsGranted) 762 { 763 <script> 764 document.addEventListener("DOMContentLoaded", function() { 765 consentGranted(); 766 }); 767 </script> 768 } 769 770 <script> 771 function consentGranted() { 772 gtag('consent', 'update', { 773 'ad_storage': 'granted', 774 'ad_user_data': 'granted', 775 'ad_personalization': 'granted', 776 'analytics_storage': 'granted', 777 'functionality_storage': 'granted', 778 'personalization_storage': 'granted', 779 'security_storage': 'granted' 780 }); 781 } 782 </script> 783 784 785 @RenderGeneralModal() 786 787 <!-- Modal --> 788 789 @helper RenderGeneralModal() { 790 791 string iconPath = "/Files/Templates/Designs/Swift/Assets/icons/"; 792 int cartPageId = GetPageIdByNavigationTag("CartPage"); 793 string cartPageUrl= "Default.aspx?ID=" + cartPageId; 794 795 <div class="modal fade" id="GeneralModal" tabindex="-1" aria-labelledby="GeneralModalLabel" aria-hidden="true"> 796 <div class="modal-dialog modal-dialog-centered"> 797 <div class="modal-content p-4"> 798 <div class="modal-header border-0 py-0"> 799 <div class="generalmodal__modal-title h5" id="GeneralModalLabel"></div> 800 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> 801 </div> 802 <div class="modal-body"> 803 <div class="grid"> 804 <div class="g-col-12"> 805 <div class="generalmodal__description h5 fs-6 mb-1"></div> 806 </div> 807 </div> 808 </div> 809 <div class="modal-footer d-flex flex-row border-0 justify-content-center"> 810 <button type="button" class="btn btn-secondary btn-notOk d-none" data-bs-dismiss="modal"><span class="">@Translate("Anuleaza")</button> 811 <button type="button" class="btn btn-primary btn-ok" data-bs-dismiss="modal"><span class="">@Translate("Ok")</button> 812 </div> 813 </div> 814 </div> 815 </div> 816 }