Jeff VIP
Total posts: 745
01 Sep 2015 05:18

Hi,

I have discovered two issues when using the geo filter in the filter module.

  1. The value in the autopopulate field is often empty/forgotten after performing a search. This is quite annoying when you change the distance multiple times for the same location.
  2. After performing a location search, the field collapses in the module, whereas all other field remain open after a search.

Replace input box for distance with dropdown

Not really an issue but something I haven't able to solve yet.

I am trying to replace the distance input box with a dropdown select box with a fixed set of distances.

<select name="filters[<?php echo $this->key;?>][radius]"  id="filters<?php echo $this->key;?>radius" onchange="setCircleRadius<?php echo $this->id  ?>()"  >
    <option value="">Distance</option>
    <option value="5">+ 5 km</option>
    <option value="10">+ 10 km</option>
    <option value="20">+ 20 km</option>
    <option value="50">+ 50 km</option>
    <option value="100">+ 100 km</option>
</select>

It won't however remember the last selected option. Suggestions, anyone?

Last Modified: 11 Sep 2015


Sergey
Total posts: 13,748
04 Sep 2015 12:30
<select name="filters[<?php echo $this->key;?>][radius]"  id="filters<?php echo $this->key;?>radius" onchange="setCircleRadius<?php echo $this->id  ?>()"  >
    <option value="" <?php echo $radius == 0 ? 'selected' : NULL;?>>Distance</option>
    <option value="5" <?php echo $radius == 5 ? 'selected' : NULL;?>>+ 5 km</option>
    <option value="10" <?php echo $radius == 10 ? 'selected' : NULL;?>>+ 10 km</option>
    <option value="20" <?php echo $radius == 20 ? 'selected' : NULL;?>>+ 20 km</option>
    <option value="50" <?php echo $radius == 50 ? 'selected' : NULL;?>>+ 50 km</option>
    <option value="100" <?php echo $radius == 100 ? 'selected' : NULL;?>>+ 100 km</option>
</select>

Jeff The value in the autopopulate field is often empty/forgotten after performing a search. This is quite annoying when you change the distance multiple times for the same location.

What autopopulate field?

Jeff After performing a location search, the field collapses in the module, whereas all other field remain open after a search.

Does it collapse all fields where filter is applied?


Jeff VIP
Total posts: 745
04 Sep 2015 13:44

Ah thanks, Sergey.

I will try that!

Sergey What autopopulate field?

I mean autosuggest field.

The field where Google suggests locations when you start typing.

Sergey Does it collapse all fields where filter is applied?

No only the geo fields...all other fields stay open.


Sergey
Total posts: 13,748
06 Sep 2015 05:11

So you mean that google autosuggest field is empty after reboot? But it is not used for filters only to place location on the map. So we do not need it after we set the marker.

Jeff No only the geo fields...all other fields stay open.

Give me the link I'll check. Sounds weird.


Jeff VIP
Total posts: 745
10 Sep 2015 09:12

Sergey So you mean that google autosuggest field is empty after reboot? But it is not used for filters only to place location on the map. So we do not need it after we set the marker.

Never mind. I added something in the Javascript and now it remembers the last location even after a page refresh.

However there is another issue that needs to be solved:

If you change the radius/distance two times of one location, the location resets to the default location, hence producing wrong results.


Sergey
Total posts: 13,748
10 Sep 2015 10:53

You mean marker checnges the position? Please describe more how to reproduce. You tipe distance twice? Apply between each time or not?


Jeff VIP
Total posts: 745
11 Sep 2015 00:59

Sergey You mean marker checnges the position? Please describe more how to reproduce. You tipe distance twice? Apply between each time or not?>

  1. Enter a location in the autosuggest field + Apply
  2. Set a distance + Apply
  3. Set a new distance + Apply
Powered by Cobalt