Page 1 of 1
Featured product in a category ?
Posted: Sun Jul 27, 2008 6:35 pm
by sacards.com
Hello,
Is there a way to display all featured products in certain category ? right now , featured products box display products across all category .
Thanks !
Re: Featured product in a category ?
Posted: Mon Jul 28, 2008 4:45 am
by mazhar
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
Code: Select all
ProductList.DataSource = ProductDataSource.GetRandomFeaturedProducts(0, true, this.Size);
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
int cid = PageHelper.GetCategoryId();
ProductList.DataSource = ProductDataSource.GetRandomFeaturedProducts(cid, true, this.Size);