an ASP.NET Open Source CMS & eCommerce platform
Search:
Skip Navigation LinksHome > DotShoppingCart Forums > Development > General Programming > Category / Sub Category Product Listing
Last Post 3/30/2009 12:30:33 PM By macker999. 2 replies.
3/25/2009 3:37:42 PM
macker999
Posts: 30
Joined: 10/11/2008
Category / Sub Category Product Listing
Hi
 
Is it possible to detect when the category product listing page is displaying a category product list or sub category product list?
The reason I am asking this is that i would like to display a different page layout depending if the user has clicked on a category or subcategory.
 
Thanks
3/25/2009 4:02:32 PM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Category / Sub Category Product Listing
You use the following code to get back the category object which you can test to see if it has the parent.
 
string categoryPath = Utils.GetParameter("n");
category = Category.GetCategoryByCategoryPath(categoryPath);
DotShoppingCart Staff
3/30/2009 12:30:33 PM
macker999
Posts: 30
Joined: 10/11/2008
Re: Category / Sub Category Product Listing
Thanks Lukezy
 
I checked the category.ParentId value to determine if page is subcategory or category page.