Forums › Feature Requests › searching posts based on the user's current location
- This topic has 2 replies, 2 voices, and was last updated 6 years, 1 month ago by
Eyal Fitoussi.
-
AuthorPosts
-
March 22, 2016 at 6:50 pm #51258
gsh2000
MemberEyal hi – regarding searching posts based on the user’s current location.
Please note, this is a follow up on my recent open post #51229, which was maybe posted in a wrong older thread. I have done further testing since:
Form Editor->Page Load Results->[User’s current location based results=yes]
Correct results are shown *only* if they are auto-loaded (i.e. Enable Page Load features=yes)
Otherwise, if an “empty” form is submitted, it appears that my current location is being ignored.
I Prefer not to have to force the user to enter an address prior to Submit, or auto-load results.
I can confirm that my current location is correct, since I have a [gmw_current_location] shortcode above my form.
This is the URL that results from submitting an “empty” form that has [User’s current location based results=yes]
locate/?gmw_address%5B0%5D&gmw_post=product&gmw_distance=25&gmw_units=imperial&gmw_form=1&gmw_per_page=8&gmw_lat&gmw_lng&gmw_px=pt&action=gmw_post
Also, I noticed that an “empty” form Submit will always grab the largest distance value from my form list.
How can I make the Starting address be the current location?
Thanks, GARRY, Los Angeles
GSH2000Private Content HiddenMarch 22, 2016 at 8:59 pm #51259Eyal Fitoussi
MemberHi Garry,
Thank you for the kind feedback on WordPress.org, it is greatly appreciated :).Correct results are shown *only* if they are auto-loaded (i.e. Enable Page Load features=yes)
Otherwise, if an “empty” form is submitted, it appears that my current location is being ignored.
That’s how the plugin meant works. To get results based on the user’s current location the visitor can use the “Locator” button ( of the search form ). Otherwise, submitting a blank address field will simply show all results.
You could use some filters, provided by GEO my WP, to create the behavior that you want but I do believe that you want to give the visitor the option to see all locations.
If you still want to create this behavior, I can tell you which filter you need to use. It does require however some PHP and WordPress filters knowledge.
March 31, 2016 at 2:34 pm #51457Eyal Fitoussi
MemberThis topic marked “Resolved” due to inactivity. If you wish to reply to this topic please change its status to “Not resolved” before replying.
-
AuthorPosts
You must be logged in to reply to this topic.