KonaKart Community Forum

General Category => Feature Requests => Topic started by: ssharma on February 18, 2008, 08:44:46 am

Title: HOw to find total number of categories exists
Post by: ssharma on February 18, 2008, 08:44:46 am
hi
i am getting the method from which i will get the total number of categories in root.
Title: Re: HOw to find total number of categories exists
Post by: ryan on February 18, 2008, 08:51:32 am
Hi,

Try the method of the application API : public CategoryIf[] getCategoryTree(int languageId, boolean getNumProducts) throws KKException;

Javadoc:

/**
     * Returns a category tree structure consisting of an array of top level categories, each of
     * which may contain an array of child categories.
     * <p>
     * The name of the category is language dependent and will be returned in the language defined
     * by the <code>languageId</code> parameter.
     * <p>
     * Each Category class contains a <code>numberOfProducts</code> field that describes how many
     * products exist for that category. It is only calculated if the <code>getNumProducts</code>
     * input parameter is set to true. For performance reasons this parameter should be set to false
     * if <code>numberOfProducts</code> is not required.
     *
     * @param languageId
     *            The id for the language that will be used to determine the Category name. Value of
     *            -1 selects the default language.
     * @param getNumProducts
     *            A boolean that specifies whether the Category objects should have the
     *            numberOfProducts attribute set.
     * @return Array of Category objects
     * @throws KKException
     */