Want to display only group products

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
Hello.

I have created one new page. Now I want to get displayed group products on that page from particular category.

Can any one guide me.

Thanks
6 years ago
@pms hello...

You can use the _productService.SearchProducts function available in IProductService


the function SearchProducts takes a list of inputs like

IPagedList<Product> SearchProducts(
            int pageIndex = 0,
            int pageSize = int.MaxValue,
            IList<int> categoryIds = null,
            int manufacturerId = 0,
            int storeId = 0,
            int vendorId = 0,
            int warehouseId = 0,
            ProductType? productType = null,
            bool visibleIndividuallyOnly = false,
            bool markedAsNewOnly = false,
            bool? featuredProducts = null,
            decimal? priceMin = null,
            decimal? priceMax = null,
            int productTagId = 0,
            string keywords = null,
            bool searchDescriptions = false,
            bool searchManufacturerPartNumber = true,
            bool searchSku = true,
            bool searchProductTags = false,
            int languageId = 0,
            IList<int> filteredSpecs = null,
            ProductSortingEnum orderBy = ProductSortingEnum.Position,
            bool showHidden = false,
            bool? overridePublished = null);


it returns a pagelist of all products...

let me know how far you went....


regards :)
6 years ago
pass productType.Group in parameter   ProductType in search product service.
6 years ago
Thanks for this help..

If I want to use this in cshtml file then can I do and also how can I access product id & name.

Thanks
6 years ago
@pms ..

The best way to show it in .cshtml it to bind the view with ViewModel which contains the group of products..

model would have this property ..

 public IList<Product> productList { get; set; }  


fill this Dto with actual product in your controller with the above mentioned function.


and then run a foreach loop in your .cshtml view
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.