• Welcome to KonaKart Community Forum. Please login or sign up.
 

get products for particular category

Started by sivaprakashcg, October 18, 2007, 03:24:04 pm

Previous topic - Next topic

sivaprakashcg

Hi,
       i have to select products for particular category. can any body help me.

Regards,
sivaprakash.G

julie

Yes !

You need to use the API call , getProductsPerCategory() . You can find details in the Javadoc:

getProductsPerCategory

ProductsIf getProductsPerCategory(java.lang.String sessionId,
                                  DataDescriptorIf dataDesc,
                                  int categoryId,
                                  boolean searchInSubCats,
                                  int languageId)
                                  throws com.konakart.app.KKExceptionReturns a Products object for the given category and language.

Only Products with a non zero status and non zero invisible are returned. The description (which can be very long) and the array of options are not set. Also only the first two custom fields are returned (custom1 and custom2). The specialPrice is null if a special offer doesn't exist for the product.

dataDesc may be null. In this case, the number of retrieved products is limited to a default number, the products are ordered by the ProductId and the offset is set to zero. However, by setting the attributes of dataDesc, the following functionality may be controlled :
The maximum number of Product objects returned.
The offset which defaults to zero. This is useful when there are many Product objects, in order to return them using multiple calls to this method.
Whether or not to return invisible products.
Criteria on the custom attributes. If a custom attribute is set then only products with a matching custom attribute value are returned.
The Products may be sorted by :
Name
Price Ascending
Price Descending
Date Added
Manufacturer
Times Viewed

Parameters:
sessionId -
dataDesc -
categoryId -
searchInSubCats - Determines whether products are searched for in the subcategories of the specified category
languageId - The id for the language that will be used. Value of -1 selects the default language.
Returns:
Returns a Products object
Throws:
com.konakart.app.KKException

Regards,

Julie