Error executing template "Designs/alcadon/eCom/ProductCatalog/espresso-product-list-with-facets.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_3358d96508c5494892de53e0bf6386d0.Execute() in E:\Dynamicweb.NET\Solutions\alcadon-espresso5-dk\Application\Files\Templates\Designs\alcadon\eCom\ProductCatalog\espresso-product-list-with-facets.cshtml:line 56
at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Dynamicweb.Rendering.ViewModelTemplate< ProductListViewModel > 2 @using System.Linq 3 @using System.Web 4 @using Co3.Alcadon.Data.Models 5 @using Co3.Espresso.Base.Extensions 6 @using Co3.Espresso.Website.Models.FrontEnd 7 @using Co3.Espresso.Website.Models.FrontEnd.Settings 8 @using Co3.Espresso.Website.Services 9 @using Dynamicweb.Content.Items 10 @using Dynamicweb.Ecommerce.ProductCatalog 11 @using Dynamicweb.Frontend 12 @using ProductListService = Co3.Alcadon.Data.Services.AlcadonProductListService 13 14 @{ 15 Item paragraphItem = PageView.Current().CurrentParagraph.Item; 16 string feedUrl = paragraphItem.GetValue< string >( "FeedUrl" ); 17 bool showGroupsAndGroupImage = string.IsNullOrEmpty( Dynamicweb.Context.Current.Request.QueryString.Get( "q" ) ) == true; 18 19 AlcadonProductList espressoProductList = ProductListService.Instance.GetEspressoProductList( new ProductListSettings() 20 { 21 Products = Model.Products.Select( 22 dynamicwebProductViewModel => ProductService.Instance.GetEspressoProductViewModel( 23 new ProductSettings() 24 { 25 DynamicwebProductViewModel = dynamicwebProductViewModel, 26 EmbeddedInModelList = true 27 } 28 ) 29 ).ToList(), 30 Group = Model.Group, 31 SubGroups = Model.SubGroups?.Where( g => Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup( g.Id )?.NavigationShowInMenu == true ).ToList(), 32 FacetGroups = Model.FacetGroups, 33 ProductCount = Model.TotalProductsCount, 34 PageCount = Model.PageCount, 35 PageSize = string.IsNullOrEmpty( HttpContext.Current.Request[ "PageSize" ] ) == false ? Convert.ToInt32( HttpContext.Current.Request[ "PageSize" ] ) : Model.PageSize, 36 CurrentPageNumber = string.IsNullOrEmpty( HttpContext.Current.Request[ "PageNum" ] ) == false ? Convert.ToInt32( HttpContext.Current.Request[ "PageNum" ] ) : Model.CurrentPage, 37 SortOptions = Co3.Espresso.Website.Services.ProductListService.Instance.GetSortOptions(), 38 Heading = Model.Group?.Name, 39 Classes = new ClassList( "e-productlist e-productlist-with-facets js-e-productlist-with-facets js-e-require" ), 40 HeaderClasses = new ClassList( "e-productlist-header col-12 order-1" ), 41 MainClasses = new ClassList( "e-productlist-main js-alcadon-productlist-toggle-container col-12 col-lg-9 order-2 order-lg-3" ), 42 AsideClasses = new ClassList( "e-productlist-aside col-12 col-lg-3 order-4 order-lg-2" ), 43 FooterClasses = new ClassList( "e-productlist-footer col-12 order-3 order-lg-4" ), 44 ItemClasses = Co3.Espresso.Website.Services.ProductListService.Instance.GetItemClasses(), 45 } ); 46 } 47 @RenderingService.Instance.SectionEnd() 48 <div class="@espressoProductList.Classes" data-feed-url="@feedUrl" data-is-using-ecommerce-navigation="@espressoProductList.IsUsingEcommerceNavigation.ToString().ToLowerInvariant()" data-page-count="@espressoProductList.PageCount" data-page-size="@espressoProductList.PageSize" data-product-count="@espressoProductList.ProductCount" data-require="productListWithFacets"> 49 @RenderingService.Instance.SectionStart( new SectionSettings 50 { 51 Classes = new ClassList( "e-section e-theme-light py-2" ) 52 } ) 53 54 <div class="@espressoProductList.HeaderClasses"> 55 <div class="border-bottom mb-2 small"> 56 <h1>@espressoProductList.Group.Name</h1> 57 @if ( string.IsNullOrEmpty( espressoProductList.Group.Description ) == false ) 58 { 59 <div class="row"> 60 <div class="col-12 col-lg-10 col-md-11 col-xl-9">@espressoProductList.Group.Description</div> 61 </div> 62 } 63 </div> 64 </div> 65 66 <div class="@espressoProductList.MainClasses"> 67 @if ( showGroupsAndGroupImage == true ) 68 { 69 @RenderingService.Instance.PartialView( "ecom/productcatalog/partials/list/groups.cshtml", espressoProductList ) 70 } 71 @if ( espressoProductList.ShowExpandedGroupView == false ) 72 { 73 if ( showGroupsAndGroupImage == true ) 74 { 75 @RenderingService.Instance.PartialView( "ecom/productcatalog/partials/list/group-image.cshtml", espressoProductList ) 76 } 77 @RenderingService.Instance.PartialView( "ecom/productcatalog/partials/list/header.cshtml", espressoProductList ) 78 <div class="e-productlist-facets js-e-productlist-facets"> 79 @RenderingService.Instance.PartialView( "ecom/productcatalog/partials/list/facets.cshtml", espressoProductList ) 80 </div> 81 @RenderingService.Instance.PartialView( "ecom/productcatalog/partials/list/products.cshtml", espressoProductList 82 ) 83 @RenderingService.Instance.PartialView( "ecom/productcatalog/partials/list/paging.cshtml", espressoProductList ) 84 } 85 </div> 86 <div class="@espressoProductList.AsideClasses"> 87 <div class="row"> 88 @RenderingService.Instance.PartialView( "ecom/productcatalog/partials/list/navigation.cshtml", espressoProductList ) 89 @RenderingService.Instance.PartialView( "ecom/productcatalog/partials/list/aside-content.cshtml", espressoProductList ) 90 </div> 91 </div> 92 @if ( espressoProductList.ShowExpandedGroupView == false ) 93 { 94 <div class="@espressoProductList.FooterClasses"> 95 @RenderingService.Instance.PartialView( "ecom/productcatalog/partials/list/footer.cshtml", espressoProductList ) 96 </div> 97 } 98 99 @RenderingService.Instance.SectionEnd() 100101 @RenderingService.Instance.PartialView( "ecom/productcatalog/partials/list/alcadon-category-content.cshtml", espressoProductList ) 102103 </div> 104105 @RenderingService.Instance.SectionStart( new SectionSettings() ) 106
keyboard_arrow_up