Error parsing template "Designs/RTC/eCom/Productlist/Product_List_Box.cshtml"
Line 739: Unterminated string literal. Strings that start with a quotation mark (") must be terminated before the end of the line.  However, strings that start with @ and a quotation mark (@") can span multiple lines. Closing HTML tags within a string literal may trigger this error message.
1 @using Dynamicweb.Ecommerce.Products; 2 @using Dynamicweb.Modules.UserManagement; 3 @using System.Web; 4 @using System; 5 6 7 @{ 8 9 var currentUserAccess = Dynamicweb.Security.UserManagement.User.GetCurrentExtranetUser(); 10 var user = currentUserAccess; 11 var currentUser = currentUserAccess; 12 bool userIsLoggedIn = currentUser != null; // Dynamicweb.Security.UserManagement.User.IsExtranetUserLoggedIn(); 13 14 string customerNo = userIsLoggedIn && currentUser.CustomerNumber != null ? currentUser.CustomerNumber.ToString() : null; 15 string fakecustomer = "xxx"; 16 int todayDay = (int)DateTime.Now.Day; 17 18 bool commandIsEditted = !string.IsNullOrEmpty(GetString("EditedFromOrderId.Clean")) ? true : false; 19 var cartURL = ""; 20 if(commandIsEditted) { 21 cartURL = "/Default.aspx?ID=78"; 22 } else { 23 cartURL = "/Default.aspx?ID=37"; 24 } 25 26 if(!System.Web.HttpContext.Current.Request.Cookies.AllKeys.Contains("showMaintenanceBanner")) { 27 System.Web.HttpContext.Current.Response.Cookies["showMaintenanceBanner"].Value = "False"; 28 } 29 30 if(!userIsLoggedIn) { 31 System.Web.HttpContext.Current.Response.Cookies["showMaintenanceBanner"].Value = "False"; 32 } 33 34 35 bool bannerMentenanta = System.Web.HttpContext.Current.Request.Cookies["showMaintenanceBanner"].Value == "True" ? true : false; 36 37 string bannerMentenantaClass = "banner-mentenanta"; 38 if(bannerMentenanta) { 39 bannerMentenantaClass = "banner-mentenanta hidden"; 40 } 41 42 } 43 44 @{ string designName = GetString("Template:DesignBaseUrl").Replace("/Files/Templates/Designs/", "").Replace("/", ""); }@functions{ 45 public static string GetImage(string sourceString, int imageWidth, int imageHeight, int imageWidthTablet = 0, int imageHeightTablet = 0, int imageWidthMobile = 0, int imageHeightMobile = 0, string imageFormat = "png", int imageCompression = 0, int imageCrop = 5, string background = "", string designName = "CRS") 46 { 47 Dynamicweb.Frontend.PageView currentPageview = Dynamicweb.Frontend.PageView.Current(); 48 background ="#ffffff"; 49 string currDevice = currentPageview.Device.ToString(), 50 alternativeImage = currentPageview.Area.Item["NoImage"] != null ? currentPageview.Area.Item["NoImage"].ToString() : "/Files/Images/Products/Large/no-image-available_inter.png", 51 widthString = "", 52 heightString = "", 53 //getImageFormat = "&amp;Format=jpg", 54 getImageFormat = "&amp;Format="+ imageFormat, 55 getImageCompression = imageCompression != 0 ? "&amp;Compression=" + imageCompression : "", 56 bgColor = !string.IsNullOrEmpty(background) ? "&amp;background=" + background : ""; 57 int getImageWidth = imageWidth != 0 ? imageWidth : 0, 58 getImageHeight = imageHeight != 0 ? imageHeight : 0; 59 60 //if (currDevice == Dynamicweb.Frontend.PageView.DeviceType.Tablet.ToString()) 61 if (currDevice == Dynamicweb.Frontend.Devices.DeviceType.Tablet.ToString()) 62 { 63 getImageWidth = imageWidthTablet != 0 ? imageWidthTablet : getImageWidth; 64 getImageHeight = imageHeightTablet != 0 ? imageHeightTablet : getImageHeight; 65 } 66 //else if (currDevice == Dynamicweb.Frontend.PageView.DeviceType.Mobile.ToString()) 67 else if (currDevice == Dynamicweb.Frontend.Devices.DeviceType.Mobile.ToString()) 68 { 69 getImageWidth = imageWidthMobile != 0 ? imageWidthMobile : getImageWidth; 70 getImageHeight = imageHeightMobile != 0 ? imageHeightMobile : getImageHeight; 71 } 72 73 if (getImageWidth != 0) 74 { 75 widthString = "&amp;Width=" + getImageWidth; 76 } 77 if (getImageHeight != 0) 78 { 79 heightString = "&amp;Height=" + getImageHeight; 80 } 81 82 string output = "/Admin/Public/GetImage.ashx?Image=" + sourceString + widthString + heightString + "&amp;altFmImage_path=" + alternativeImage + getImageFormat + getImageCompression + "&amp;Crop=" + imageCrop + bgColor; 83 return output; 84 } 85 } 86 @* getImageFormat = imageFormat != "jpg" ? "&amp;Format=" + imageFormat : "", *@ 87 @inherits RazorTemplateBase<RazorTemplateModel<Template>> 88 @using Dynamicweb.Rendering; 89 90 @functions{ 91 private string GetImagePathUrl(string small, string medium, string large, string pattern) 92 { 93 string imagePath; 94 95 if (!string.IsNullOrEmpty(small)) 96 imagePath = small; 97 else if (!string.IsNullOrEmpty(medium)) 98 imagePath = medium; 99 else if (!string.IsNullOrEmpty(large)) 100 imagePath = large; 101 else 102 imagePath = pattern; 103 104 return imagePath; 105 } 106 } 107 @using RTC.eCommerce 108 109 110 @{ 111 string grouplink = ""; 112 113 if (!string.IsNullOrWhiteSpace(GetString("Ecom:ProductList:Page.GroupID"))) 114 { 115 grouplink = "/Default.aspx?ID=" + GetValue("Ecom:ProductList:Page.ID") + "&amp;GroupID=" + GetValue("Ecom:ProductList:Page.GroupID"); 116 } 117 else 118 { 119 grouplink = "/Default.aspx?ID=" + GetValue("Ecom:ProductList:Page.ID") + "&amp;eComQuery=" + GetValue("Ecom:ProductList:Search.Query"); 120 } 121 var pageSizeParameter = System.Web.HttpContext.Current.Request.Params["PageSize"]; 122 var sortyByParameter = System.Web.HttpContext.Current.Request.Params["sortBy"]; 123 124 CustomerAddress groupInfo = null; 125 126 if (!string.IsNullOrEmpty(customerNo)) 127 { 128 groupInfo = CustomerFacade.GetB2bBillingAddress(customerNo); 129 } 130 } 131 132 133 <div class="col-sm-3"> 134 <div class="sidebar"> 135 @if (userIsLoggedIn) 136 { 137 <div class="sidebar-account"> 138 <h3>Contul meu</h3> 139 @if (!string.IsNullOrEmpty(customerNo)) 140 { 141 <div class="user"> 142 <p>Bine ai venit, @groupInfo.Name</p> 143 @if (!string.IsNullOrEmpty(groupInfo.GeoImage)) 144 { 145 <p><img src="/Files/@groupInfo.GeoImage" alt="" /></p> 146 } 147 </div> 148 } 149 150 @RenderNavigation(new 151 { 152 template = "MyAccount.xslt", 153 expandmode = "all", 154 sitemapmode = "true", 155 id = "LeftNavigation", 156 startlevel = 1, 157 endlevel = 4, 158 parentid = 22, 159 areaid = 1 160 }) 161 162 </div> 163 } 164 165 166 167 @using System.Linq 168 169 @{ bool noResults = false; 170 var parametersList = GetLoop("Query.Parameters"); 171 string groupId = !string.IsNullOrEmpty(System.Web.HttpContext.Current.Request.Params["GroupID"]) ? System.Web.HttpContext.Current.Request.Params["GroupID"].ToString() : ""; 172 string Producator = !string.IsNullOrEmpty(System.Web.HttpContext.Current.Request.Params["Producator"]) ? System.Web.HttpContext.Current.Request.Params["Producator"] : ""; 173 string pageSizeNum = !string.IsNullOrEmpty(System.Web.HttpContext.Current.Request.Params["PageSize"]) ? System.Web.HttpContext.Current.Request.Params["PageSize"] : ""; 174 string CurrentPageID = GetString("Ecom:Group.Link.Clean.PID"); 175 176 } 177 <div class="headerBox filtersHead col-xs-12 row"> 178 <h3 class="block-title top-title"><span><!--@Translate("filterYourResults", "Filter your results")--> Filtreaza</span></h3> 179 </div> 180 181 <!-- REMOVE FILTERS --> 182 183 184 <form id="filtersForm" class="col-xs-12 noPadding" action="/Default.aspx" data-page-id="4228"> 185 <input type="hidden" name="ID" value="@Pageview.Page.ID"/> 186 <input type="hidden" name="GroupID" value="@groupId" /> 187 188 @*<input type="hidden" name="sortby" value="@sortBy"/> 189 <input type="hidden" name="SortOrder" value="@sortOrder"/> 190 <input type="hidden" name="PageSize" value="@pageSizeNum"/> 191 <input type="hidden" name="q" value="@qString"/>*@ 192 193 194 @foreach (LoopItem facetGroup in GetLoop("FacetGroups")) 195 { 196 foreach (LoopItem facet in facetGroup.GetLoop("Facets")) 197 { 198 string parameterType = parametersList.First(x => x.GetString("Parameter.Name") == facet.GetString("Facet.QueryParameter")).GetString("Parameter.Type"); 199 string templateOutput = "string"; 200 201 if (parameterType.Contains("[]")) 202 { 203 switch (facet.GetString("Facet.Name")) 204 { 205 case "Producator": 206 templateOutput = "checkboxes"; 207 break; 208 case "GroupID": 209 templateOutput = "checkboxes"; 210 break; 211 default: 212 templateOutput = "checkboxes"; 213 break; 214 } 215 } 216 else if (parameterType.Contains("Boolean")) 217 { 218 switch (facet.GetString("Facet.Name")) 219 { 220 case "Producator": 221 templateOutput = "checkboxes"; 222 break; 223 case "GroupID": 224 templateOutput = "checkboxes"; 225 break; 226 default: 227 templateOutput = "checkboxes"; 228 break; 229 } 230 } 231 else if (!string.IsNullOrWhiteSpace(facet.GetString("Facet.OptionCount"))) 232 { 233 switch (facet.GetString("Facet.Name")) 234 { 235 case "Producator": 236 templateOutput = "checkboxes"; 237 break; 238 case "GroupID": 239 templateOutput = "checkboxes"; 240 break; 241 default: 242 templateOutput = "checkboxes"; 243 break; 244 } 245 } 246 else 247 { 248 switch (facet.GetString("Facet.Name")) 249 { 250 case "Producator": 251 templateOutput = "checkboxes"; 252 break; 253 case "GroupID": 254 templateOutput = "checkboxes"; 255 break; 256 default: 257 templateOutput = "checkboxes"; 258 break; 259 } 260 } 261 @RenderField(facet, parameterType, templateOutput, noResults) 262 } 263 } 264 </form> 265 266 @helper RenderField(LoopItem loopItem, string parameterType, string templateOutput, bool noResults) 267 { 268 string parameter = loopItem.GetString("Facet.QueryParameter"); 269 string name = loopItem.GetString("Facet.Name"); 270 List<LoopItem> facetOptionsList = loopItem.GetLoop("FacetOptions"); 271 var facetOptions = noResults ? facetOptionsList.OrderByDescending(o => o.GetInteger("FacetOption.Count")).ThenBy(or => or.GetString("FacetOption.Label")) : loopItem.GetLoop("FacetOptions").Where(f => f.GetInteger("FacetOption.Count") != 0).OrderByDescending(o => o.GetInteger("FacetOption.Count")).ThenBy(or => or.GetString("FacetOption.Label")); 272 273 if (name == "EcomGroups") 274 { 275 @RenderEcomNavigation(null) 276 } 277 else{ 278 switch (templateOutput) 279 { 280 case "multiselect": 281 if (loopItem.GetLoop("FacetOptions").Any()) 282 { 283 <fieldset> 284 <legend>@name</legend> 285 <select data-selected-text-format="count" data-live-search="true" data-size="8" name="@parameter" multiple> 286 @foreach (LoopItem option in facetOptionsList.OrderByDescending(o => o.GetInteger("FacetOption.Label"))) 287 { 288 bool facetOptionChecked = option.GetBoolean("FacetOption.Selected"); 289 string value = option.GetString("FacetOption.Value"); 290 string nameOption = option.GetString("FacetOption.Name"); 291 292 <option selected="@facetOptionChecked" value="@value" >@option.GetString("FacetOption.Label")</option> 293 } 294 </select> 295 </fieldset> 296 } 297 298 break; 299 case "checkboxes": 300 301 if (loopItem.GetLoop("FacetOptions").Any()) 302 { 303 int count = 0; 304 305 <fieldset data-type="@parameterType"> 306 <legend class="filterTitle"> 307 @if(name == "Producator"){ 308 <span>Producator/Brand</span> 309 }else if(name == "Furnizor"){ 310 <span>Reprezentant/Dealer</span> 311 }else if(name == "Sectiune"){ 312 <span>Domeniu</span> 313 }else if(name == "Subcategorie"){ 314 <span>Produse si servicii</span> 315 }else{ 316 @name 317 } 318 </legend> 319 @if(name != "Sectiune"){ 320 <div id="@name" class="filtersContainer"> 321 @foreach (LoopItem option in facetOptionsList.OrderBy (p => p.GetString("FacetOption.Label"))) 322 { 323 bool facetOptionChecked = option.GetBoolean("FacetOption.Selected"); 324 string value = option.GetString("FacetOption.Value") != "" ? System.Web.HttpUtility.UrlEncode(option.GetString("FacetOption.Value")) : ""; 325 string nameOption = option.GetString("FacetOption.Name"); 326 count++; 327 string classString = count > 5 ? "hide" : ""; 328 329 <label class="checkBoxContainer @classString col-xs-12"> 330 <input checked="@facetOptionChecked" type="checkbox" value="@value" name="@parameter"> 331 <span> 332 @option.GetString("FacetOption.Label") 333 @* @if (option.GetInteger("FacetOption.Count") > 0) 334 { 335 string.Format("({0})", option.GetString("FacetOption.Count")); 336 }*@ 337 </span> 338 </label> 339 } 340 341 @if (loopItem.GetLoop("FacetOptions").Where(f => f.GetInteger("FacetOption.Count") != 0).Count() >= 1 && @name == "Producator") 342 { 343 <span class="seeMore" data-more='@Translate("seeMore", "See more")' data-hide='@Translate("only5", "Show only 5")'>Vezi Producator/Brand</span> 344 } 345 346 @if (loopItem.GetLoop("FacetOptions").Where(f => f.GetInteger("FacetOption.Count") != 0).Count() >= 1 && @name == "Furnizor") 347 { 348 <span class="seeMoreFurnizori" data-more='@Translate("seeMore", "See more")' data-hide='@Translate("only5", "Show only 5")'>Vezi Reprezentant/Dealer</span> 349 } 350 351 352 @if (loopItem.GetLoop("FacetOptions").Where(f => f.GetInteger("FacetOption.Count") != 0).Count() >= 1 && @name == "Subcategorie") 353 { 354 <span class="seeMoreSubcategorie" data-more='@Translate("seeMore", "See more")' data-hide='@Translate("only5", "Show only 5")'>Vezi Produse si servicii</span> 355 } 356 357 358 </div> 359 }else{ 360 <div id="@name" class="filtersContainer hide"> 361 @foreach (LoopItem option in facetOptions) 362 { 363 bool facetOptionChecked = option.GetBoolean("FacetOption.Selected"); 364 string value = option.GetString("FacetOption.Value"); 365 string nameOption = option.GetString("FacetOption.Name"); 366 367 368 count++; 369 string classString = count > 5 ? "hide" : ""; 370 371 <label class="checkBoxContainer @classString col-xs-12"> 372 <input checked="@facetOptionChecked" type="checkbox" value="@value" name="@parameter"> 373 <span> 374 @option.GetString("FacetOption.Label") 375 @if (option.GetInteger("FacetOption.Count") > 0) 376 { 377 string.Format("({0})", option.GetString("FacetOption.Count")); 378 } 379 </span> 380 </label> 381 } 382 383 384 385 </div> 386 } 387 </fieldset> 388 } 389 390 break; 391 case "select": 392 393 break; 394 case "checkbox": 395 396 if (loopItem.GetLoop("FacetOptions").Any()) 397 { 398 <fieldset data-type="@parameterType"> 399 @foreach (LoopItem option in facetOptionsList.Where(f => f.GetInteger("FacetOption.Count") != 0).OrderByDescending(o => o.GetInteger("FacetOption.Count")).ThenBy(or => or.GetString("FacetOption.Label"))) 400 { 401 bool facetOptionChecked = option.GetBoolean("FacetOption.Selected"); 402 string value = option.GetString("FacetOption.Value") == "True" ? "True" : ""; 403 string nameOption = option.GetString("FacetOption.Name"); 404 405 if (value == "True") 406 { 407 <legend class="filterTitle">@name</legend> 408 <div class="filtersContainer hide"> 409 <label class="checkBoxContainer"> 410 <input checked="@facetOptionChecked" type="checkbox" value="@value" name="@parameter"> <span>@name (@option.GetString("FacetOption.Count"))</span> 411 </label> 412 </div> 413 } 414 } 415 </fieldset> 416 } 417 418 break; 419 case "radio": 420 421 break; 422 case "radios": 423 424 break; 425 case "autocomplete": 426 427 break; 428 case "range": 429 break; 430 default: 431 <fieldset data-type="@parameterType"> 432 <legend class="filterTitle">@name</legend> 433 <div class="filtersContainer"> 434 <input type="text" name="@parameter" value=""/> 435 </div> 436 </fieldset> 437 break; 438 } 439 } 440 } 441 442 443 @helper RenderEcomNavigation(Dynamicweb.Ecommerce.Products.GroupCollection groupCollection) 444 { 445 groupCollection = groupCollection ?? new Dynamicweb.Ecommerce.Shops.Shop((string) Dynamicweb.Frontend.PageView.Current() 446 .Area.get_Value("AreaEcomShopID")) 447 .get_TopLevelGroups((string) Dynamicweb.Frontend.PageView.Current() 448 .Area.get_Value("AreaEcomLanguageID")); 449 450 foreach (var group in groupCollection) 451 { 452 string groupName = group.Name; 453 string groupId = group.Id; 454 455 if (group.Subgroups.Any()) 456 { 457 int numberOfParentGroups = group.ParentGroups.Count; 458 string hideSubgroups = numberOfParentGroups == 0 ? "hide" : ""; 459 460 <fieldset class="groupFieldset level_@numberOfParentGroups"> 461 <legend class="filterTitle deep_@numberOfParentGroups"> 462 463 @* IF SUB-GROUPS SHOULD NOT HAVE A CHECKBOX 464 @if ((bool) Pageview.Area.Item["ParentGroupsWithCheckbox"]) 465 *@ 466 @if (numberOfParentGroups > 0 || ((bool)Pageview.Area.Item["ParentGroupsWithCheckbox"] && numberOfParentGroups == 0) ) 467 { 468 <label class="checkBoxContainer "> 469 <input type="checkbox" value="@groupId" name="group"> 470 <span> 471 @groupName 472 </span> 473 </label> 474 } 475 else 476 { 477 <input class="hidden" type="checkbox" value="@groupId" name="group"> 478 @groupName 479 } 480 </legend> 481 482 <div class="filtersContainer containerDeep_@numberOfParentGroups @hideSubgroups"> 483 @RenderEcomNavigation(group.Subgroups) 484 </div> 485 </fieldset> 486 } 487 else 488 { 489 <label class="checkBoxContainer "> 490 <input type="checkbox" value="@groupId" name="group"> 491 <span> 492 @groupName 493 </span> 494 </label> 495 } 496 497 } 498 } 499 <div class="col-xs-12 removeFiltersContainer"> 500 @foreach (LoopItem facetGroup in GetLoop("FacetGroups")) 501 { 502 foreach (LoopItem facet in facetGroup.GetLoop("Facets")) 503 { 504 if (facet.GetLoop("FacetOptions").Any(r => r.GetBoolean("FacetOption.Selected"))) 505 { 506 <a data-queryname="@(facet.GetString("Facet.QueryParameter"))" class="btn btn-bg hidden-lg hidden-md hidden-sm hidden-xs" href="#">@facet.GetString("Facet.Name") <i class="fa fa-times"></i></a> 507 } 508 } 509 } 510 <a class="btn default-btn removeAll hidden" href="@CurrentPageID"><!--@Translate("removeallFilters", "Clear All")--> Reseteaza filtrele</a> 511 512 </div> 513 514 515 </div> 516 </div> 517 518 519 520 <div class="col-sm-9"> 521 <div class="main-content"> 522 <div class="category-header clearfix"> 523 <div class="sortBy"> 524 <!-- Split button --> 525 @if (userIsLoggedIn) 526 { 527 <div class="btn-group"> 528 <button type="button" class="btn btn-rtc">@Translate("Sorteaza dupa", "Sorteaza dupa")</button> 529 <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> 530 <span><i class="fa fa-angle-down"></i></span> 531 </button> 532 <ul class="dropdown-menu dropdown-menu-right" role="menu"> 533 <li><a onclick="SortProductsBy('Name')">@Translate("Nume", "Nume")</a></li> 534 <li class="divider"></li> 535 <li><a onclick="SortProductsBy('Price&amp;SortOrder=Asc')" class="pill-left">@Translate("Pret crescator", "Pret crescator") </a></li> 536 <li><a onclick="SortProductsBy('Price&amp;SortOrder=Desc')" class="pill-left">@Translate("Pret descrescator", "Pret descrescator") </a></li> 537 </ul> 538 </div> 539 } 540 </div> 541 <div class="pageView"> 542 543 <span class="text">@Translate("Produse pe pagina", "Produse pe pagina")</span> 544 <div class="btn-group"> 545 <button type="button" class="btn btn-rtc"> 546 @if (!string.IsNullOrEmpty(pageSizeParameter)) 547 { 548 @pageSizeParameter 549 } 550 else 551 { 552 @:20 553 } 554 </button> 555 <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> 556 <span><i class="fa fa-angle-down"></i></span> 557 </button> 558 <ul class="dropdown-menu"> 559 <li><a onclick="PageSize('20')">20</a></li> 560 <li><a onclick="PageSize('30')">30</a></li> 561 <li><a onclick="PageSize('50')">50</a></li> 562 </ul> 563 </div> 564 <span class="text-center">@Translate("Pagina", "Pagina") @GetValue("Ecom:ProductList.CurrentPage") @Translate("din", "din") @GetValue("Ecom:ProductList.TotalPages") (@GetValue("Ecom:ProductList.PageProdCnt") @Translate("produse", "produse"))</span> 565 </div> 566 <div class="displayMode"> 567 <p id="vizualizare">Vizualizare</p> 568 <button type="button" data-toggle="tooltip" title="Afiseaza lista!" onclick="ProductListView('List')"><span class="view-list"></span></button> 569 <button type="button" data-toggle="tooltip" title="Afiseaza grup!" onclick="ProductListView('Box')"><span class="view-box"></span></button> 570 <button type="button" data-toggle="tooltip" title="Afiseaza tabel!" onclick="ProductListView('Table')"><span class="view-table"></span></button> 571 </div> 572 </div> 573 574 <div class="breadcrumbs"> 575 <ul id="breadcrumbs" vocab="http://schema.org/" typeof="BreadcrumbList"> 576 <li property="itemListElement" typeof="ListItem"><a href='/' title="Acasa" property="item" typeof="WebPage"><span property="name">Acasa</span></a></li> 577 578 @RenderNavigation(new { 579 template = "Breadcrumb.xslt", 580 expandmode = "pathonly", 581 sitemapmode="true", 582 id = "NavBreadcrumb" 583 }) 584 </ul> 585 </div> 586 587 <div class="product-list clearfix" data-grouplink="@grouplink" data-compare-category='@GetString("Ecom:Group.ID")'> 588 589 590 @{ 591 string leitziprod = GetString("Ecom:Group.Link.Clean") + "&q=LeitzProgram2018"; 592 } 593 594 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:Group.LargeImage"))) 595 { 596 597 598 <div class="row"> 599 <div class="item col-xs-12 col-sm-12 col-lg-9"> 600 <a href='@leitziprod'><img src='@GetString("Ecom:Group.LargeImage")' /></a> 601 </div> 602 <div class="item col-xs-6 col-sm-6 col-lg-3"> 603 <a href='https://rtc.ro/Content/Newsletter/leitz-balance-program-2018/index.html'><img src='@GetString("Ecom:Group.SmallImage")' /></a> 604 </div> 605 </div> 606 } 607 608 609 610 @foreach (LoopItem categorii in GetLoop("Products")) 611 { 612 string GroupLinkk = categorii.GetString("Ecom:Product.LinkGroup.Clean"); 613 <p>@GroupLinkk</p> 614 } 615 <div class="row"> 616 @foreach (LoopItem product in GetLoop("Products")) 617 { 618 string Code = product.GetString("Ecom:Product.Number"); 619 @* string Image = product.GetString("Ecom:Product.ImageLarge.Default.Clean"); *@ 620 string ProductReferenceId = Code; 621 string imagesFolder = "/Files/Images/Products/Large/"; 622 string imagePattern = imagesFolder + ProductReferenceId + ".jpg"; 623 string productImage = GetImagePathUrl(GetString("Ecom:Product.ImageSmall.Clean"), GetString("Ecom:Product.ImageMedium.Clean"), GetString("Ecom:Product.ImageLarge.Clean"), imagePattern); 624 string productGetImage = GetImage(productImage, 0, 600); 625 string productGetImageZoom = GetImage(productImage, 0, 1200, 0, 0, 0, 0, "jpg"); 626 627 string GroupLink = product.GetString("Ecom:Product.LinkGroup.Clean"); 628 string Name = product.GetString("Ecom:Product.Name"); 629 string Description = product.GetString("Ecom:Product.ShortDescription"); 630 string Price = product.GetString("Ecom:Product.Price.PriceWithoutVAT"); 631 bool PriceUnavailable = Price == "0,00"; 632 633 string Currency = product.GetString("Ecom:Product.Price.Currency.Symbol"); 634 string Stock = product.GetString("Ecom:Product.Stock"); 635 string StockStatus = product.GetString("Ecom:Product:Stock.Text"); 636 string LoyaltyPoints = product.GetString("Ecom:Product.PointPrice"); 637 string GroupId = GetString("Ecom:Group.ID"); 638 bool SpecialOrder = product.GetBoolean("Ecom:Product:Field.ProdusDeComandaSpeciala"); 639 var bonus = product.GetString("Ecom:Product:Field.Bonus"); 640 if (product.GetBoolean("Ecom:Product:Field.ProdusDeComandaSpeciala")) 641 { 642 StockStatus = Translate("ComandaSpeciala", "Comanda speciala"); 643 } 644 if (PriceUnavailable) 645 { 646 StockStatus = Translate("ProdusMomentanIndisponibil", "Momentan indisponibil"); 647 } 648 649 string defaultVariant = product.GetString("Ecom:Product.DefaultVariantComboID"); 650 if (!string.IsNullOrEmpty(defaultVariant)) 651 { 652 GroupLink += ((GroupLink ?? "").Contains("?") ? "&" : "?") + "VariantID=" + defaultVariant; 653 } 654 655 <div class="item col-xs-6 col-sm-4 col-lg-3"> 656 657 <div class="product-box"> 658 @if (userIsLoggedIn) 659 { 660 if (product.GetBoolean("Ecom:Product.IsProductInFavoriteList")) 661 { 662 <span favorite-remove='@product.GetString("Ecom:Product.RemoveFromFavorites")' class="favorite" data-toggle="tooltip" data-placement="top" title='@Translate("Scoate produsul din wishlist","Scoate produsul din wishlist")'><i class="fa fa-star" aria-hidden="true"></i></span> 663 } 664 else 665 { 666 <span favorite-add='@product.GetString("Ecom:Product.AddToFavorites")' class="favorite" data-toggle="tooltip" data-placement="top" title='@Translate("Adauga produsul in wishlist","Adauga produsul in wishlist")'><i class="fa fa-star-o" aria-hidden="true"></i></span> 667 } 668 } 669 <a href="@GroupLink" class="detail" title="@Name"> 670 671 672 @if (product.GetBoolean("Ecom:Product:Field.Nou.Value") && !product.GetBoolean("Ecom:Product:Field.Lichidare.Value")) 673 { 674 675 <span class="badge-new">Nou</span> 676 677 } 678 else if (!product.GetBoolean("Ecom:Product:Field.Nou.Value") && product.GetBoolean("Ecom:Product:Field.Lichidare.Value")) 679 { 680 681 <span class="lichidareBox">Lichidare</span> 682 683 } 684 685 else if(bonus != "" && bonus != " "){ 686 687 <span class="bonusProductDetail" style="background-color: none;"><img src='@("/Files/Images/badges/" + @bonus + ".png")' width="60"></span> 688 689 } 690 691 692 693 694 695 <span class="image"><img src="@productGetImageZoom" /></span> 696 <span class="title">@Name</span> 697 @if (!userIsLoggedIn) 698 { 699 <span class="code">cod: @Code</span> 700 <p class="text-loggedout"> Pentru pret si disponibilitate stoc, autentifica-te sau solicita cont</p> 701 } 702 </a> 703 704 @if (userIsLoggedIn) 705 { 706 @*//show compare button*@ 707 <button type="button" class="compare" data-group-id='@GroupId' data-product-id='@product.GetString("Ecom:Product.ID")'>@Translate("compara", "compara")<i class="fa fa-square-o"></i></button> 708 <span class="code">cod: @Code</span> 709 if (!PriceUnavailable) 710 { 711 <span class="price">@Price @Currency</span> 712 } 713 714 } 715 716 @*//show loyalty points*@ 717 @if (userIsLoggedIn) 718 { 719 if (LoyaltyPoints != "0") 720 { 721 <span class="badge-lp">@LoyaltyPoints <br />puncte</span> 722 } 723 724 } 725 726 727 728 @*//show stock status*@ 729 @if (userIsLoggedIn) 730 { 731 if (@StockStatus == "Momentan indisponibil") 732 { 733 <span class="availability indisponibil" style="margin-top: 0.4em;"> @StockStatus </span> 734 735 } 736 else 737 { 738 <span class="availability" style="margin-top: 0.4em;"> @StockStatus </span> 739 if(Code.Substring(0, 8) == "PG200201" || Code.Substring(0, 8) == "PG200202" || Code.Substring(0, 8) == "PG200402" || Code.Substring(0, 8) == "PG200403|| Code.Substring(0, 8) == "ZSL549" || Code.Substring(0, 8) == "ZSL549" { 740 <span style="background:yellow; z-index: 1; float:right; margin-top: -28px; padding: 4px; font-weight:bold; color:red" class="pull-right;">PROMO</span> 741 } 742 } 743 744 } 745 746 747 748 749 @if (!userIsLoggedIn ) { 750 @* TODO: sterge stilul inline *@ 751 <a href="/Default.aspx?ID=7" class="button-login">@Translate("Login", "Login")</a> 752 753 } else if (userIsLoggedIn && !PriceUnavailable && @Stock != "0") { 754 <a href="@GroupLink" class="button"> 755 <button type="button" class="quick-view" data-group-id='@GroupId' data-product-id='@product.GetString("Ecom:Product.ID")'><i class="fa fa-eye" aria-hidden="true"></i></button> 756 <span>@Translate("Adauga in cos", "Adauga in cos")</span> 757 </a> 758 } else if (@Stock == "0" && SpecialOrder) { 759 <a href="@GroupLink" class="button"> 760 <button type="button" class="quick-view" data-group-id='@GroupId' data-product-id='@product.GetString("Ecom:Product.ID")'><i class="fa fa-eye" aria-hidden="true"></i></button> 761 <span>@Translate("Adauga in cos", "Adauga in cos")</span> 762 </a> 763 } 764 else if (@Stock == "0" || PriceUnavailable) { 765 <a href="@GroupLink" title="@Name"> 766 <span class="button"> 767 @Translate("Detalii","Detalii") 768 </span> 769 </a> 770 } 771 772 </div> 773 </div> 774 775 } 776 777 </div> 778 </div> 779 @using System.Text 780 @using System.Web 781 782 @{ 783 int currentPage = GetInteger("Ecom:ProductList.CurrentPage"); 784 int pageSize = GetInteger("Ecom:ProductList.PageSize"); 785 int totalPages = GetInteger("Ecom:ProductList.TotalPages"); 786 int pageId = GetInteger("Ecom:ProductList:Page.ID"); 787 788 789 StringBuilder querySb = new StringBuilder(); 790 string pageIdFromQuery = ""; 791 792 foreach (string key in HttpContext.Current.Request.QueryString.AllKeys) 793 { 794 if (key != null) 795 { 796 if (!key.ToUpper().Equals("ID") && !key.ToUpper().Equals("GROUPID") && !key.ToUpper().Equals("PAGENUM")) 797 { 798 string value = HttpContext.Current.Request.QueryString[key].ToString(); 799 querySb.Append("&"); 800 querySb.Append(String.Format("{0}={1}", key, HttpUtility.UrlEncode(value))); 801 } 802 if (key.Equals("ID")) 803 { 804 try 805 { 806 pageIdFromQuery = HttpContext.Current.Request.QueryString[key].ToString(); 807 } 808 catch { } 809 } 810 } 811 } 812 813 if (string.IsNullOrEmpty(pageIdFromQuery)) 814 { 815 pageIdFromQuery = pageId.ToString(); 816 } 817 string groupValue = HttpContext.Current.Request.QueryString.Get("GroupID"); 818 if (!string.IsNullOrEmpty(groupValue)) 819 { 820 groupValue = "&GROUPID=" + groupValue; 821 } 822 } 823 <div class="pagination-navigation"> 824 <ul class="pagination pagination-custom pull-right"> 825 @if (currentPage > 1) 826 { 827 <li><a href="Default.aspx?ID=@pageIdFromQuery&PageNum=1@(groupValue)@(querySb.ToString())"><i class="fa fa-angle-double-left"></i></a></li> 828 <li><a href="Default.aspx?ID=@pageIdFromQuery&PageNum=@(currentPage - 1)@(groupValue)@(querySb.ToString())"><i class="fa fa-angle-left"></i></a></li> 829 } 830 831 @{ 832 int firstPage = currentPage - 2; 833 if (firstPage < 1) 834 { 835 firstPage = 1; 836 } 837 if (firstPage > 1) 838 { 839 <li class="disabled"><a href="javascript:void(0);">...</a></li> 840 } 841 int lastPage = currentPage + 2; 842 if (lastPage > totalPages) 843 { 844 lastPage = totalPages; 845 } 846 for (int i = firstPage; i <= lastPage; i++) 847 { 848 if (i == currentPage) 849 { 850 <li class="active disabled"><a href="javascript:void(0);">@i</a></li> 851 } 852 else 853 { 854 <li><a href="Default.aspx?ID=@pageIdFromQuery&PageNum=@(i)@(groupValue)@(querySb.ToString())">@i</a></li> 855 } 856 } 857 if (lastPage < totalPages) 858 { 859 <li class="disabled"><a href="javascript:void(0);">...</a></li> 860 } 861 if (currentPage < totalPages) 862 { 863 <li><a href="Default.aspx?ID=@pageIdFromQuery&PageNum=@(currentPage + 1)@(groupValue)@(querySb.ToString())"><i class="fa fa-angle-right"></i></a></li> 864 <li><a href="Default.aspx?ID=@pageIdFromQuery&PageNum=@(totalPages)@(groupValue)@(querySb.ToString())"><i class="fa fa-angle-double-right"></i></a></li> 865 } 866 } 867 868 869 870 871 872 </ul> 873 </div> 874 875 </div> 876 877 @if(GetString("Ecom:ProductList.CurrentPage") == "1") { 878 <div style="clear: both;"> 879 @{ 880 var lungimea = GetString("Ecom:Group.Description").Length; 881 int lung = lungimea; 882 883 string authors = GetString("Ecom:Group.Description"); 884 string[] arrayWord = System.Text.RegularExpressions.Regex.Split(authors, "</p>"); 885 int lungg = arrayWord[0].Length; 886 } 887 <div class="desc-prev"> 888 @arrayWord[0] 889 </div> 890 <div class="collapse" id="collapseExample"> 891 892 <div class="card card-body"> 893 894 @GetString("Ecom:Group.Description").Substring(lungg,lung - lungg) 895 896 </div> 897 </div> 898 </div> 899 <p> 900 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:ProductList:Page.GroupID"))) 901 { 902 <button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample"> 903 Arata mai mult! 904 </button> 905 } 906 </p> 907 908 } 909 910 911 </div> 912 913 914 @SnippetStart("LowerCarousel") 915 916 @SnippetEnd("LowerCarousel") 917 918 919 920 @SnippetStart("Bottom") 921 <script src="/Files/Templates/Designs/RTC/assets/js/productList.js" type="text/javascript"></script> 922 @* <script type="text/javascript"> 923 924 function replaceUrlParam(url, paramName, paramValue){ 925 var pattern = new RegExp('\\b('+paramName+'=).*?(&|$)') 926 if(url.search(pattern)>=0){ 927 return url.replace(pattern,'$1' + paramValue + '$2'); 928 } 929 return url + (url.indexOf('?')>0 ? '&' : '?') + paramName + '=' + paramValue 930 } 931 932 function getQueryVariable(variable) 933 { 934 var query = window.location.search.substring(1); 935 var vars = query.split("&"); 936 for (var i=0;i<vars.length;i++) { 937 var pair = vars[i].split("="); 938 if(pair[0] == variable){return pair[1];} 939 } 940 return(false); 941 } 942 943 function PageSize(size) { 944 var url= window.location.href; 945 var paramExists = getQueryVariable("PageSize"); 946 var newUrl = replaceUrlParam(url, "PageSize", size); 947 window.location.href = newUrl; 948 } 949 950 function SortProductsBy(sortcode) { 951 var url= window.location.href; 952 var price = sortcode.split("&")[0]; 953 var sortOrder = sortcode.split("=")[1]; 954 if (sortcode.indexOf("Price") >= 0) { 955 var newUrl = replaceUrlParam(url, "sortBy", price); 956 newUrl = replaceUrlParam(newUrl, "SortOrder", sortOrder); 957 window.location.href = newUrl; 958 } else { 959 var newUrl = replaceUrlParam(url, "sortBy", sortcode); 960 newUrl = replaceUrlParam(newUrl, "SortOrder", ""); 961 window.location.href = newUrl; 962 } 963 964 // document.cookie = "sortby=" + sortcode; 965 // document.location.href = Page + "&SortBy=" + sortcode; 966 // var url= window.location.href; 967 // url = url.split("?")[0]; 968 // $("#productListForm").attr("action",url); 969 // $('[name="sortBy"]').val(""); 970 // $('[name="sortBy"]').attr("value", ""); 971 // $('[name="sortBy"]').val(sortcode); 972 // $("#productListForm").submit(); 973 } 974 975 976 977 </script>*@ 978 @SnippetEnd("Bottom")