I used the location filters to filter out the display of some states/province (to test) and I filtered some cities and it worked. But then I wanted to reset them to the original state but it was imposable. After inspecting the code I noticed that the filter actually deletes the zipcode tables meaning if you make a mistake you have to reload the zipcodes and if you want to expand your locations you have to add them manually. I share my zipcodes table with location city autocomplete where I want my users to select a city name from the whole country to ensure no spelling mistakes, but I want to limit the location search display to only a few cities as the website progress.
Wouldn't it be better to store the filtered zipcodes in a variable, then let the display only read the zipcode data that match the zipcodes in the variable. Or will this make things slower?

I must currently be your biggest fan or bug.
Thanks

Comments

NewZeal’s picture

Thanks for the issue and the interest in the project and yeah, we do want to make this module usable so variable use cases have to be considered. You are correct, the filter removes items from the table. The search does an autocomplete on the table so your request would require extra filters on the mysql query which would slow things down considerably or as you suggest, we put the search items into a variable. The only problem with the latter is that on a US site there are 30,000 entries in the zipcodes table so that is not very practical. The best solution would be for the filter to copy required cities to a new table which is for use for the listing_location module only. That would leave the location zipcodes table with full integrity to use for other location functions.

NewZeal’s picture

Status: Active » Closed (works as designed)