Set up geocoding for Local Pickup Plus
Step 4 of the Set up Local Pickup Plus series.
You can setup geocoding to allow for the pickup locations list to be sorted automatically in relation to the customer’s current location (using geoIP), which makes it easier for them to choose the best location. This is not required to use the plugin, but may be valuable for stores with multiple pickup locations. Also, please note that this will affect the order of the pickup locations on your end too. If you'd like to test if this feature is working as expected, you can use a VPN service or ask another user to take a look.
Follow the steps below to setup geocoding:
- Go to the Google API Library.
- Select Select a Project > New Project.
- Enter your Project Name, Organization (if applicable), and Location.
- Select Create.
- Select your newly created project, then search for and select Geocoding API.
- Select Enable.
- Go to Credentials and select Create Credentials > API Key.
- Copy your newly created API Key and select Close. Do not select Restrict Key - this may cause Google to reject your geocoding requests from Local Pickup Plus. Your API Key will never be exposed to users on your site.
- Sign in to WordPress.
- Now, go to the Local Pickup Plus settings, enter the copied key in the Google Maps Geocoding API Key field, and select Save Changes.
Once geocoding is enabled, your locations will be automatically geocoded (sorted based on the customer's current location). If a location can’t be automatically geocoded, you can manually enter coordinates when editing the location.
- Find more information on how to configure Local Pickup Plus