November 18, 2014 at 7:57 pm #34630
Hello – I am having trouble figuring out the best way to setup the search by radius feature. I think I would ideally like the user to enter only their zip code in the Enter Address portion of the search, but will this work? How to I obtain their zip code upon registration? What type of profile field (text, etc.)? I’m using Gravity Forms User Registration Add-on, but I can map the field to any of the wp/buddypress profile fields.November 19, 2014 at 1:06 am #34638
First of all there is no way ( out of the box ) to limit the address entered in the address field to only zipcode. The input field can basically accept any form of address. The plugin does not look and compare the address entered to the address saved in the member’s profile field. Rather it does a proximity search to find nearby members.
When one enters an address in the address field of the search form and submit it the plugin geocode the address and compare the coordinates agains all the coordinates in the members table in database and pulls the members which found within the radius entered. So in order for the search query to work your members need to have not only address, or zipcode in their profile but also coordinates saved in GEO my WP’s table in database.
Out of the box GEO my WP adds “Location” tab to the member’s profile page and when a member enters his address the plugin geocodes it and saves the information ( address components and coordinates) in database.
The way I see it there are few options for listed below:
1) If you know your way around code ( PHP, Jquery..) you could use the hooks provided by Gravity Forms plugin in order to add a script that will take the address after form submission, geocode it and save it to GEO my WP’s members table in database.
2) Use Xprofile Fields add-on. Using this add-on you can map any of your xprofile fields to GEO my WP address fields. Which means that when a member adds his location during BuddyPress registration ( not Gravity Forms ) or updates it using the member “Edit” profile page the address will be geocoded and saved in GEO my WP table in database which will make the member searchable by GEO my WP.
3) Use Gravity Forms Geo Fields add-on. The add-on work with Gravity Forms as well with Gravity Forms User Registration Add-on. You will be able to map the address field of your registration forms to GEO my WP address fields. Which again, will geocode the address entered in the Gravity Form on form submission and will save the location components in GEO my WP’s members table in database.
I hope the information answers your question. Please let me know if you have a any more questions.
Thannk youNovember 19, 2014 at 2:25 am #34637
Hi Eyal – Thanks so much for your detailed and quick response. I believe option #3 will work best for me so that I can use gravity forms and obtain the location information upon registration. Once this is implemented, how will the search work? Would I be able to do a radius search by zip code?November 30, 2014 at 3:13 am #34636
Hi Eyal – Just bumping this. With Gravity Forms Geo Fields Add-On would I be able to simply enter a zipcode and do a radius search based on this in the horizontal search form in SweetDate? Thank you.November 30, 2014 at 8:13 am #34635
Yes. With Gravity Forms GEO Fields members address entered during registration ( Gravity Forms User Registration Add-on registration form ) will be geocoded and saved in GEO my WP table in database. And once members have location in GEO my WP table they will show up in the proximity search results of sweet-date theme and in the search forms created by GEO my WP.
Note that existing users will need to update their location after the plugin installed in order to be searchable.
Please let me know if you have any more questions.December 1, 2014 at 5:00 am #34634This reply has been marked as private.December 1, 2014 at 7:13 am #34633
You didn’t setup the form correctly and that is why it didn’t work for you. Party it is my fault as the documentation of the plugin is missing.
I set it up for you and it seems to be working now.
Gravity Forms GEO Fields plugin currently doesn’t work with the “Address” advanced field. So as you can see I added individuals address fields to the form ( I left the original address field but I think you can remove it ) and mapped each of them to GEO my WP fields.
I also create a new update form just to test but you can delete it.
I registered a new user and the address was saved and the user shows up in search results.
Please give it a try and let me know if you have any questions/issues.
Thank youDecember 1, 2014 at 3:43 pm #34632
It’s working great, thanks! At least with new users, I can’t get it to work with updating existing users location, but it’s ok they are all test users. I can delete them and create new profiles.December 1, 2014 at 10:02 pm #34631
You are welcome.
After registration users can update their location using the “location” tab that in their profile page.
Otherwise you should be able to use the update form that User Registration add-on offers.
You must be logged in to reply to this topic.