Exemple #1
0
        public IEnumerable <DataSearchModel> GetCategories()
        {
            var response = _nopService.GetCategories();

            var data = response.Categories.Select(c => new DataSearchModel()
            {
                Label = c.Name,
                Value = c.Id
            });

            return(data);
        }
Exemple #2
0
        public IEnumerable <DataSearchModel> GetCategories()
        {
            var storeId = GlobalSettings.UmbracoSettings.NopStoreId;
            var isGetProductLimitToStore = GlobalSettings.UmbracoSettings.GetProductLimitToStore;

            var response   = _nopService.GetCategories();
            var categories = storeId != 0 && isGetProductLimitToStore?response.Categories.Where(category => category.StoreIds.Contains(storeId)).ToList() : response.Categories;

            var data = categories.Select(c => new DataSearchModel()
            {
                Label = c.Name,
                Value = c.Id
            });

            return(data);
        }