Display product in grid

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
atulkhare
Lieutenant (LT)
Lieutenant (LT)
Posts: 72
Joined: Fri Oct 10, 2008 9:13 am

Display product in grid

Post by atulkhare » Thu Nov 20, 2008 12:37 am

but if i want to display product in grid according to category id so which one i should have to use...currently i am using featured products grid for displaying products according to category.
but the problem with this is when i add any new product at that time i have to click 0n to featured check box....i am using
ProductList.DataSource = ProductDataSource.GetRandomFeaturedProducts(0, true, this.Size);
is there any other way to do this same task?

Thanks and Regard
Atul khare

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

Re: Display product in grid

Post by mazhar » Thu Nov 20, 2008 2:21 am

Find out the product id for which you want to display the featured products and place the id in place of 0 in the following statement

Code: Select all

ProductList.DataSource = ProductDataSource.GetRandomFeaturedProducts(yourcategoryid, true, this.Size);

atulkhare
Lieutenant (LT)
Lieutenant (LT)
Posts: 72
Joined: Fri Oct 10, 2008 9:13 am

Re: Display product in grid

Post by atulkhare » Thu Nov 20, 2008 3:35 am

i am using
ProductList.DataSource = ProductDataSource.GetFeaturedProducts(int.Parse(Request.QueryString["cID"].ToString()), true);
instead of
productsDataSource.GetRandomfeaturedproducts(-,-,-)
is it correct or not?


Thanks And Regards
Atul khare

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

Re: Display product in grid

Post by mazhar » Thu Nov 20, 2008 3:42 am

Try the following code

Code: Select all

int categoryId = PageHelper.GetCategoryId();
ProductList.DataSource = ProductDataSource.GetFeaturedProducts(categoryId, true,8);
Where 8 is the size value you can provide your own size.

Post Reply