We have been blessed to grow and now have multiple stores/locations throughout Florida and Georgia. We want to offer users the closest location to the zip code they enter - preferably defined by a radius. When the user chooses the location, we will submit their info to their preferred store/location. I assume this is a common use case and there likely is an add-on for that.
I hope the more experienced GF users and mods might be able to direct me to an add-on or two. I cannot find anything that explicitly states it solves for our use case. Thank you in advance
I am the author of the other thread referred to in the answer above and am looking for the same functionality as you! I’m following this thread as well and hoping that one of us gets an answer.
It sounds like you just want to redirect the email notifications to the appropriate store. Correct? If so then
Option 1: Tedious non-coding method would be to have a lot of conditional rules for routing a notification.
Option 2: Custom program a function for routing and sending the notification using the gform_post_submission hook. And in the hook using a mapping API produce the closest location and route accordingly.
Option 3: let one person get them and quarterback it manually.
An expert may chime in and recommend a better hook, but basically, you need to hook into a function, perform the mapping query and results, and tell GF who to send the notification to.
Sounds like a good project if you can get good value from it. It all depends on the volume of form submissions you are managing.
Thank you pringletech,
I chose to use MANY conditional rules. Not ideal, but it does work out the box. I still have a lot to learn about coding. Making the manual method the best for right now.
I then created a table in excel. With all my stores as the headers and zip codes within 25 miles of them. Then I created arrays of site combinations. Example = store 1,2,3,4,5 - 1,2,3,4 - 1,3,5 - 1 - 1,2, - etc… This is important to not forget any combinination to see if the group shares a zip code.
Using filters in Excel I was able to identify what zip codes the arrays shared. I did so by filtering out blanks for sites within the chosen array (i.e. 1,2,3,4)
I then created form fields with conditional logic to display if any rules matched. Each array got its own form field. I chose SHOW if ANY rules matched. The rules were ‘zip code’ IS XXXXX. XXXXX being the zip code. This was about an hours worth of data entry work. Creating 100s of conditional rules for the user’s browser to calculate per the Gravity docs - my computer it runs quick.
I also had to create a form field that had EVERY zip code used in the other form fields. This way if the user typed a zip code outside our service area, they would get a message.
This took me all day today and wasn’t ideal, but it did get the job done for now. Right now we just have 6 locations but on track to add 80+ this year. This manual process isn’t scalable and will likely be seeking a developer to build this function out - stay tuned.