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

Hiding empty filtered categories

Started by Ragin, March 28, 2012, 08:27:14 pm

Previous topic - Next topic

Ragin

Hi,

I have a problem with empty filtered categories. My categories have more than one level and so I want to hide empty categories after filtering by manufacturer (or more filter). The problem is, that I only can hide empty categories in JSP code because the possibility I've found was to do that by "numberOfProducts". But this only allows me to hide general empty categories.

A special at this shop is also that I need multi-manufacturers. That means that I am filtering by the choosen manufacturer and also by a global (all) manufacturer. To become a good result I get this informations in a customMgr as two seperate lists and convert them into the CategoryIf array, which I apply to the kkAppEng.

Has anyone a solution for that? It must be possible to see how much products after filtering are in a category...

Thanks!

julie

I'm not sure I understand. Is it that you want to only show categories within the category tree that contain products from multiple manufacturers that you define and for each category you want to display the number of products in that category that belong to the list of manufacturers?

Ragin

Hmmm....yes. The multiple manufacturers are defined by me and the user. The customer can choose the manufacturer he wants. And I extend this list with the "all" manufacturer.
And as result after selecting one I want to show only categories that are not empty after filtering. If I show the number of products in this category or not doesnt matter. Important for me is that the user can klick on every displayed (sub-)category and there is everytime a product and not an empty site or a message like "Sorry, nothing here...".

julie

As far as I can tell the getCategoriesPerManufacturer() API call only returns categories that have at least one product in them.

I suppose what you could do with is an API call that does getCategoriesPerManufacturers() where an array of manufacturer ids can be passed in. Maybe you should contact sales at konakart dot com who could give you a fixed price quote for the implementation of the API call. Alternatively you make the call twice (one time for each manufacturer) and merge the returned lists.

Ragin

Thanks. How longer I think about, I think this possibility is usable. I do the same thing for multiple products but I hoped that there will be a better alternative than raping the api for such simple things.

Ragin

After trying this I can't see any changes in the frontend.

I get the categories by manufacturer and set them with ProductMgr:

Category[] catArr = CategoryHelper.filterCategoriesByAllManufacturer(kkAppEng, manuId, Constants.COMMON_MANUFACTURER);
kkAppEng.getProductMgr().setCurrentCategories(catArr);


The CategoryHelper returns a combined CategoryIf Array with the all categories filtered by manufacturer (manuId) and the "all" manufacturer. After getting this array I set it into the engine. Same doing with products where it works wonderful. I'm setting the categories in the SelectCategoryAction1.java class.

What can be the problem with that? I'm lost in this problem...  :-\