Featured product in a category ?

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
sacards.com
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 28
Joined: Wed Jun 04, 2008 1:45 am

Featured product in a category ?

Post by sacards.com » Sun Jul 27, 2008 6:35 pm

Hello,
Is there a way to display all featured products in certain category ? right now , featured products box display products across all category .
Thanks !

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Featured product in a category ?

Post by mazhar » Mon Jul 28, 2008 4:45 am

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);

Post Reply