Filter Items Count

  • Posts: 197
  • Thank you received: 13
2 years 1 month ago #345766

-- HikaShop version -- : 4.6.2
-- Joomla version -- : 4.2.3
-- PHP version -- : 8.1

I need to enter the number of results for each filter item in hikashop filter module when filter type is checkbox or radio
just like many filter modules have

is that possible in hikashop ?

I think it must be possible with some coding because JA Mega Filter component which works in HikaShop too has this feature.

If the coding is simple please tell me how can I do that and if it is complicated please tell how much does it cost for custom development

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 1 month ago #345772

Hi,

It's not impossible but really hard to do. That's why we never got around it.
The problem is that filters have to take into account many things. Add the count on each choice will require running a MySQL query for each choice of each filter. This will drastically slow down the processing on websites with lots of filters/products.

Also, we can't do that as an override. If we work on it for you, we have to develop it directly into HikaShop as it requires modifying the core files handling the filters in HikaShop. That also means we can't cut corners. So it would cost 600€

Please Log in or Create an account to join the conversation.

  • Posts: 197
  • Thank you received: 13
2 years 1 month ago #345782

in fact, the count number is not important for me

the problem is I need to hide the filter items which there is no results for them. and I do not want to use dynamic filtering feature as when we click on one item, other items will go away when using this feature.

I was thinking if I could count the result number, I can put an "if($count == 0)" function to add "hidden" class to that filter items which has no results

I dont know if I colud completly explain what is my exact need.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 1 month ago #345793

Hi,

I see what you mean. Still, to be able to do that, it requires counting the products for each choice.

Please Log in or Create an account to join the conversation.

  • Posts: 197
  • Thank you received: 13
2 years 1 month ago #345802

what is your suggestion Nicolas ?
this is the first time I came up with a problem and there is not any solutions from you
My project is in danger .. I have to hide that filter items

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 1 month ago #345803

Hi,

There are two solutions:
1. What I told you in www.hikashop.com/forum/install-update/90...ms-count.html#345772
We can develop that for you, but it's not cheap.

2. Instead of using HikaShop filters, you can use JA megafilter:
www.joomlart.com/joomla/extensions/ja-megafilter-for-joomla
It's compatible with HikaShop and can display the count of each choice of each filter. So you should be able to easily hide the empty choices.

The following user(s) said Thank You: khashiz

Please Log in or Create an account to join the conversation.

  • Posts: 197
  • Thank you received: 13
2 years 2 weeks ago #346292

I tried solution 2
bu it looks like JA mega filter doesnt work with either hikashop 4.6.2 or joomla 4.2.4 :(

Please Log in or Create an account to join the conversation.

Time to create page: 0.043 seconds
Powered by Kunena Forum