Function and Script Which Handles Input from Form Submit

This topic contains 16 replies, has 3 voices, and was last updated by  Alex Rollin 7 years ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket

Tagged: 

  • Author
    Posts
  • #397234

    Nithi Maniam
    Free User
    Post count: 25

    Hi,

    Could you please let me know which script in the plugin directory and which function(s) handle the input from the search form on the front page? I am trying to study the logic to see if I can add additional search filters on the front page.

    My url is http://www.lateopens.com

    Thanks

    #397246

    Kiran
    Moderator
    Post count: 7069

    Hi Nithi,

    If you are talking about the WordPress standard search function(s) then you have to go through WordPress developer documentation https://developer.wordpress.com/docs/.

    If you are talking about GeoDirectory front end search then the function that handling search actions is: https://github.com/GeoDirectory/geodirectory/blob/master/geodirectory_template_tags.php#L581

    Kiran

    #397321

    Nithi Maniam
    Free User
    Post count: 25

    Thanks Kiran,

    I am talking about the GeoDirectory front end search. The function you have pointed to https://github.com/GeoDirectory/geodirectory/blob/master/geodirectory_template_tags.php#L581 submits the form upon clicking of the .geodir_submit_search.

    If I do an inspect elements of the form, it seems to be submitting to the same page, i.e. https://lateopens.com.

    What I am looking for is the PHP script(s) which handle the form input and provide output on the results page, i.e. the script which receives the form inputs and makes the mysql search based on the filters provided in the form input.

    Thanks!

    Nithi

    #397334

    Kiran
    Moderator
    Post count: 7069
    #398366

    Nithi Maniam
    Free User
    Post count: 25

    Hi Kiran,

    Thanks for your response.

    Can I ask, which script and function is getting results from mysql based on $where filter returned by function searching_filter_where in script listing_filters.php?

    Thanks

    #398422

    Kiran
    Moderator
    Post count: 7069

    Hi Nithi,

    We just used hooks on front end archive pages to get results for GeoDirectory post types. The main scripts that handling sql queries are in WordPress core files.

    Can you tell me exactly what you want to achieve?

    Thanks,
    Kiran

    #398722

    Nithi Maniam
    Free User
    Post count: 25

    Hi Kiran,

    Thanks for your reply.

    Ok understood on the sql queries.

    What I am trying to achieve is to add an additional search input on the front page. The input will be a dropdown input which will allow the user to choose from all the available Place Categories e.g. Cafe, Restaurant, Bar etc.

    Right now, the “Search for” input is working like a wildcard filter, i.e. using the search term, the search function filters based on Place Categories and/or Keywords contained in the place name, description etc.

    With the additional ‘Category Search’ input, the output will be restricted to the Place Category specified.

    Could you guide me on adding an additional search input if this is possible?

    Thanks!

    #398724

    Kiran
    Moderator
    Post count: 7069

    You can setup categories search under GeoDirectory > Place Settings > Advance Search > Category.
    Here you can manage to search for categories with AND or OR condition within categories.
    See https://ppldb.com/k/ is it same like you want?

    Kiran

    #404979

    Nithi Maniam
    Free User
    Post count: 25

    Hi Kiran,

    The category search you showed on your demo page is what I am looking for essentially.

    I am at GeoDirectory > Place Settings > Advance Search but I am unable to see any setup for categories search. Can you please guide me on this?

    Please see attached picture.

    #404981

    Nithi Maniam
    Free User
    Post count: 25

    Also,

    Is it possible to remove the search inputs from the listing page? (Pic 2)

    Thanks,

    #405003

    Alex Rollin
    Moderator
    Post count: 27815

    Hello!

    Yes, there is one step to take before, to set it up. Go to:

    GD > Places settings > Double click on Field Category > Scroll down to Advanced sort & filters options > enable Include this field in filter

    Then return to GeoDirectory > Place Settings > Advance Search > Category and drag Category into Advanced Search.

    Let us know

    #405024

    Nithi Maniam
    Free User
    Post count: 25

    Thanks Alex!

    Also is there a way to remove the search inputs from the listing page? (Pic 2) as per my reply #404981?

    Thanks,

    Nithi

    #405029

    Alex Rollin
    Moderator
    Post count: 27815

    Hello!

    Search on listing pages is part of the template and would be a customization.

    You can try to make some cosmetic changes to it with CSS first:

    https://wpgeodirectory.com/docs/customizing-your-style/

    #405061

    Nithi Maniam
    Free User
    Post count: 25

    Thanks Alex,

    Could you point me to the right script file which contains the html container elements for the search inputs? I am trying to add some elements / text within the same container.

    #405066

    Alex Rollin
    Moderator
    Post count: 27815

    Hello!

    We provide this page with template modification instructions.

    https://wpgeodirectory.com/docs/customizing-geodirectory-templates/

    For search you can start in geodir-search.php but we do not recommend changing core files.

    If there is already text in the area where you want to make a change you can do that through translation, and even include some html.

    You can find complete instructions here: https://wpgeodirectory.com/docs/translate-core/
    Each add-on has translation files, too: https://wpgeodirectory.com/docs/translating-addons/

    Once you change one ‘string’ and see it working, you will probably want to change many more to make your site stand out and ‘speak’ to your customers.

    Let us know how it goes!

    Additional Links:
    https://wpgeodirectory.com/docs/getting-translation-files/
    https://wpgeodirectory.com/docs/category/translation/“””

Viewing 15 posts - 1 through 15 (of 17 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount