Forums Forums Search & Filter Pro Postcode / Contacts Search

Viewing 7 posts - 1 through 7 (of 7 total)
  • Anonymous
    #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 on

    My 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
    #271780

    What 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)?

    Anonymous
    #271782

    Currently I set up two fields with a range
    One with the lowest Postcode and one with the highest Postcode

    Problem with the “0” is that the desired postcodes in germany actually start with “0”

    Trevor
    #271788

    That’s fine. So, it would need to be set up similar to the code in this post:

    https://support.searchandfilter.com/forums/topic/filter-by-year-and-separate-sort-control-2/#post-271160

    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.

    Anonymous
    #271832
    This reply has been marked as private.
    Trevor
    #271839

    Do let me know how you get on with this?

    Anonymous
    #271841
    This reply has been marked as private.
Viewing 7 posts - 1 through 7 (of 7 total)