KonaKart Community Forum

Installation / Configuration => Programming of KonaKart => Topic started by: Simon on September 14, 2011, 11:11:38 am

Title: Get BestSellers Per Category
Post by: Simon on September 14, 2011, 11:11:38 am
Hi guys,

I wrote below code,  try to get best sellers from per category:

int catId = ParamUtil.getInteger(renderRequest, "kkCategoryId");
System.out.println("catID : " + catId);
ProductMgr pMgr = (ProductMgr) renderRequest.getAttribute("pMgr");
ProductIf[] productIfs = pMgr.getBestSellersPerCategory(catId, true);

but i can't get anything from getBestSellersPerCategory(catId, boolean), before i call this function, I already get catId value,
is there anything wrong in these code i wrote?

Thanks.
Title: Re: Get BestSellers Per Category
Post by: julie on September 14, 2011, 11:18:30 am
Are you sure you have any products that have been sold within the category? Look at the products_ordered attribute of the product table.
Title: Re: Get BestSellers Per Category
Post by: Simon on September 14, 2011, 11:32:33 am
sure, getBestSellers() works fine, can get all of the products sold.
Title: Re: Get BestSellers Per Category
Post by: Simon on September 14, 2011, 01:56:15 pm
sorry guys, it works now, my fault. :P