Gravity Form Locations Add-on for SLP

Gravity Forms Locations is an add-on pack for Store Locator Plus and Gravity Forms that allows you to setup a Gravity Form generated form and have it add locations to Store Locator Plus.

You will need the Store Locator Plus base plugin, the Gravity Forms Locations add on, the Gravity Forms Integration add on, and a licensed copy of Gravity Forms installed.

Required Plugins
Required Plugins

Create A Gravity Form

First you start by creating a Gravity Forms Form using menu “New Form”, call it e.g. “SLP Basic Form”.

gfi-new-form-menu-2016-12-02_20-35-07 gfi-new-form-2016-12-02_20-36-47
On this form, you can create a number of fields with different parameters. Try creating a form with a Advanced Fields “Name” and “Address” and a Standard Field “Single Line Field”.

Adding a field to a Gravity Form.
Adding a field to a Gravity Form.

In the form edit screen, you can change the ‘name’ of the fields, e.g. “Store Name” and “Zip” respectively.

Editing a Gravity Form field attributes.
Editing a Gravity Form field attributes.

Map Form Fields To Locator Fields

Next, you create a new mapping, using the menu GFL Mappings.

gfi-gfl-field-mapping

It is a custom post type, so you can name it anything you like, e.g. “Basic SLP Mapping”.

Starting a GF to SLP Mapping entry.
Starting a GF to SLP Mapping entry.

On the edit screen, you have a section “Configuration” with some drop down fields. The first drop down list should show a list of all GF forms defined earlier, so it should contain “SLP Basic Form”. The Condition can be left for later.

Mapping GF Fields to SLP Data Fields
Mapping GF Fields to SLP Data Fields

The remainder of the drop down fields should reflect the SLP database fields. The number depends on the other add-ons you have installed. It should show at least the basic SLP fields like “Name”, “Address”, “City”, etc.

If you have the Power Add-on with Contact Extender enabled you should also see fields like “Department”, “Facility”, etc.

Each SLP field has a drop down list showing all the fields defined in the GF form. The list is populated by Ajax and thus will change when you select another form in the first “Gravity Form” field.

If you select “SLP Basic Form”, you should see the fields “Store Name” and “Zip” based on our example.   If you added more fields to your form you should see an entry for each item you added to your Gravity Form earlier.

By selecting the field, you create a mapping. You could e.g. select the “Hours” GF field to be assigned to the “Tags” SLP field. Each mapping is a relation between two fields from the different data sets.  It can be a one-to-many or one-to-one relation; in other words you can assign the any GF field such as “Hours” to many SLP fields.

This should complete the back-end configuration.

Gravity Forms Locator Handling

Go the Gravity Forms tab in Store Locator Plus and update the settings to change how new locations are handled.

gfi-slp-mapping-special-rules-2016-12-02_20-44-04 gfi-slp-mapping-rules-2016-12-02_20-45-20

Publish Your Form

Now for the front-end.

First create a post (or page) for the GF form using a GF shortcode. Editing the post shows you a button “Add Form” which can help adding the form.

Creating a page with the Gravity Form on it.
Creating a page with the Gravity Form on it.

Use this post to generate some entries. For a decent test, you should use some nice address values. When a form is submitted, the data entered is used to also generate an SLP entry according to the mapping defined for that form.

The Gravity Form
The Gravity Form

When people fill out the form their locations will automatically be added to the map.