🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!

Gravity Forms Store Locations Premium Add-on Setup Guide

Updated 8 min read Gravity Forms Fields & Inputs
On this page
  1. Video walkthrough
  2. What you need
  3. Install and activate
  4. Add a feed to a form
  5. What a visitor sees and what you see
  6. Coordinates, geocoding and what is checked
  7. Keeping the store and the entry in step
  8. Payments and delayed feeds
  9. Developers
  10. Privacy and security
  11. Troubleshooting
  12. Questions
  13. Does this need a paid WP Store Locator add-on?
  14. Can one submission create stores in two places?
  15. Do I need a geocoding key?
  16. Is this the same as the Nearest Location add-on?
  17. Can visitors edit or delete their store later?

Video walkthrough

Gravity Forms Store Locations: Turn Form Entries into WP Store Locator Stores (Free Plugin)
Video tutorial: Gravity Forms Store Locations Watch on YouTube

The Gravity Forms Store Locations Premium Add-on turns each Gravity Forms submission into a store location in WP Store Locator. A visitor, a franchisee or a dealer fills in a normal form. The add-on creates the store with its name, address, phone, email, website, categories and the coordinates that the map needs, so the new store can show up in your store locator search without anyone typing it in by hand.

The coordinates come from the form when it has them, or from a geocoder that you choose and pay for yourself: Google, Geoapify or Mapbox, with your own key. The add-on asks the geocoder only when the form has no valid coordinates, and a store that cannot be placed is saved as a draft, so it never appears on the map in the wrong place.

What you need

  • WordPress 6.5 or newer and PHP 7.4 or newer.
  • Gravity Forms 2.9 or newer. The add-on is tested with Gravity Forms 3.1.2 on PHP 8.3 and Gravity Forms 2.9.8 on PHP 7.4.
  • The free WP Store Locator plugin from WordPress.org. The add-on is tested with WP Store Locator 3.1.0. It saves the store in the same way as the plugin: a post of the type wpsl_stores with the wpsl_ fields (address, city, state, zip, country, latitude, longitude, phone, email, url) and the store categories.
  • An active license key for this add-on.
  • Only for addresses without coordinates: a key from Google (Geocoding API), Geoapify or Mapbox.

If Gravity Forms or WP Store Locator is missing, the add-on shows a notice, writes a note on the entry and does nothing else. The entry itself is always saved first, so no submission is lost.

Install and activate

  1. Install and activate WP Store Locator, then Gravity Forms, then this add-on.
  2. Open Forms → Settings → Store Locations and enter your license key.
  3. Only if you geocode addresses: paste the key of the service you will use on the same screen. The fields are password fields and the key is only used by your server. It is not shared with WP Store Locator.

Add a feed to a form

Open the form, go to Settings → Store Locations and click Add New. A feed is one rule: it says where each value of the store comes from. You can add more than one feed to a form, for example one for the head office and one for a branch, each with its own condition.

The Store Locations feed settings of a Gravity Forms form: store name, description, categories, the address field, geocoding, contact fields and publishing
The feed picks the fields, the geocoder and how new stores are published.
  • Store name: text with merge tags, for example the store name field. If it is empty, the street address is the title.
  • Description: the text of the store. It is plain text; line breaks are kept and tags are removed.
  • Categories: the names of WP Store Locator categories, separated by commas. A name that does not exist yet is created. Use a merge tag to let the visitor choose.
  • Address field: pick a Gravity Forms Address field and its six parts (street, line 2, city, state, zip and country) are filled in for you. Or leave it empty and pick single fields for the street, city, state, zip and country.
  • Latitude field and Longitude field: optional. If the form gives a valid pair, it is used as it is and nothing is geocoded. A comma as the decimal sign is read too, and one field with both numbers, such as 39.7392,-104.9903, can be picked as the latitude field.
  • When there are no coordinates: geocode the address with your Google, Geoapify or Mapbox key, or do not geocode.
  • If no coordinates are found: save the store as a draft without coordinates, or do not create a store at all and only leave a note on the entry.
  • Phone, email and website fields: saved in the matching WP Store Locator fields after they are cleaned. A bad email address or a website that is not http or https is dropped.
  • Show the store on the locator: either after you publish it in WP Store Locator (the default, and the safe choice for a public form) or at once. At once only works for a store that has coordinates.
  • Keep in step with the entry: update the store when the entry is edited, and move it to the trash when the entry is trashed, marked as spam or deleted.
  • Condition: the usual Gravity Forms feed condition.

What a visitor sees and what you see

The visitor sees the form and the confirmation of Gravity Forms and nothing else. The add-on has no script and no style on the page.

A Gravity Forms form with the fields store name, address, about the store, phone, email, website and category filled in, and a Submit button
The visitor fills in a normal Gravity Forms form.

On your side, the store is saved at once as a normal WP Store Locator store. With the default setting it is pending: open Store Locator → All Stores, check the details and publish it. A published store with coordinates is found by the search of the locator.

The WP Store Locator page with a map and a list of stores, including the store that a visitor sent with a Gravity Forms form
The new store is on the WP Store Locator map once it is published.

The entry gets a note with the store number and its state: published, waiting for review, or draft without coordinates. If something did not work, the note says why: no address to look up, the geocoder found no place, the key was refused, or the geocoder could not be reached. The key and the address are never written in the note.

Coordinates, geocoding and what is checked

  • A latitude must be between -90 and 90, a longitude between -180 and 180. Text, an empty value, an exponent such as 1e1 and the point 0,0 (which an empty form would give) are refused.
  • The geocoder request goes only to the fixed address of the service you chose (maps.googleapis.com, api.geoapify.com or api.mapbox.com), with no redirects and a ten second limit. The key is only a query value on the server and is never printed in a note or a log line.
  • The address sent to the geocoder is the street, city, state, zip and country of the store joined into one line, with a two letter country preference from the settings if you set one.
  • Mapbox results are requested as permanent, because the store keeps them, which is what the Mapbox terms ask for.
  • The add-on asks once per submission, and only when the form has no usable coordinates. It does not cache and does not keep a list of addresses.
  • A store without coordinates is never published by this add-on. WP Store Locator itself can find the coordinates later: its store list has an Invalid coordinates view and a Geocode bulk action.

Keeping the store and the entry in step

When you edit the entry in the Gravity Forms entry screen, the store is updated: name, description, address, contact details, categories and position. A field that you empty is cleared in the store too. The status that you chose in WP Store Locator is kept, so a store that you published stays published after an edit, unless the edit leaves it without coordinates, in which case it goes back to a draft. When you trash the entry, mark it as spam or delete it, the store is moved to the trash of WordPress, where you can bring it back.

If the same feed runs twice for one entry, a second store is not made. Only stores that this add-on made, remembered in the entry meta, are ever updated or trashed. Stores that you entered by hand are never touched.

Payments and delayed feeds

The feed supports the Gravity Forms delayed feed setting. Tick Create the store location only when payment is completed and a paid listing is created only after the payment.

Developers

  • The filter gfstoreloc_store_fields receives the store values (post, meta and categories), the feed, the entry and the form just before the store is saved. Return the array, changed. Return anything else to stop the store.
  • The store is a post of the type wpsl_stores with wpsl_ meta. The add-on writes address, address2, city, state, zip, country, country_iso, lat, lng, phone, email and url, and the taxonomy wpsl_store_category.
  • After a change the add-on asks WP Store Locator to drop its cached store list, when the plugin offers that.
  • The entry stores the store number in the entry meta gfstoreloc_store_ followed by the feed number.

Privacy and security

With coordinates from the form, nothing leaves your server. With a geocoder, the address that the visitor typed is sent to the service that you chose, with your key, and the service sees your server’s address, not the visitor’s. Say so in your privacy policy. New stores are pending by default, so nothing a stranger types goes live without your review.

Troubleshooting

  • No store and no note: check the license and that the form has an active feed with a condition that the entry meets.
  • The store is a draft: the form had no valid coordinates and the geocoder was off, found no place or was refused. Open the entry note, fix the address and edit the entry, or use the Geocode action in WP Store Locator.
  • The geocoder was refused: check the key, its quota and that the Geocoding API (Google) is switched on for it.
  • The store is saved but not on the map: it is pending or a draft, or WP Store Locator shows a cached list. Publish it and clear the cache of your page cache if you use one.

Questions

Does this need a paid WP Store Locator add-on?

No. It works with the free WP Store Locator plugin from WordPress.org. Opening hours, custom fields and images of the store are not set by this add-on.

Can one submission create stores in two places?

Yes. Add two feeds to the form with different conditions or fields. Each feed makes its own store.

Do I need a geocoding key?

Only if your form has an address and no coordinates. If two number fields give the position, you need no key.

Is this the same as the Nearest Location add-on?

No. Nearest Location takes a visitor request and finds the closest of your own branches. This add-on does the opposite: it takes a submitted place and adds it to your WP Store Locator list.

Can visitors edit or delete their store later?

No. The store follows the entry, and you manage the entry in Gravity Forms. If you edit the entry, the store follows.

Still need help?

Our support team answers tickets every day, usually within a few hours.

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr