I am building a site that has pages that have a contact pod that has 11 different dropdowns in wp-admin via Advanced Custom Fields.
Based on the user's IP, I want to display one of those 10 contacts (the 11th one is a default if location isn't given or it doesn't match one of the client's "regions").
The 10 regions are all based on parts of the United States, but don't match to states all the time (for example California is split into two regions, while another region may include Virginia, South Carolina and North Carolina). Anyone outside of these regions would get a default/international contact/message.
I'm having a hard time wrapping my head around how to do this. I've got the Advanced Custom Fields in wp-admin setup and am comfortable with outputting items from that plugin, but I am struggling with:
- What to use as a database to check IPs against. Is there anything off the shelf to do this?
- How to create my "buckets" of IPs for each region.
- How to setup the logic to choose which region contact/text to output.