The Paid Memberships Pro Membership Maps Add On will, by default, determine a member’s map placement using the Billing Address Fields captured at checkout. But what if you want to geocode a different custom address instead? In this tooltip article, we share a little on what geocode is and offer a code recipe on geocoding a different member address during checkout.
What is Geocode?
A geocode provides geographical coordinates corresponding to a specific location. The process to turn this geocode into a latitude/longitude location is called Geocoding.
Geocoding is the process of taking input text, such as an address or the name of a place, and returning a latitude/longitude location on the Earth’s surface for that place
Read more on Geocoding here
It can be challenging to keep track of different physical locations of your members on your website. But having access to the geocode of that location can make this process more manageable.
Geocoding can be a powerful tool that has proven to be beneficial in many ways for various type of businesses. The benefits can include recognizing geographic patterns, managing customer data or analyzing address data. You can read more on Geocoding and benefits here.
The Code Recipe
Note that the $member_address
array structure needs to remain intact. Fields can be left empty, but the more comprehensive the address, the easier it will be for the Geocoding API to return an accurate result.
Adding the Recipe to Your Website
You can add this recipe to your site by creating a custom plugin or using the Code Snippets plugin available for free in the WordPress repository. Read this companion article for step-by-step directions on either method.
Free Course: Membership Site Development—The Basics
Develop a deeper understanding of membership site development in this beginner-level course. Learn how to make your site work better, save yourself time and money, and improve your site's performance.