Lets Improve filters!

  • Posts: 1119
  • Thank you received: 114
5 years 4 months ago #308961

Hi,

I would like to suggest few improvements for filters.

1. It would great if we could have "FILTER", "RESET" buttons per each filter and not one for all. This would allow to apply changes only for that particular filter. As example we could reset "color" filter but keep changes on filter "size". Now you can delete only everything....

Right now we have "deletable filter" setings but it just allows you to select one filter and other not selected are hidden after refresh, which i don't think is very useful. Usually people want to select few filters based on they needs....


2. Using Filter type list. Now if one of this filter values are selected there is no indication for that value that it is selected. Would be great to have some class here like "filter_selected" or something. So we could make some css styling for it. Small change but very useful!
Also it would be great if you could select more filters not only one...while using filter type list.




Thanks

Attachments:
Last edit: 5 years 4 months ago by kyratn.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
5 years 4 months ago #308963

Hi,

1. I don't think adding a reset / filter button for all the filters make sense. You already have the submit on click for that. I guess it only makes sense when you want to allow the user to select several things in the filter and this only apply to checkbox and multiple select filters. So adding this for them could be interesting.

2. That's a good idea yes.

We'll note that down on our end. Thanks !

The following user(s) said Thank You: kyratn

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

  • Posts: 1119
  • Thank you received: 114
5 years 3 months ago #309078

Hi,

Regarding price filter using nouislider.

When you try to adjust price, the refresh of filter starts instantly after stop of adjusting slider. It's a bit annoying if using mouse for dragging ( same for mobile ), as soon as you stop it refresh filters. Sometimes You can't adjust it with just one drag... Wouldn't be better to use touchend mouseup events here? Or maybe a little delay would be good here too...


Thanks

The following user(s) said Thank You: n00bster

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
5 years 3 months ago #309118

Hi,

Indeed, I was able to reproduce the issue and added a patch on our end for that.
Update and it should work better.

The following user(s) said Thank You: n00bster

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

  • Posts: 1119
  • Thank you received: 114
5 years 1 month ago #311197

Hi,

Is there a way to detect if filter is active per each filter? The idea is to add some css class if that filter is in use.

Here is what i am looking for:

<?php echo '<div class="active hikashop_filter_'.$filters[$count]->filter_namekey.'">'.$html[$count].'</div>'; ?>


There is a "$filterActivated" variable inside filter.php but that does check if any of the filters are in use.

Any help would be appreciated.

Maybe it would be good to have it by default for additional styling?

Thank you

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
5 years 1 month ago #311217

Hi,

Instead of the line:

$selected[] = $this->filterTypeClass->display($filter, '', $this);
You could have the code:
$data = $this->filterTypeClass->display($filter, '', $this);
		$selected[] = $data;
		if(!empty($data) && !in_array($data, array(' ', 'none'))) {
			$filter->filterActive = true;
			$filterActivated = true;
		}
That way, in
$filters[$count]->filterActive
you would know if the filter has been selected or not.
We'll add a modification for that for the next release.

The following user(s) said Thank You: kyratn

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

  • Posts: 1119
  • Thank you received: 114
5 years 1 month ago #311221

Hi,

Thank you Nicolas. That worked!

Have a great day

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

  • Posts: 1119
  • Thank you received: 114
5 years 1 month ago #311223

I was a bit hurry as usual, my bad....

The code changes you provided gives a bit issues. Here is what happening.

As example i have 2 filters, "SIZE" and "COLOR"

1. I filter by "size", the "$filters[$count]->filterActive" returns 1 to this filter. Seems OK
2. Then i filter by "color", the "$filters[$count]->filterActive" returns 1 to this filter too. Seems all ok.
3. I remove filtering by "size", the "$filters[$count]->filterActive" still return 1 to this filter....
4.I remove filtering by "color", the "$filters[$count]->filterActive" is empty on this filter and on "size" filter too.

Is there a way to fix it?

Thank you

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

  • Posts: 1119
  • Thank you received: 114
5 years 1 month ago #311224

Also, after using sort filter, "$filters[$count]->filterActive" will return 1 to all filters. :(

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

  • Posts: 1119
  • Thank you received: 114
5 years 1 month ago #311227

Please ignore. All working fine! It was my mistake with using the code not properly...

However i still need one more help.

I am trying to return values of the characteristics selected per each filter.

Now this return the ID's:

<?php echo var_dump($selected[$count]);?>

How do i get the values/names of characteristics?


Thank you

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
5 years 1 month ago #311236

Hi,

You would have to run a MySQL query on the hikashop_characteristic table to get the values/names.

The following user(s) said Thank You: kyratn

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

Time to create page: 0.080 seconds
Powered by Kunena Forum