Hello,
Is there a way to display all featured products in certain category ? right now , featured products box display products across all category .
Thanks !
Featured product in a category ?
-
- Lieutenant, Jr. Grade (LT JG)
- Posts: 28
- Joined: Wed Jun 04, 2008 1:45 am
Re: Featured product in a category ?
The support for this is already in the API. You just need to pass some valid CategoryId to the method instead of 0. For this you just need to modify the ConLib/FeaturedProductsGrid.ascx.cs file change the following line of code
For example if you are picking the CategoryId from the URL and the control is placed over the category page then you can change the above line as
Code: Select all
ProductList.DataSource = ProductDataSource.GetRandomFeaturedProducts(0, true, this.Size);
Code: Select all
int cid = PageHelper.GetCategoryId();
ProductList.DataSource = ProductDataSource.GetRandomFeaturedProducts(cid, true, this.Size);