ProductCart E-Commerce Solutions Homepage
Forum Home Forum Home > ProductCart > Customizing ProductCart
  New Posts New Posts RSS Feed - Product count per category
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Product count per category

 Post Reply Post Reply
Author
Message
ClarkSmith View Drop Down
Newbie
Newbie


Joined: 20-January-2007
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote ClarkSmith Quote  Post ReplyReply Direct Link To This Post Topic: Product count per category
    Posted: 20-January-2007 at 12:30pm
Can anyone offer a snippet of code that would allow counts of products per category? I use categories heavily but don't have products for every category yet. So a user may dig four or five steps deep only to find there is nothing there. The count needs to be able to show total products in all subcategories as well in order to prevent people from clicking deeply into a category structure only to find nothing. It would look like this:

Bathroom Floors

Clean (3 products)
Protect (1 product)
Transform (No products yet available)

Structurally it would be thinking like this:
Bathrooms (8 products inside)
Floors (4 products inside)
Clean (3 products)
Cleaner 1
Cleaner 2
Cleaner 3
Protect (1 product)
Protector 1
Transform (0 products)
Sinks (4 products inside)
Cleaners (4 products)
Cleaner 1
Cleaner 2
Cleaner 3
Cleaner 4

Thanks in advance for any help!

Back to Top
NWilliams View Drop Down
Newbie
Newbie


Joined: 19-November-2006
Location: United States
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote NWilliams Quote  Post ReplyReply Direct Link To This Post Posted: 28-January-2007 at 9:39pm
Perform a select statement that would return all products in a category and use the Recordset.Recordcount property to retrieve the number of results in the recordset.

You should be able to poke around in some of the source and copy and paste code that would do the trick with minor editing.


To do what you're wanting, I would edit the GenerateNavigation.asp file to just not add the category to the navigation code if there are no products in its category or subcategories.  Rather complex, but I think it'd be the most user-friendly solution so long as you don't list subcategories from the view of a parent category.


Edited by NWilliams - 28-January-2007 at 9:41pm
Back to Top
ClarkSmith View Drop Down
Newbie
Newbie


Joined: 20-January-2007
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote ClarkSmith Quote  Post ReplyReply Direct Link To This Post Posted: 29-January-2007 at 8:12am
Thanks for taking the time, I'll give that a shot.
Professional-grade cleaning products for the home and building. http://www.clarksmith.biz
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.094 seconds.