Error compiling template "Designs/Aperta/_parsed/Campanie.parsed.cshtml"
Line 25: The type or namespace name 'eCommerce' does not exist in the namespace 'Dynamicweb' (are you missing an assembly reference?)

1 @using Dynamicweb; 2 @using Dynamicweb.Ecommerce.Products; 3 @using Dynamicweb.Security.UserManagement; 4 @using Dynamicweb.Modules.UserManagement; 5 @using Dynamicweb.Frontend; 6 @using Dynamicweb.Content; 7 @using System.Web; 8 @using System; 9 10 @{ 11 var serviceLocator = Dynamicweb.Extensibility.ServiceLocator.Current; 12 var pageService = serviceLocator.GetInstance<Dynamicweb.Content.IPageService>(); 13 var paragraphService = serviceLocator.GetInstance<Dynamicweb.Content.IParagraphService>(); 14 15 @*string areaLayoutPath = "Files/Templates/" + Pageview.Area.Values["arealayout"].ToString();*@ 16 string areaLayoutPath = "Files/Templates/Designs/Aperta/" + PageView.Current().Area.Layout.ToString(); 17 18 areaLayoutPath = areaLayoutPath.Substring(0, areaLayoutPath.LastIndexOf("/")); 19 20 @*var checkoutPageId = Pageview.Area.Item["Checkout_Page_ID"]; 21 var cartPageId = Pageview.Area.Item["CartPage_ID"];*@ 22 var checkoutPageId = PageView.Current().Area.Item["Checkout_Page_ID"]; 23 var cartPageId = PageView.Current().Area.Item["CartPage_ID"]; 24 25 26 @*var currentUser = Dynamicweb.Frontend.PageView.Current().User; 27 string customerNo = currentUser.LoggedIn ? currentUser.CustomerNumber.ToString() : null;*@ 28 var currentUserAccess = Dynamicweb.Security.UserManagement.User.GetCurrentExtranetUser(); 29 var user = currentUserAccess; 30 var currentUser = currentUserAccess; 31 bool userIsLoggedIn = currentUser != null; 32 33 string customerNo = userIsLoggedIn && currentUser.CustomerNumber != null ? currentUser.CustomerNumber : ""; 34 35 var customerSettings = !string.IsNullOrEmpty(customerNo) ? BrandFusion.Dw.Austral.eCommerce.CustomerFacade.Get(customerNo,"sd") : null; 36 37 //Tipul de client 38 var customerPromo = customerSettings != null ? customerSettings.Promo : ""; 39 40 string mesajCampanieBTS = ""; 41 var paragraphA = paragraphService.GetParagraph(1849); 42 var paragraphB = paragraphService.GetParagraph(1850); 43 44 switch(customerPromo) 45 { 46 case "A": 47 // Use the text block below to separate html elements from code 48 mesajCampanieBTS = paragraphA.Text; 49 break; // Always break each case 50 case "B": 51 mesajCampanieBTS = paragraphB.Text; 52 break; 53 default: 54 break; 55 } 56 57 } 58 59 @inherits RazorTemplateBase<RazorTemplateModel<Template>> 60 @using Dynamicweb.Rendering; 61 @using System.Text.RegularExpressions; 62 @using System.Web; 63 @using Dynamicweb.Environment; 64 65 @helper RenderScripts(string location) 66 { 67 //possible location values: header, body, footer; 68 //posible scope: tracking, marketing, preferences, functional; 69 //possible cookie option values; 70 //no cookies = 0; 71 //functional only=1; 72 //all=2; 73 //marketing = 3; 74 //tracking = 4; 75 //preferences = 5; 76 //Item.Area.Tracking.Code; 77 //Item.Area.Tracking.Location; 78 //Item.Area.Tracking.Scope; 79 //cookie=Dynamicweb.CookieOptInLevel; 80 //Functional; 81 //None; 82 //All; 83 CookieOptInLevel level = CookieManager.GetCookieOptInLevel(); 84 int x = (int)level; 85 string[] allowedFunctional = {"functional"}; 86 string[] allowedTracking = {"functional","tracking"}; 87 string[] allowedMarketing = {"functional","marketing","tracking"}; 88 string[] allowedScope = {"functional"}; 89 switch(x) 90 { 91 case 0: 92 allowedScope = allowedFunctional; 93 break; 94 case 1: 95 allowedScope = allowedTracking; 96 break; 97 case 2: 98 allowedScope = allowedMarketing; 99 break; 100 default: 101 allowedScope = allowedFunctional; 102 break; 103 } 104 105 if(!string.IsNullOrEmpty(location) && x > 0){ 106 var trackingScripts = GetLoop("Item.Area.Tracking").Where(a=>a.GetString("Item.Area.Tracking.Location") == location); 107 trackingScripts = trackingScripts.Where(z=>allowedScope.Any(y=>y == z.GetString("Item.Area.Tracking.Scope"))); 108 foreach(var trackingScript in trackingScripts){ 109 <text>@trackingScript.GetString("Item.Area.Tracking.Code")</text> 110 } 111 } 112 113 114 } 115 116 117 @functions { 118 private string CommaSplittedString(string CommaSplittedString, string NewString) 119 { 120 121 if (!string.IsNullOrEmpty(CommaSplittedString)) 122 { 123 CommaSplittedString += ", "; 124 } 125 CommaSplittedString = NewString; 126 127 return CommaSplittedString; 128 } 129 public static string StripHtml(string source) 130 { 131 return Regex.Replace(source, "<.*?>", string.Empty); 132 } 133 134 135 136 137 138 139 140 141 } 142 <!DOCTYPE html> 143 <html ng-app="apertaApp"> 144 <head> 145 146 <title>@GetValue("Title")</title> 147 @GetValue("CopyRightNotice") 148 149 <meta charset="utf-8"> 150 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 151 <meta name="viewport" content="width=device-width"> 152 @GetValue("MetaTags") 153 154 @{ 155 156 string currentpageid = GetString("DwPageID"); 157 string firstpageid = GetString("DwAreaFirstActivePageID"); 158 string MetaDescription = GetString("Meta.Description"); 159 string MetaKeywords = GetString("Meta.Keywords"); 160 } 161 <link rel="alternate" type="application/rss+xml" title="RSS" href="https://www.aperta.ro/rss"> 162 <link rel="publisher" href="//plus.google.com/110751017745975885935"> 163 <meta property="og:locale" content="ro_RO"> 164 @(currentpageid == firstpageid ? "<meta property='og:type' content='website'>" : "<meta property='og:type' content='object'>") 165 <meta property="og:site_name" content="Aperta"> 166 <meta property="fb:app_id" content="996280153778964"> 167 <meta property="og:url" content='@("http://www.aperta.ro" + GetGlobalValue("Global:Pageview.Url"))'> 168 169 @RenderSnippet("metaTags") 170 171 <link href="//fonts.googleapis.com/css?family=Open+Sans:400,300,600,700&amp;subset=latin,latin-ext" rel="stylesheet" type="text/css"> 172 <link href="//fonts.googleapis.com/css?family=Roboto+Condensed:400,300,700&amp;subset=latin,latin-ext" rel="stylesheet" type="text/css"> 173 <link rel="icon" type="image/x-icon" href="/@areaLayoutPath/assets/img/favicon.ico"> 174 <link rel="icon" type="image/png" href="/@areaLayoutPath/assets/img/favicon-32x32.png" sizes="32x32"> 175 <link rel="icon" type="image/png" href="/@areaLayoutPath/assets/img/favicon-16x16.png" sizes="16x16"> 176 <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css"> 177 <link href="//code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css" rel="stylesheet"> 178 <link rel="stylesheet" type="text/css" href="/@areaLayoutPath/assets/css/main.css"> 179 <link rel="stylesheet" type="text/css" href="/@areaLayoutPath/assets/css/temp.css"> 180 <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script> 181 <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script> 182 183 <!--[if lt IE 9]> 184 @* <script src="/@areaLayoutPath/assets/js/html5shiv.min.js"></script> 185 <script src="/@areaLayoutPath/assets/js/respond.min.js"></script> *@ 186 <link rel="stylesheet" type="text/css" href="/@areaLayoutPath/assets/css/IEfix.css"> 187 <![endif]--> 188 189 @* <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script> *@ 190 @* <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular-resource.min.js"></script> *@ 191 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> 192 @* <script type="text/javascript" src="/@areaLayoutPath/assets/js/filter.js"></script> *@ 193 @* <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular-resource.min.js"></script> *@ 194 <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5673c6e339616cf4" async="async"></script> 195 @*@{ 196 string user = Dynamicweb.Frontend.PageView.Current().User.UserName; 197 198 199 }*@ 200 @*@if(!string.IsNullOrEmpty(user)) {*@ 201 @if(userIsLoggedIn != null) { 202 203 <script> 204 dataLayer = []; 205 dataLayer.push({'VisitorType': 'Client'}); 206 </script> 207 } 208 209 @RenderScripts("header") 210 @GetValue("Stylesheets") 211 @GetValue("Javascripts") 212 </head> 213 <body> 214 @RenderScripts("body") 215 216 217 @*@{string username = Dynamicweb.Frontend.PageView.Current().User.UserName;}*@ 218 <div class="header-mobile"> 219 <div class="logo"> 220 <a href="/"><img src="/Files/Templates/Designs/Aperta/assets/img/logo-aperta.svg" alt="Logo Aperta papetarie si birotica" with="300" height="150" class="img-responsive"></a> 221 </div> 222 <div class="mobile-nav-trigger"> 223 <div class="search" style="display: none;"> 224 <form action="/Default.aspx?ID=156" method="GET" class="form-group form-inline"> 225 <input type="text" class="tr-all" name="q" id="q" autocomplete="off" spellcheck="false" placeholder="Cautare"> 226 <button type="submit"> 227 <i class="fa fa-search" id="icon-search"></i> 228 </button> 229 <div class="instant_search"></div> 230 </form> 231 232 </div> 233 @*@if(!string.IsNullOrEmpty(username)) {*@ 234 @if(userIsLoggedIn != null) { 235 <div class="my-account"><a href="/Default.aspx?ID=198"><i class="fa fa-user"></i></a></div> 236 <button class="mobile-cart"><i class="fa fa-shopping-cart"></i></button> 237 } else { 238 <div class="my-account"><a href="/Default.aspx?ID=195"> <i class="fa fa-user"></i>@Translate("Login", "Login")</a></div> 239 <div class="my-account"><a href="/Default.aspx?ID=3829"> <i class="fa fa-user-plus"></i>@Translate("Vreau cont", "Vreau cont")</a></div> 240 } 241 <i class="fa fa-bars"></i> 242 </div> 243 244 </div> 245 246 <div class="mobile-big-wrapper"> 247 <div class="mobile-nav left-view"> 248 <div class="mobile-main-nav"> 249 @RenderNavigation(new { 250 template = "MainNavigationMobile.xslt", 251 expandmode = "all", 252 id = "mobile-navigation", 253 startlevel = 1, 254 endlevel = 3 255 }) 256 </div> 257 </div> 258 259 <div class="mobile-wrapper"> 260 @{ 261 int productsInCart = GetInteger("Ecom:Order.OrderLines.TotalQuantity"); 262 } 263 264 <div class="header" ng-controller="InstantSearchController"> 265 <div class="upper"> 266 <div class="container"> 267 <div class="logo"><a href="/"><img src="/@areaLayoutPath/assets/img/logo-aperta.svg" alt="Logo Aperta papetarie si birotica" class="img-responsive"></a></div> 268 269 <div class="main-nav"> 270 @RenderNavigation(new { 271 template = "MainNavigation.xslt", 272 expandmode = "all", 273 id = "NavMainAll", 274 startlevel = 1, 275 endlevel = 3 276 }) 277 <!--<ul class="dwnavigation" id="NavMainAll" data-settings="startlevel:1;endlevel:4;template:MainNavigation.xslt;expandmode:all;"></ul>--> 278 </div> 279 280 281 @*@if(!string.IsNullOrEmpty(user)) {*@ 282 @if(userIsLoggedIn) { 283 <div class="cos"> 284 <a href="/default.aspx?id=@cartPageId"><img src="/Files/Templates/Designs/Aperta/assets/img/cart.svg"><span data-minicart-quantity="">@productsInCart</span></a> 285 </div> 286 <div class="my-account"><a href="/Default.aspx?ID=198"><i class="fa fa-user"></i>@Translate("myAccount", "Contul Meu")</a> | <a href="/Admin/Public/ExtranetLogoff.aspx">@Translate("logout", "Logout")</a></div> 287 } else { 288 <div class="my-account"><a href="/Default.aspx?ID=195"> <i class="fa fa-user"></i>@Translate("Login", "Login")</a></div> 289 <div class="my-account"><a href="/Default.aspx?ID=3829"> <i class="fa fa-user-plus"></i>@Translate("Vreau cont", "Vreau cont")</a></div> 290 } 291 <div class="search"> 292 <form action="/cautare.aspx?" method="GET" class="form-group"> 293 <input type="text" class="tr-all" name="q" id="q" autocomplete="off" spellcheck="false" placeholder="Cautare"> 294 <button type="submit"> 295 <i class="fa fa-search" id="icon-search"></i> 296 </button> 297 <div class="instant_search"></div> 298 </form> 299 300 </div> 301 </div> 302 </div> 303 @* <div id="feedback" class="feedback testing"> 304 <p class="feedback__search"><i class="fa fa-cog fa-spin" style="margin-right: 0.5em;"></i>Cauta: {{searchString}}</p> 305 </div> 306 <div class="instant-search testing"> 307 <ul> 308 <li ng-repeat="i in todos | searchFor:searchString"> 309 <a href="/{{i.link}}" class="media"> 310 <span class="instant-search__image media-left"><img ng-src="{{i.image}}"></span> 311 <span class="instant-search__text media-body">{{i.name}} <span ng-show="i.variantName != '-'">({{i.variantName}})</span></span> 312 </a> 313 </li> 314 </ul> 315 </div> *@ 316 </div> 317 318 319 @using Dynamicweb.eCommerce.Orders.SalesDiscounts; 320 @{ 321 var voucherCode = Voucher.GenerateVoucher(1, 5); 322 } 323 <div class="container wrapper"> 324 <div class="category-page"> 325 <h1 class="page__header">@GetString("Title")</h1> 326 <div class="wrapper-fix"> 327 328 @GetValue("DwContent(bannerTitle)") 329 330 <div class="row-campanie"> 331 <!--<a href="#" class="go-checkout pull-right" apply>Particip</a>>--> 332 </div>@GetValue("DwContent(upperBoxes)") 333 334 @GetValue("DwContent(bottomText)") 335 336 <div class="addthis_sharing_toolbox" style="margin-top: 10px;"></div> 337 338 <div class="row-campanie"> 339 <a href="http://cdn.aperta.ro/Files/Images/Blog/regulament-campanie-cu-premii.pdf" target="_blank" class="continue-shopping">Citește regulamentul campaniei</a> 340 <a href="/Default.aspx?ID=148" target="_blank" class="afla-libraria clear-cart">Află unde este magazinul cel mai apropiat de tine</a> 341 <a href="/Default.aspx?ID=154" target="_blank" class="rezultatele-afisate clear-cart">Rezultatele sunt afisate aici</a> 342 </div> 343 344 </div> 345 </div> 346 </div> 347 348 <div style="display:none;" class="particip" id="particip" code="@voucherCode"> 349 <div class="times"> 350 <a href="#" close=""><i class="fa fa-times"></i></a> 351 </div> 352 <h3>Formular de înscriere la Tombola rechizitelor</h3> 353 <p>Ai cumpărat, acum te poți înscrie!</p> 354 @GetValue("DwContent(formular)") 355 </div> 356 357 @SnippetStart("metaTags") 358 359 <meta property="og:title" content='@GetString("Title")'> 360 <meta property="og:description" content='@GetString("Meta.Description")'> 361 <meta property="og:image" content="http://www.aperta.ro/Files/Images/Aperta/campanie-aperta-2017-og.jpg"> 362 <meta property="og:image:width" content="470"> 363 <meta property="og:image:height" content="246"> 364 <meta name="twitter:card" content="summary_large_image"> 365 <meta name="twitter:site" content="&#64;CatalogAperta"> 366 <meta name="twitter:title" content='@GetString("Title")'> 367 <meta name="twitter:description" content='@GetString("Meta.Description")'> 368 <meta name="twitter:image" content="http://www.aperta.ro/Files/Images/Aperta/campanie-aperta-2017-og.jpg"> 369 370 @SnippetEnd("metaTags") 371 372 @SnippetStart("bottomJS") 373 <script type="text/javascript" src="/@areaLayoutPath/assets/js/campanie.js"></script> 374 @SnippetEnd("bottomJS") 375 376 @{DateTime localDate = DateTime.Now;} 377 <div class="footer"> 378 <div class="container"> 379 380 <div class="footer-block"> 381 <div class="social-media"> 382 <a href="https://www.facebook.com/CatalogAperta" target="_blank"><i class="fa fa-facebook"></i></a> 383 <a href="https://www.instagram.com/CatalogAperta/" target="_blank"><i class="fa fa-instagram"></i></a> 384 <a href="https://twitter.com/CatalogAperta" target="_blank"><i class="fa fa-twitter"></i></a> 385 <a href="https://plus.google.com/+CatalogAperta" target="_blank"><i class="fa fa-google-plus"></i></a> 386 <a href="https://www.youtube.com/c/CatalogAperta?sub_confirmation=1" target="_blank"><i class="fa fa-youtube"></i></a> 387 <a href="https://www.pinterest.com/CatalogAperta/" target="_blank"><i class="fa fa-pinterest"></i></a> 388 <a href="https://www.linkedin.com/company/catalogaperta" target="_blank"><i class="fa fa-linkedin"></i></a> 389 <a href="http://www.aperta.ro/rss" target="_blank"><i class="fa fa-rss"></i></a> 390 </div> 391 <div class="newsletter"> 392 @RenderParagraphContent(GetInteger("Item.Area.NewsletterParagraph_ID")) 393 </div> 394 395 </div> 396 397 <div class="footer-block rights"> 398 <span>&copy; @localDate.Year Aperta. Toate drepturile rezervate.</span> 399 </div> 400 <div class="footer-full"> 401 @RenderNavigation(new { 402 template = "LiClean.xslt", 403 id = "FooterNavigationEcom", 404 title="Footer Navigation", 405 parenttag="footernavigation", 406 startlevel = 1 407 }) 408 </div> 409 </div> 410 </div> 411 </div> 412 </div> 413 414 <script type="text/javascript" src="/@areaLayoutPath/assets/js/tab.js"></script> 415 <script type="text/javascript" src="/@areaLayoutPath/assets/js/jquery.flexslider-min.js"></script> 416 <script type="text/javascript" src="/@areaLayoutPath/assets/js/jquery.noty.packaged.js"></script> 417 <script type="text/javascript" src="/@areaLayoutPath/assets/js/blueimp-gallery.min.js"></script> 418 <script type="text/javascript" src="/@areaLayoutPath/assets/js/jquery.bpopup.min.js"></script> 419 <script type="text/javascript" src="/@areaLayoutPath/assets/js/mobile-menu.js"></script> 420 <script type="text/javascript" src="/@areaLayoutPath/assets/js/main.js"></script> 421 422 @RenderSnippet("bottomJS") 423 424 <div id="blueimp-gallery" class="blueimp-gallery blueimp-gallery-controls"> 425 <div class="slides"></div> 426 <a class="prev">‹</a> 427 <a class="next">›</a> 428 <a class="close"><div class="ion-ios-close"></div></a> 429 @* <ol class="indicator"></ol> *@ 430 </div> 431 @RenderScripts("footer") 432 </body> 433 </html>