Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Kyle Phillips

    (@kylephillips)

    Additional search fields are not currently possible.

    Thread Starter xw7

    (@xw7)

    Thanks for your response Kyle, which file(s) control the search fields as we have managed to add more select boxes but the values are not pulling through at the moment and is pinging back as null.

    Any help would be appreciated.

    Plugin Author Kyle Phillips

    (@kylephillips)

    Not sure I understand the question fully.

    If you’re adding additional select fields to the search form manually, the data will be lost in the form processing…?the search query itself would need to be manually updated to include that criteria. That would become pretty complex.

    Thread Starter xw7

    (@xw7)

    We are able to update the search Query and PHP just need to know which files control the search. We have managed to update the SQL to include more fields from database but only if input manually into SQL Query. When we try and pull in the value from the form it doesn’t pull our extra values in, only the values from your initial fields which made us think there is another file controlling what is pulled through the form. Hope this makes sense.

    Plugin Author Kyle Phillips

    (@kylephillips)

    There are separate views for AJAX and non-ajax forms, both in the “views” directory. It sounds like you’re using the non-ajax version.

    Search functionality is contained within the app/Services/LocationSearch directory/namespace. There is a form listener class in the Listeners directory/namespace called LocationSearch that handles some of the form data.

    I’m sure you’re aware, any updates to the plugin will override these changes you’re making.

    Thread Starter xw7

    (@xw7)

    Kyle, we made the usual changes but assume we are going wrong somwhere as it isnt working. We changed the following files and added into the sections stated – are we missing anything obvious?

    Field is called property_bedrooms in the database and the file being pulled in is pyb but it doesn’t seem to pull the value through.

    If we set the code below to the following manually it works property_bedrooms >= ‘3’

    I have a feeling some of the edits below may not be required but trying everything to get it to work.

    Any help would be appreciated.

    LocationSearch.php
    
    - Sanitize and set the user-submitted data
    'pyb' => sanitize_text_field($_POST['pyb']),
    
    - added this to SET QUERY DATA
    $this->query_data['pyb'] = $this->data['pyb'];
    
    - Added this to set the query
    AND property_bedrooms >= 'pyb'
    simple-locator-form.php / FORM
    
    <select name="pyb">
    <option value="1">1</option>
    <option value="6">6</option>
    <option value="9">9</option>
    </select>
    Thread Starter xw7

    (@xw7)

    Managed to fix it! Simple mistake to make, got it working now and it’s pulling it all in.

    @xw7 What changes did you made it to work?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Add More Search Fields’ is closed to new replies.