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.
Just before that line, try adding ( using the ORDER_BY parameter that you prefer ):
kkAppEng.getProductMgr().setDefaultOrderBy(DataDescConstants.ORDER_BY_NAME_DESCENDING);
Thanks! Sadly, the sort option I want "ORDER_BY_DATE_ADDED_DESC" does not exist. :-[
Just use DataDescConstants.ORDER_BY_DATE_ADDED .