Author Topic: HOw to find total number of categories exists  (Read 1436 times)

ssharma

  • Jr. Member
  • **
  • Posts: 26
    • View Profile
HOw to find total number of categories exists
« on: February 18, 2008, 03:44:46 AM »
hi
 i am getting the method from which i will get the total number of categories in root.

ryan

  • Administrator
  • Sr. Member
  • *****
  • Posts: 190
    • View Profile
    • KonaKart Website
Re: HOw to find total number of categories exists
« Reply #1 on: February 18, 2008, 03: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
     */