예제 #1
0
        public ProductFacetsViewModel GetFacets(Rendering currentRendering, int?pageNumber, string facetValues, string sortField, int?pageSize, CommerceConstants.SortDirection?sortDirection)
        {
            var currentCategory      = _catalogManager.GetCurrentCategoryByUrl();
            var productSearchOptions = new CommerceSearchOptions(pageSize.GetValueOrDefault(currentCategory.ItemsPerPage), pageNumber.GetValueOrDefault(0));

            SetSortParameters(currentCategory, ref sortField, ref sortDirection);
            UpdateOptionsWithFacets(currentCategory.RequiredFacets, facetValues, productSearchOptions);
            UpdateOptionsWithSorting(sortField, sortDirection, productSearchOptions);

            var productFacetsviewModel = GetProductFacetsViewModel(productSearchOptions, currentCategory.InnerItem, currentRendering);

            return(productFacetsviewModel);
        }