Developer Resources for AbleCommerce eCommerce platform
CommerceBuilder.Products Namespace / IProductRepository Interface / CountForCategory Method / CountForCategory(Int32,Boolean,Boolean) Method
The ID of the category to count products for.
If true products are counted in the current category and any of it's children.
If true only public (published) products are counted. Default value is false
In This Topic
    CountForCategory(Int32,Boolean,Boolean) Method
    In This Topic
    Counts the number of products in the given category.
    Syntax
    int CountForCategory( 
       int categoryId,
       bool recurse,
       bool publicOnly
    )

    Parameters

    categoryId
    The ID of the category to count products for.
    recurse
    If true products are counted in the current category and any of it's children.
    publicOnly
    If true only public (published) products are counted. Default value is false

    Return Value

    The Number of Product objects for the given ManufacturerId in the database.
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also