Forums › Forums › Search & Filter Pro › Postcode / Contacts Search
- This topic has 6 replies, 2 voices, and was last updated 4 years, 1 month ago by
Anonymous.
-
Anonymous(Private) January 6, 2021 at 2:24 pm #271779
Hi there,
I’m trying to set up a contact person search on our website.
Our website visitors are asked to enter a postcode and the appropriate contact person is displayed.
Example:
Postcode area 01234 – 13000: Contact 1
Postcode area 13001 – 14000: Contact 2
and so onMy previous approach has been to create an archive with contact persons and to assign the individual persons to a zip code area with the help of ACF.
Unfortunately, in Search & Filter pro, I can’t find a way to generate a single search field that queries the ACF fields.
The only thing that comes close is the “Range Number” function. However, this function always generates from / to fields but I only need one input field because the search is only for an exact number sequence.Is there a way to do that with Search and Filter Pro?
Trevor(Private) January 6, 2021 at 2:46 pm #271780What is in the database for the postcodes, stored in each ‘contact’ post? Is it a list of postcodes each contact serves (a list of multiple values), or is it two fields with a range (as you say, ‘From’ 01234 and ‘To’ 13000 (note, a number cannot start with a preceding 0)?
Trevor(Private) January 6, 2021 at 3:43 pm #271788That’s fine. So, it would need to be set up similar to the code in this post:
The idea is to use a number range control, but modify manually the ranges it actually searches for, and modify the labels the users sees in the form. The concept is much the same though.
That code took me a long time to write and test (with help from our developer), and I only did it because it was a recurring request (for a year filter), so it seemed a worthwhile thing to attempt.
-
AuthorPosts