Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 3 of 3

Thread: Disable Empty Categories??

  1. #1
    PghKid is offline Junior Member
    Join Date
    May 2007
    Posts
    23

    Default Disable Empty Categories??

    I have a setup with around 400 categories, but not all the categories have products in them.

    is there a simple way of stopping 'empty categories' from showing on the left menu "Browse Categories" and the top horizontal drop down menu for categories - and only have it show categories in which there are actually products to have LESS CONFUSION for site visitors??

    thanks!

  2. #2
    Dusty is offline Member
    Join Date
    Jun 2009
    Posts
    176

    Default

    Your ideal way to do such would be to unpublish all categories that have no products. Given the volume of categories you have, your best approach is probably a simple query setting the published flag to 0 when no mappings are found in the ProductCategory table.

    Dusty
    ASPDotNetStorefront Staff

  3. #3
    miguelcrush is offline Senior Member
    Join Date
    Mar 2008
    Posts
    149

    Default

    I ran into this problem as well. If you think about this logically, just unpublishing the categories with no products could cause problems, especially if you have a tree like structure, where a category has sub categories. If those categories do not have products (which they may certainly not), those will be unpublished and your navigation structure may be crippled.

    The way I'd do it is create a recursive script that traverses your nav structure, and eventually sets the published flag to 0, after you establish that it's ok to do so.
    Mike Steyer
    Information Systems Admin