コード例 #1
0
ファイル: StoreUrls.cs プロジェクト: thenotandy/DNNspot.Store
        public string Category(Category category, ProductSortByField productSortByField, int pageNumber)
        {
            if (!string.IsNullOrEmpty(category.Slug))
            {
                //return string.Format(@"/{0}-t{1}/{2}.aspx", tabWithCatalogMainDispatch.TabName, tabWithCatalogMainDispatch.TabID, category.Slug);

                //List<string> categorySlugs = storeContext.CategoryBreadcrumb.ConvertAll(c => c.Slug);
                //categorySlugs.Remove(category.Slug);

                List <string> categorySlugs = category.GetAllParents().ConvertAll(c => c.Slug);

                List <string> otherParams = new List <string>();
                if (!string.IsNullOrEmpty(productSortByField.Field))
                {
                    otherParams.Add("sb=" + productSortByField.GetValueString());
                }
                if (pageNumber > 1)
                {
                    otherParams.Add("pg=" + pageNumber);
                }

                return(SlugUrl(categorySlugs, category.Slug, otherParams.ToArray()));
            }
            else
            {
                return(CategoryHome());
            }
        }
コード例 #2
0
ファイル: StoreUrls.cs プロジェクト: thenotandy/DNNspot.Store
 public string Category(Category category, ProductSortByField productSortByField)
 {
     return(Category(category, productSortByField, 1));
 }