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

Configuring product sort order

Started by fizzlepop, November 17, 2010, 09:23:50 pm

Previous topic - Next topic

fizzlepop

Okay, Yes I have searched the forum and looked at previous threads about customizing the sort order for products, but I didn't see where the suggested solutions apply, so I will re-post this question.

I am using KonaKart 4.2.0.1.

I only want to change the sort order of products as they are displayed when the user is viewing products within a category.  Naturally, I looked at the source of SelectCategoryAction1.  However the only line of code that I can tell which fetches the products is:

int prodsFound = kkAppEng.getCategoryMgr().setCurrentCatAndUpdateProducts1(catIdInt);

I can't modify the source of CategoryMgr.setCurrentCatAndUpdateProducts1 method - or can I?  Where is the appropriate place to customize the product query?

Thanks.


trevor

Just before that line, try adding ( using the ORDER_BY parameter that you prefer ):

kkAppEng.getProductMgr().setDefaultOrderBy(DataDescConstants.ORDER_BY_NAME_DESCENDING);

fizzlepop

Thanks!  Sadly, the sort option I want "ORDER_BY_DATE_ADDED_DESC" does not exist.  :-[

trevor

Just use DataDescConstants.ORDER_BY_DATE_ADDED .