Skip to main content
Error executing template "Designs/keflico/eCom/Productlist/products.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_513bd900382b442b9bd5242f0b845b52.FindTopGroup(Group group) in D:\dynamicweb.net\Solutions\Gotcha\keflico.cloud.dynamicweb-cms.com\Files\Templates\Designs\keflico\eCom\Productlist\products.cshtml:line 541
   at CompiledRazorTemplates.Dynamic.RazorEngine_513bd900382b442b9bd5242f0b845b52.Execute() in D:\dynamicweb.net\Solutions\Gotcha\keflico.cloud.dynamicweb-cms.com\Files\Templates\Designs\keflico\eCom\Productlist\products.cshtml:line 139
   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 @using System.Web; 2 @using Dynamicweb.Ecommerce; 3 4 @{ 5 string AllProductsPage = Pageview.Area.Item["AllProductsPage"].ToString(); 6 bool isloggedin = false; 7 8 string sortBy = GetString("Ecom:ProductList.SortBy"); 9 string sortOrder = GetString("Ecom:ProductList.SortOrder"); 10 11 bool isStandardSorting = string.IsNullOrWhiteSpace(HttpContext.Current.Request.QueryString["Sortby"]); 12 13 if (!string.IsNullOrWhiteSpace(GetGlobalValue("Global:Extranet.UserName").ToString())) { 14 isloggedin = true; 15 } 16 } 17 18 <header class="header header-overview module module-sand-light"> 19 <div class="breadcrumbs"> 20 @RenderNavigation(new { 21 StartLevel = 1, 22 EndLevel = 4, 23 ExpandMode = "Pathonly", 24 Template = "breadcrumbs.xslt" 25 }) 26 </div> 27 @if(String.IsNullOrWhiteSpace(GetString("Ecom:ProductList:Page.GroupID"))) { 28 <h1 class="header__title">@Translate("Translate_TopLevelGroup_Headline")</h1> 29 <p>@Translate("Translate_TopLevelGroup_Text")</p> 30 } else { 31 <h1 class="header__title">@GetString("Ecom:Group.Name")</h1> 32 33 if(!String.IsNullOrWhiteSpace(GetString("Ecom:Group.Description"))) { 34 @GetString("Ecom:Group.Description") 35 } 36 } 37 38 </header> 39 40 @if(GetLoop("ProductGroups").Count() > 0 && String.IsNullOrWhiteSpace(GetString("Ecom:ProductList:Page.GroupID"))) { 41 <section class="category-page module module-sand"> 42 <article class="card-list__wrapper"> 43 <a href="@AllProductsPage" class="all-link"> 44 @Translate("Translate_ProductList_SeeAllProducts") 45 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 19.006 11.031"> 46 <g class="arrow" transform="translate(441 901.014) rotate(180)"> 47 <path class="angle" d="M-17182.074-20447.988l4.809-4.809,4.809,4.809" transform="translate(20875.289 -16281.768) rotate(-90)" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/> 48 <line class="line" x2="17" transform="translate(423.5 895.5)" stroke-linecap="round" stroke-width="1"/> 49 </g> 50 </svg> 51 </a> 52 <ul class="card-list"> 53 @foreach (var group in GetLoop("ProductGroups")) { 54 bool show = group.GetBoolean("Ecom:Group.ShowInMenu"); 55 if(show) { 56 string groupLink = "/Default.aspx?Id=" + Pageview.Page.ID + "&GroupID=" + group.GetString("Ecom:Group.ID"); 57 string groupName = group.GetString("Ecom:Group.Name"); 58 string groupImage = group.GetString("Ecom:Group.LargeImage"); 59 string groupImageLg = "/admin/public/getimage.ashx?Image=" + HttpUtility.UrlEncode(groupImage) + "&Width=665&Height=665&Crop=0&Compression=100"; 60 string groupImageMd = "/admin/public/getimage.ashx?Image=" + HttpUtility.UrlEncode(groupImage) + "&Width=512&Height=512&Crop=0&Compression=100"; 61 string groupImageSm = "/admin/public/getimage.ashx?Image=" + HttpUtility.UrlEncode(groupImage) + "&Width=415&Height=415&Crop=0&Compression=100"; 62 string groupImageDefault = "/admin/public/getimage.ashx?Image=" + HttpUtility.UrlEncode(groupImage) + "&Width=620&Height=620&Crop=0&Compression=100"; 63 64 <li class="card-list__card"> 65 <a href="@groupLink" class="card__wrapper"> 66 <picture class="card__picture"> 67 <source srcset="@groupImageLg" media="(min-width: 1536px)"> 68 <source srcset="@groupImageMd" media="(min-width: 992px)"> 69 <source srcset="@groupImageSm" media="(min-width: 768px)"> 70 <img src="@groupImageDefault" alt="@groupName"> 71 </picture> 72 <ul class="card__info-list"> 73 <li class="card__info-list__item"> 74 <span class="info info--large">@groupName</span> 75 </li> 76 </ul> 77 </a> 78 </li> 79 } 80 81 } 82 </ul> 83 </article> 84 </section> 85 } else if(GetLoop("Subgroups").Count() > 0) { 86 var currentGroup = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(GetString("Ecom:Group.ID")); 87 var currentToplevel = FindTopGroup(currentGroup); 88 string allLink = AllProductsPage + "&Group=" + currentGroup.Name; 89 90 <section class="category-page module module-sand"> 91 <article class="card-list__wrapper"> 92 <a href="@allLink" class="all-link"> 93 @Translate("Translate_ProductList_SeeAllProducts") 94 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 19.006 11.031"> 95 <g class="arrow" transform="translate(441 901.014) rotate(180)"> 96 <path class="angle" d="M-17182.074-20447.988l4.809-4.809,4.809,4.809" transform="translate(20875.289 -16281.768) rotate(-90)" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/> 97 <line class="line" x2="17" transform="translate(423.5 895.5)" stroke-linecap="round" stroke-width="1"/> 98 </g> 99 </svg> 100 </a> 101 <ul class="card-list"> 102 @foreach (var group in GetLoop("Subgroups")) { 103 bool show = group.GetBoolean("Ecom:Group.ShowInMenu"); 104 if(show) { 105 string groupLink = "/Default.aspx?Id=" + Pageview.Page.ID + "&GroupID=" + group.GetString("Ecom:Group.ID"); 106 string groupName = group.GetString("Ecom:Group.Name"); 107 string groupImage = group.GetString("Ecom:Group.LargeImage"); 108 string groupImageLg = "/admin/public/getimage.ashx?Image=" + HttpUtility.UrlEncode(groupImage) + "&Width=665&Height=665&Crop=0&Compression=100"; 109 string groupImageMd = "/admin/public/getimage.ashx?Image=" + HttpUtility.UrlEncode(groupImage) + "&Width=512&Height=512&Crop=0&Compression=100"; 110 string groupImageSm = "/admin/public/getimage.ashx?Image=" + HttpUtility.UrlEncode(groupImage) + "&Width=415&Height=415&Crop=0&Compression=100"; 111 string groupImageDefault = "/admin/public/getimage.ashx?Image=" + HttpUtility.UrlEncode(groupImage) + "&Width=620&Height=620&Crop=0&Compression=100"; 112 113 if(groupName.ToLower().Contains("alle") || groupName.ToLower().Contains("all")) { 114 groupLink = allLink; 115 } 116 117 <li class="card-list__card"> 118 <a href="@groupLink" class="card__wrapper"> 119 <picture class="card__picture"> 120 <source srcset="@groupImageLg" media="(min-width: 1536px)"> 121 <source srcset="@groupImageMd" media="(min-width: 992px)"> 122 <source srcset="@groupImageSm" media="(min-width: 768px)"> 123 <img src="@groupImageDefault" alt="@groupName"> 124 </picture> 125 <ul class="card__info-list"> 126 <li class="card__info-list__item"> 127 <span class="info info--large">@groupName</span> 128 </li> 129 </ul> 130 </a> 131 </li> 132 } 133 } 134 </ul> 135 </article> 136 </section> 137 } else { 138 var currentGroup = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(GetString("Ecom:Group.ID")); 139 var currentToplevel = FindTopGroup(currentGroup); 140 141 <section class="module module-sand product-overview"> 142 <aside id="productFilters" class="filter-section" data-group="@currentGroup.Id" data-top-group="@currentToplevel.Name" data-all="false"> 143 <div class="filter-section__header"> 144 <h3>@Translate("Translate_ProductList_FilterHeadline")</h3> 145 146 <div class="filter-section__exit" id="filter-article-close"> 147 <svg xmlns="http://www.w3.org/2000/svg" width="10.819" height="10.819" viewBox="0 0 10.819 10.819"> 148 <g id="Group_1017" data-name="Group 1017" transform="translate(-1.591 2.559)"> 149 <rect id="Rectangle_702" data-name="Rectangle 702" width="14" height="1.3" rx="0.65" transform="translate(1.591 7.341) rotate(-45)"/> 150 <rect id="Rectangle_703" data-name="Rectangle 703" width="14" height="1.3" rx="0.65" transform="translate(2.51 -2.559) rotate(45)"/> 151 </g> 152 </svg> 153 </div> 154 </div> 155 <ul v-if="showFilters" class="filter-section__filter-list"> 156 <li v-for="facet in facets" v-if="((facet.QueryParameter != 'Group' && currentGroup && !allProducts) || allProducts) && sortedOptions(facet.Options).length > 1" :class="'filter-item filter-item--' + facet.RenderType.toLowerCase()"> 157 <template v-if="facet.RenderType.toLowerCase() != 'range'"> 158 <input class="filter-item__checkbox-toggle" type="checkbox" :id="facet.QueryParameter" aria-checked="true"> 159 <label class="filter-item__header" :for="facet.QueryParameter"> 160 <span class="filter-item__header__title">{{ translation('Translate_ProductList_Filter_' + facet.QueryParameter) }}</span> 161 </label> 162 </template> 163 164 <div class="filter-item__body"> 165 <ul class="filter-item__input-list"> 166 <template v-if="facet.RenderType.toLowerCase() == 'range'"> 167 <li class="input-list__filter"> 168 <label for="filter-length">{{ translation('Translate_ProductList_Filter_' + facet.QueryParameter.replace('Start', '')) }}</label> 169 <div class="duo-range-slider"> 170 <input class="duo-range-slider__range filter-option" :data-name="facet.QueryParameter" :name="facet.QueryParameter" :value="getLowestValue(facet.Options)" :min="getLowestValue(facet.Options)" :max="getHighestValue(facet.Options)" step="1" type="range"> 171 <input class="duo-range-slider__range filter-option" :data-name="facet.QueryParameter.replace('Start', 'End')" :name="facet.QueryParameter.replace('Start', 'End')" :value="getHighestValue(facet.Options)" :min="getLowestValue(facet.Options)" :max="getHighestValue(facet.Options)" step="1" type="range"> 172 <div class="duo-range-slider__values"> 173 <div class="duo-range-slider__values-min"><span>{{ facet.Options[0].Value }}</span> mm</div> 174 <div class="duo-range-slider__values-max"><span>{{ facet.Options.at(-1).Value }}</span> mm</div> 175 </div> 176 </div> 177 </li> 178 </template> 179 <template v-else-if="facet.RenderType.toLowerCase() == 'select'"> 180 <li class="input-list__filter"> 181 <div class="search-select"> 182 <div class="search-select__search"> 183 <input class="search-select__search-input" type="search" :placeholder="translation('Translate_General_SearchFor') + ' ' + translation('Translate_ProductList_Filter_' + facet.QueryParameter)"> 184 <button class="search-select__search-clear" type="button">@Translate("Translate_Close")</button> 185 </div> 186 <div class="search-select__dropdown"> 187 <label v-for="option in sortedOptions(facet.Options)" class="search-select__dropdown-item" :for="option.Value">{{ option.Value }}</label> 188 </div> 189 <div class="search-select__tags"> 190 <template v-for="option in sortedOptions(facet.Options)"> 191 <input type="checkbox" class="filter-option" :data-name="facet.QueryParameter" :name="facet.QueryParameter + stringAddition(facet.QueryParameterType)" :value="option.Value" :id="option.Value"> 192 <label :for="option.Value">{{ option.Label }}</label> 193 </template> 194 </div> 195 </div> 196 </li> 197 </template> 198 <template v-else> 199 <li class="input-list__filter"> 200 <template v-for="option in sortedOptions(facet.Options)"> 201 <div class="form__fieldset" v-if="facet.QueryParameter != 'Type'"> 202 <div class="form__field-wrap"> 203 <input type="checkbox" class="form__field form__field--checkbox filter-option" :data-name="facet.QueryParameter" :name="facet.QueryParameter + stringAddition(facet.QueryParameterType)" :value="option.Value" :id="option.Value"> 204 <label :for="option.Value">{{ option.Label }}</label> 205 </div> 206 </div> 207 <div class="form__fieldset" v-if="facet.QueryParameter == 'Type' && !(option.Label == 'kunde' || option.Label == 'relatordre')"> 208 <div class="form__field-wrap"> 209 <input type="checkbox" class="form__field form__field--checkbox filter-option" :data-name="facet.QueryParameter" :name="facet.QueryParameter + stringAddition(facet.QueryParameterType)" :value="option.Value" :id="option.Value"> 210 <label :for="option.Value">{{ translation(`Translate_Filter_ProductType_${option.Label}`) }}</label> 211 </div> 212 </div> 213 </template> 214 </li> 215 </template> 216 </ul> 217 </div> 218 </li> 219 </ul> 220 <div class="filter-section__footer"> 221 <div class="footer-controls"> 222 <button id="clearFilterButton" class="btn btn-link">@Translate("Translate_ProductList_ResetFilters")</button> 223 <button id="applyFilterButton" class="btn btn-secondary btn--small">@Translate("Translate_ProductList_ApplyFilters")</button> 224 </div> 225 </div> 226 </aside> 227 <article class="card-list__wrapper"> 228 <div class="card-list__header"> 229 <div class="form__fieldset mobile-only"> 230 <button class="btn btn-secondary" id="toggle-filter-btn"> 231 @Translate("Translate_Filter") 232 </button> 233 </div> 234 <div class="form__fieldset"> 235 <label for="sorting" class="select-label">@Translate("Translate_ProductList_SortBy")</label> 236 <select class="form__field--narrow form__field-wrap--select" id="sorting"> 237 <option value="default">@Translate("Translate_ProductList_SortOption_Highlighted")</option> 238 <option value="asc"@(!isStandardSorting && sortOrder.ToLower() == "asc" ? "selected" : "")>@Translate("Translate_ProductList_SortOption_Alphabetic")</option> 239 <option value="desc" @(!isStandardSorting && sortOrder.ToLower() == "desc" ? "selected" : "")>@Translate("Translate_ProductList_SortOption_ReverseAlpabetic")</option> 240 </select> 241 </div> 242 </div> 243 <ul class="card-list"> 244 @foreach(var product in GetLoop("Products")) { 245 string link = product.GetString("Ecom:Product.Link.Clean"); 246 string name = product.GetString("Ecom:Product.Name"); 247 string teaser = product.GetString("Ecom:Product:Field.Name2.Value.Clean"); 248 string productNumber = product.GetString("Ecom:Product.Number"); 249 string dbNumberLabel = product.GetString("Ecom:Product:Field.ProductDbNumber.Name"); 250 string dbNumber = product.GetString("Ecom:Product:Field.ProductDbNumber.Value"); 251 string primaryGroup = product.GetString("Ecom:Product.PrimaryGroupID").ToLower(); 252 var productLayout = !string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.ProductLayout")) ? product.GetString("Ecom:Product:Field.ProductLayout") : primaryGroup; 253 254 string labelCode = product.GetString("Ecom:Product:Field.ProductPurchaseCode"); 255 256 bool isBundleOnly = System.Convert.ToBoolean(product.GetString("Ecom:Product:Field.BundleOnly")); 257 bool usePriceExplanation = false; 258 259 string primaryPrice = product.GetString("Ecom:Product.Price.PriceWithoutVAT"); 260 string secondaryPrice = ""; 261 string tertiaryPrice = ""; 262 string primaryPriceDescription = ""; 263 string secondaryPriceDescription = ""; 264 string tertiaryPriceDescription = ""; 265 266 string priceCurrencySymbol = product.GetString("Ecom:Product.Currency.Symbol"); 267 string salesUnit = product.GetString("Ecom:Product.DefaultUnitName").ToLower(); 268 string salesUnitCode = product.GetString("Ecom:Product:Field.ProductLengthUnitCode"); 269 270 string productImage = product.GetString("Ecom:Product.ImageDefault.Clean"); 271 string productImageLg = "/admin/public/getimage.ashx?Image=" + HttpUtility.UrlEncode(productImage) + "&Width=416&Height=371&Crop=0&Compression=100"; 272 string productImageMd = "/admin/public/getimage.ashx?Image=" + HttpUtility.UrlEncode(productImage) + "&Width=310&Height=277&Crop=0&Compression=100"; 273 string productImageSm = "/admin/public/getimage.ashx?Image=" + HttpUtility.UrlEncode(productImage) + "&Width=230&Height=205&Crop=0&Compression=100"; 274 string productImageDefault = "/admin/public/getimage.ashx?Image=" + HttpUtility.UrlEncode(productImage) + "&Width=340&Height=304&Crop=0&Compression=100"; 275 276 switch(productLayout) { 277 case "group1": 278 if(isBundleOnly) { 279 primaryPrice = ""; 280 } 281 282 secondaryPrice = product.GetString("Ecom:Product:Field.ProductPriceBundle.Value").Replace(",", "-").Replace(".", ",").Replace("-", "."); 283 284 primaryPriceDescription = Translate("Translate_ProductDecription_Hardwood_Anbrud"); 285 secondaryPriceDescription = Translate("Translate_ProductDecription_Hardwood_Bundt"); 286 287 if(secondaryPrice.Contains(",")) { 288 string[] sp = secondaryPrice.Split(','); 289 290 if(sp[1].Length == 1) { 291 secondaryPrice += "0"; 292 } 293 } else { 294 secondaryPrice += ",00"; 295 } 296 297 break; 298 299 case "group32": 300 secondaryPrice = product.GetString("Ecom:Product:Field.ProductPriceAbove100SQM"); 301 302 primaryPriceDescription = Translate("Translate_ProductDecription_Terrase_Anbrud"); 303 secondaryPriceDescription = Translate("Translate_ProductDecription_Terrase_Above"); 304 305 usePriceExplanation = true; 306 307 if(secondaryPrice.Contains(",")) { 308 string[] sp = secondaryPrice.Split(','); 309 310 if(sp[1].Length == 1) { 311 secondaryPrice += "0"; 312 } 313 } else { 314 secondaryPrice += ",00"; 315 } 316 317 break; 318 319 case "group73": 320 secondaryPrice = product.GetString("Ecom:Product:Field.ProductPriceAbove100SQM"); 321 tertiaryPrice = product.GetString("Ecom:Product:Field.ProductPriceAbove3000M.Value").Replace(".", ","); 322 323 primaryPriceDescription = Translate("Translate_ProductDecription_Facade_Under1000"); 324 secondaryPriceDescription = Translate("Translate_ProductDecription_Facade_Between1000and3000"); 325 tertiaryPriceDescription = Translate("Translate_ProductDecription_Facade_Above3000"); 326 327 usePriceExplanation = true; 328 329 if(secondaryPrice.Contains(",")) { 330 string[] sp = secondaryPrice.Split(','); 331 332 if(sp[1].Length == 1) { 333 secondaryPrice += "0"; 334 } 335 } else { 336 secondaryPrice += ",00"; 337 } 338 339 if(tertiaryPrice.Contains(",")) { 340 string[] tp = tertiaryPrice.Split(','); 341 342 if(tp[1].Length == 1) { 343 tertiaryPrice += "0"; 344 } 345 } else { 346 tertiaryPrice += ",00"; 347 } 348 349 break; 350 351 case "group52": 352 case "group66": 353 secondaryPrice = product.GetString("Ecom:Product:Field.ProductPriceHalfParcel").Replace(",", "-").Replace(".", ",").Replace("-", "."); 354 tertiaryPrice = product.GetString("Ecom:Product:Field.ProductPriceCompleteParcel").Replace(",", "-").Replace(".", ",").Replace("-", "."); 355 356 primaryPriceDescription = Translate("Translate_ProductDecription_Plader_Anbrud"); 357 secondaryPriceDescription = Translate("Translate_ProductDecription_Plader_Half"); 358 tertiaryPriceDescription = Translate("Translate_ProductDecription_Plader_Full"); 359 360 if(secondaryPrice.Contains(",")) { 361 string[] sp = secondaryPrice.Split(','); 362 363 if(sp[1].Length == 1) { 364 secondaryPrice += "0"; 365 } 366 } else { 367 secondaryPrice += ",00"; 368 } 369 370 if(tertiaryPrice.Contains(",")) { 371 string[] tp = tertiaryPrice.Split(','); 372 373 if(tp[1].Length == 1) { 374 tertiaryPrice += "0"; 375 } 376 } else { 377 tertiaryPrice += ",00"; 378 } 379 380 break; 381 382 case "group126": 383 primaryPriceDescription = Translate("Translate_ProductDecription_Accessories"); 384 break; 385 386 default: 387 primaryPriceDescription = Translate("Translate_ProductDecription_General_Description"); 388 break; 389 } 390 391 392 <li class="card-list__card product-card"> 393 <a href="@link" class="card__wrapper"> 394 395 @switch (labelCode.ToLower()) 396 { 397 case "prøver": 398 <div class="card-list__label-code label-code label-code--samples">@Translate("LabelCode_" + labelCode.ToLower().Replace("ø", "oe"))</div> 399 break; 400 case "skaffe": 401 case "relatordre": 402 <div class="card-list__label-code label-code">@Translate("LabelCode_" + labelCode.ToLower())</div> 403 break; 404 default: 405 break; 406 } 407 408 @if (!String.IsNullOrWhiteSpace(productImage)) 409 { 410 <picture class="card__picture"> 411 <source srcset="@productImageLg" media="(min-width: 1536px)"> 412 <source srcset="@productImageMd" media="(min-width: 992px)"> 413 <source srcset="@productImageSm" media="(min-width: 768px)"> 414 <img src="@productImageDefault" alt="@name"> 415 </picture> 416 } 417 else 418 { 419 <div class="card__picture card__picture--dummie"></div> 420 } 421 422 <div class="card__info-list__item"> 423 <span class="info info--small info--header">@Translate("Translate_Product_Page_ProductNumber"): @productNumber</span> 424 @if (!string.IsNullOrWhiteSpace(dbNumber)) 425 { 426 <span class="info info--small info--header">@dbNumberLabel: @dbNumber</span> 427 } 428 </div> 429 <div class="card__info-list__item "> 430 <span class="info info--title">@name</span> 431 </div> 432 <div class="card__info-list__item"> 433 <span class="info info--small product-teaser">@teaser</span> 434 </div> 435 @if (isloggedin && ((!String.IsNullOrWhiteSpace(primaryPrice) && primaryPrice != "0,00" && primaryPrice != ",00") || (!String.IsNullOrWhiteSpace(secondaryPrice) && secondaryPrice != "0,00" && secondaryPrice != ",00") || (!String.IsNullOrWhiteSpace(tertiaryPrice) && tertiaryPrice != "0,00" && tertiaryPrice != ",00"))) 436 { 437 <div class="card__info-list__item column"> 438 @if (usePriceExplanation) 439 { 440 <div class="price-line price-line--explanation"> 441 @Translate("Translate_PriceExplanation_" + primaryGroup) 442 </div> 443 } 444 @if (!String.IsNullOrWhiteSpace(primaryPrice) && primaryPrice != "0,00" && primaryPrice != ",00") 445 { 446 <div class="price-line"> 447 <div class="definition">@primaryPriceDescription</div> 448 <div class="price">@primaryPrice <text> </text> @priceCurrencySymbol <text>pr.</text> @salesUnit</div> 449 </div> 450 } 451 452 @if (!String.IsNullOrWhiteSpace(secondaryPrice) && secondaryPrice != "0,00" && secondaryPrice != ",00") 453 { 454 <div class="price-line"> 455 <div class="definition">@secondaryPriceDescription</div> 456 <div class="price">@secondaryPrice <text> </text> @priceCurrencySymbol <text>pr.</text> @salesUnit</div> 457 </div> 458 } 459 460 @if (!String.IsNullOrWhiteSpace(tertiaryPrice) && tertiaryPrice != "0,00" && tertiaryPrice != ",00") 461 { 462 <div class="price-line"> 463 <div class="definition">@tertiaryPriceDescription</div> 464 <div class="price">@tertiaryPrice <text> </text> @priceCurrencySymbol <text>pr.</text> @salesUnit</div> 465 </div> 466 } 467 </div> 468 } 469 </a> 470 </li> 471 } 472 </ul> 473 @if(GetInteger("Ecom:ProductList.TotalPages") > 1) { 474 string prevClass = ""; 475 string nextClass = ""; 476 string extraPaginationClass = ""; 477 478 if(String.IsNullOrWhiteSpace(GetString("Ecom:ProductList.PrevPage.Clean"))) { 479 prevClass = " disabled"; 480 } 481 482 if(String.IsNullOrWhiteSpace(GetString("Ecom:ProductList.NextPage.Clean"))) { 483 nextClass = " disabled"; 484 } 485 486 if(GetInteger("Ecom:ProductList.TotalPages") > 5) { 487 extraPaginationClass = "navigation__pagination--overload"; 488 } 489 490 <div class="card-list__footer"> 491 <div class="card-list__navigation"> 492 <a href="@GetString("Ecom:ProductList.PrevPage.Clean")" class="navigation__arrow back@(prevClass)"> 493 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 6.503"><path d="M10.94,6.5,14,3.249,10.94,0H9.693L12.4,2.8H0v.9H12.4L9.693,6.5Z"/></svg> 494 </a> 495 496 <div class="navigation__pagination @extraPaginationClass"> 497 <span class="navigation__pagination__title"> @Translate("Translate_ProductList_BreadCrumbPage") </span> 498 @for (int i = 0; i < GetInteger("Ecom:ProductList.TotalPages"); i++) 499 { 500 string currentClass = (i + 1) == GetInteger("Ecom:ProductList.CurrentPage") ? " active" : ""; 501 string url = GetString("Ecom:Group.Link.Clean") + "&PageNum=" + (i + 1); 502 503 foreach(var query in GetLoop("Query.Parameters")) { 504 if(!String.IsNullOrWhiteSpace(query.GetString("Parameter.Value"))) { 505 url += "&" + query.GetString("Parameter.Name") + "=" + query.GetString("Parameter.Value"); 506 } 507 } 508 509 if(!isStandardSorting) { 510 url += "&Sortby=NameForSort" + "&SortOrder=" + sortOrder; 511 } 512 513 <a href="@url" class="navigation__pagination__link@(currentClass)">@(i + 1)</a> 514 } 515 </div> 516 <a href="@GetString("Ecom:ProductList.NextPage.Clean")" class="navigation__arrow forward@(nextClass)"> 517 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 6.503"><path d="M10.94,6.5,14,3.249,10.94,0H9.693L12.4,2.8H0v.9H12.4L9.693,6.5Z"/></svg> 518 </a> 519 </div> 520 </div> 521 } 522 </article> 523 </section> 524 } 525 526 @{ 527 string groupSeoText = GetString("Ecom:Group:Field.SEOText"); 528 529 if (!string.IsNullOrWhiteSpace(groupSeoText)) { 530 <article class="module module-sand-light"> 531 <div class="rich-text"> 532 @groupSeoText 533 </div> 534 </article> 535 } 536 } 537 538 @functions { 539 Dynamicweb.Ecommerce.Products.Group FindTopGroup(Dynamicweb.Ecommerce.Products.Group group) 540 { 541 if (group.IsTopGroup) 542 { 543 return group; 544 } 545 else if (group.ParentGroups != null && group.ParentGroups.Count > 0) 546 { 547 foreach (var parentGroup in group.ParentGroups) 548 { 549 Dynamicweb.Ecommerce.Products.Group topLevelGroup = FindTopGroup(parentGroup); 550 if (topLevelGroup != null) 551 { 552 return topLevelGroup; 553 } 554 } 555 } 556 return null; 557 } 558 } 559
Template:BaseUrlSystem.String/Files/Templates/Designs/keflico/QueryPublisher/
Template:DesignBaseUrlSystem.String/Files/Templates/Designs/keflico/
Loops

Facet Groups

Parameters

QueryResult

Page of
TemplateTags() in code (Designs\keflico\QueryPublisher/List.cshtml). Remove before going live...