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 TicketTagged: search
-
AuthorPosts
-
September 25, 2017 at 12:44 pm #397234
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
September 25, 2017 at 1:56 pm #397246Hi 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
September 26, 2017 at 3:24 am #397321Thanks 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
September 26, 2017 at 5:13 am #397334Hi Nithi,
Here is hook to handle search function: https://github.com/GeoDirectory/geodirectory/blob/master/geodirectory-functions/listing_filters.php#L608
Here is search function that adding clause to filter: https://github.com/GeoDirectory/geodirectory/blob/master/geodirectory-functions/listing_filters.php#L743Kiran
October 1, 2017 at 5:55 am #398366Hi 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
October 2, 2017 at 6:34 am #398422Hi 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,
KiranOctober 4, 2017 at 5:52 am #398722Hi 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!
October 4, 2017 at 6:18 am #398724You 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
November 12, 2017 at 1:51 pm #404979Hi 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.
November 12, 2017 at 2:26 pm #404981Also,
Is it possible to remove the search inputs from the listing page? (Pic 2)
Thanks,
November 12, 2017 at 11:05 pm #405003Hello!
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
November 13, 2017 at 5:46 am #405024Thanks Alex!
Also is there a way to remove the search inputs from the listing page? (Pic 2) as per my reply #404981?
Thanks,
Nithi
November 13, 2017 at 6:15 am #405029Hello!
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:
November 13, 2017 at 11:23 am #405061Thanks 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.
November 13, 2017 at 11:46 am #405066Hello!
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/“”” -
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket