hi,
i want to search product details according to manufacturer . i got all the manufacturer -name bt i didnt get product details.And there is no method available in konakart API to get total number of products so please help me .
package org.argus.konakart;
import com.konakart.app.DataDescriptor;
import com.konakart.app.Manufacturer;
import com.konakart.app.ProductSearch;
import com.konakart.appif.ManufacturerIf;
import com.konakart.appif.ProductIf;
import com.konakart.appif.ProductsIf;
public class price extends BaseApiExample
{
public static void main(String[] args)
{
try
{
Search_Criteria();
}
catch(Exception e)
{
e.printStackTrace();
}
}
public static void Search_Criteria()
{
init();
try
{
ManufacturerIf manufacturer[];
DataDescriptor datadesc = new DataDescriptor();
datadesc.setOffset(0);
datadesc.setLimit(0);
ProductSearch prodsearch = new ProductSearch();
eng.searchForProducts(null, datadesc, prodsearch, -1);
manufacturer = eng.getAllManufacturers();
ProductIf product_list[];
System.out.println("The total number of manufacturer are ::" +manufacturer.length);
for(int i=0;i<manufacturer.length;i++)
{
ProductsIf products;
System.out.println("The name of manufacturer is :::: " +manufacturer.getName());
prodsearch.setManufacturerId(manufacturer.getId());
products = eng.getAllProducts(sessionId,datadesc, -1);
product_list = products.getProductArray();
//System.out.println("The name eof product is ::: " +product_list.getManufacturerName());
//prodsearch.setSearchInSubCats(true);
products = eng.searchForProducts(null, datadesc, prodsearch, -1);
//product_list = products.getProductArray();
for(int j=0;j<5;j++ )
{
System.out.println("The name of product is :::" +product_list.getName());
}
}
}
catch(Exception e)
{
e.printStackTrace();
}
}
}