All our plugins are WooCommerce 3.1 & WordPress 4.8 & WPML compatible!

# WordPress Store Locator Documentation

If you find any bugs or enhancements in this script get in touch with a clear description of the problem so we can fix it. We do not support modifications!

## Requirements

The following things are required to run this script:

- PHP 5.2.0+
- MySQL 5+
- WordPress 3.8+
- Redux Framework Plugin
- Meta Box Plugin

## Index

1. Installation
2. Usage
3. Setup
4. Create a Store
5. Troubleshooting
6. Changelog

## INSTALLATION

1. Upload the ZIP via the wordpress backend
   1. Log into your website backend /wp-admin/
   2. Go to Plugins -> Install -> Upload Plugin
   3. Select the ZIP file and upload it
   4. Install Redux & Meta Box Plugins
   5. Active it and that’s it!
2. Upload it via FTP
   1. Log into your webserver via FTP
   2. Unzip the file on your PC
   3. Upload the extracted folder to /wp-content/plugins/
   4. Go into your backend and activate the Plugin
   5. Install Redux & Meta Box Plugins

## Usage

To place the store locator just create a new page and insert the following shortcode: [wordpress_store_locator]

For our plugin you will need a fully working Google API Key. A tutorial on how to get it, can be found here: https://connections-pro.com/documentation/create-google-maps-api-keys/
You need to make sure, that inside the Google Console the following options are activated:

- Allow your domain to access the key
- Enable: Google Places API Web Service
- Enable: Google Maps JavaScript
- Enable: Google Maps Geocoding

## Setup

### Settings Panel

You can find the everything inside your Admin Panel inside Store Locator -> Setting

### General Settings

In the General settings you have to enable the plugin first. Then you should enter your Google API Key for the frontend (get it here). Also you could set a server side key. This will be used only when importing stores without lat / lng to grab from Google directly.

Below this you can …

1. Export all stores
2. Import Stores
3. Get a sample custom import file (this uses your categories / filter)
4. Delete all stores

### Map Settings

First you can enable or even disable the map. Then you can set a width and select the distance unit (miles or kilometer). After this you can set some defaults: Latitude, Longitude, Map Type & Map Zoom Level.

For the radius you can set the Radius select steps splitted by comma and set a default radius. You can choose if you want to draw a radius circle and if you want to extend the map if no stores where found.

You should set some default icons for the stores (even if you have set an icon on category or single store level). The logic for icons is the following:

1. If a custom icon on single store is set -> take this
2. If a custom category icon is set:
   1. If a store is only in one category -> take this icon
   2. If a store has multiple icons, the icon only changes when a category has been choosen in frontend
3. If no store / category icon is set -> take the default Icon

At the bottom you can style the map as you like via some custom JS stylings. Examples can be taken from https://mapstyle.withgoogle.com/ or https://snazzymaps.com/

### Infowindow Settings

The infowindow (when you click on a store) can be enabled or disabled. While enabled you have the option to set a custom width for the infowindow itself. Then you can specify the column layout for the details, the image and the opening hours.

### Result List Settings

Enabling the result list will give you the opportunity to choose a position (left / right sidebar, above / below the map). You can choose the result list order, the width and if you want to show the title or not.

Furthermore you can set …

- a “No Results Text”
- Maximum Results
- Store Link Action
- Show Result List Icon
- Show Result List Premium Icon

### Search Box Settings

In the search box settings you can show the “Get my Position”-Link, show the Search Button, Search Title, Active Filter or Filters in total. Also you can set a default category filter and button text.

Furthermore you can:

- Enable Auto Geolocation
- Save Auto Geolocation in Cookie
- Enable Autocomplete
- Restrict Types
  You may restrict results from a Place Autocomplete request to be of a certain type. If for example you want to hide the street from autocomplete search, you have to select the “Regions”
- Restrict Autocomplete to a country (2 character ISO-Codes only! You can insert for example us to limit the autocomplete to only search in United States)
- Position
- Width (in Columns)

### Loading

When stores are being fetched, a loading icon will be displayed. With our plugin you can totally customize the icon. Choose a new icon, color, background color and more.

### Data to Show

In total you can customize 20 different data to show. In example you can specify if you want to show a store’s name, the description, website, image, opening hours …

### WooCommerce – Store Locator Button

When you have a WooCommerce Shop you can show the store locator button on single product pages. Within the store locator button settings you can choose where the button should show up and how the modal should look like.

### Default Store Values

Setting up default store values helps you to easily create stores, that always have the same data (like a website, country or opening hours). Just set a default value and everytime you manually create a store the defaults are filled out.

### Advanced Settings

Here you can add some custom CSS or custom JS. Also, if you have problems with the layout, you can disable Bootstrap here.

### Creating a store

Before creating a store you should setup your store categories & filters. The, when you want to create a store you have two options: Either you add it manually or you import a store.

#### Create a store manually

If you want to create a store manually, just go to Store Locator > New Store inside your Admin Panel. From there you can add all the necessary information for your store.

#### Importing Stores

If you have many stores you better use the import functionality. Therefore you go to Store Locator > Settings > General. On the bottom you will find an “Get Sample Import file”-Button. Press this button and you will get a sample Excel import file filled with all store information + categories + filters.

Use this sample import to fill out your import. If you have set a Server Side Google API Key, you can leave out the Latitute / Longitute values, because they will be fetched automatically.

Then you go back to General settings and press “Import Stores”-Button. Then select your file and click on import. You will see a report of the added stores afterwards.

## TROUBLESHOOTING

Where can I find the Store Locator settings?

You can find the everything inside your Admin Panel in Store Locator -> Settings

I always get a Google Maps error (GEOCODE)

Please make sure you have setup your API Key correctly in the Google Console:

Allow your domain to access the key
Enable: Google Places API Web Service
Enable: Google Maps JavaScript
Enable: Google Maps Geocoding

How can I remove the maps padding?

Just add the following code inside advanced settings > custom CSS:

    #store_modal .modal-body {
    padding: 0px;
    }

    .store_locator_sidebar_content {
    padding: 15px 0px 15px 15px;
    }

    @media(max-width: 768px) {
    .store_locator_sidebar_content {
    padding-right: 15px;
    }
    }

How can I increase the width of the Map?

Here for e.g. it uses a 80% width. Just add the following code inside advanced settings > custom CSS:

    #store_modal .modal-lg {
    width: 80%;
    }

    @media(max-width: 768px) {
    #store_modal .modal-lg {
    width: auto;
    }
    }

How do I output the store locator functionality to the front-end?

Please use this Shortcode: [wordpress_store_locator]

I found a bug / got an error

Please make a comment on CodeCanyon. We will take care asap!

## CHANGELOG

    # Changelog
    ======
    1.3.1
    ======
    - FIX: Added map Meta key to import
    - FIX: Added Opening hours to Sample Import file
    - FIX: Latitute wrongly assigned when importing XLSX without lat / lng

    ======
    1.3.0
    ======
    - NEW: Set a custom map icon for a single store
    - NEW: Logic for Icons:
    		1. If a custom icon on single store is set -> take this
    		2. If a custom category icon is set:
    		2.1. If a store is only in one category -> take this icon
    		2.2. If a store has multiple icons, the icon only changes when a category has been choosen in frontend
    		3. If no store / category icon is set -> take the default Icon
    - NEW: Improved editing layout in backend
    - FIX: Export files are corrupt

    ======
    1.2.9
    ======
    - NEW: Add a custom Icon for store categories
    - NEW: Added store categories & filter information on single store page
    - FIX: Removed icon from json to increase speed

    ======
    1.2.8
    ======
    - FIX: undefined index in public.php file for meta boxes request

    ======
    1.2.7
    ======
    - FIX: Default Country
    - FIX: Import of new stores

    ======
    1.2.6
    ======
    - NEW: Sort by distance or alphabetically (settings > result list > sort by)
    - NEW: Try updating stores during import (updating process is checked by store name)
    - FIX: Store categories / filters are now sorted alphabetically ASC

    ======
    1.2.5
    ======
    - NEW: Import Store Opening Hours
    - NEW: Export Opening Hours
    - NEW: Slightly settings panel improvements

    ======
    1.2.4
    ======
    - FIX: DB Prepare statement

    ======
    1.2.3
    ======
    - NEW: Set a default store category to be active (Settings > Search Box > Default filter category)
    - NEW: Description now also shows up in result list
    - FIX: Description will now be exported correctly
    - FIX: Description does not show up when no email was set up

    ======
    1.2.2
    ======
    - NEW:  When importing stores with no Latitute / Longitute (lat / lng) the system will try to fetch the data from Google Reverse Maps
    		You will need to set a extra server side API Key this on the settings panel
    - FIX: Result list height in the Modal

    ======
    1.2.1
    ======
    - NEW:  Use custom Map Styling (e.g. from https://snazzymaps.com OR https://mapstyle.withgoogle.com/)
    		See settings -> Maps -> Styling
    - NEW:  Select what happens when a user clicks on the stores name in the result list
    		See settings -> Result list -> Link Action

    ======
    1.2.0
    ======
    - NEW: Automatically extend the map if no stores are found
    - NEW: Excel files are now .xlsx (for Excel 2007 and higher), but you can still switch to Excel 5 if preferred
    - NEW: Hide search Active filter
    - NEW: Hide search Filters completley
    - NEW: Hide search Title
    - FIX: Hardcoded some CSS settings

    ======
    1.1.7
    ======
    - FIX: CSS bug border-box-size

    ======
    1.1.6
    ======
    - NEW: Autocomplete country restriction: restricts the users search only within a specific country
    - NEW: Autocomplete type restriction. Only return city or zip code, but never street (specially used in US)
    - NEW: Conditional Data loading (e.g. when a store has no email, it will not be ouputted as "undefined")

    ======
    1.1.5
    ======
    - NEW: Support for subcategories in Category Dropdown
    - FIX: WP-Admin URL for settings buttons

    ======
    1.1.4
    ======
    - FIX: No Sidebar autoHeight
    - FIX: Map Center position

    ======
    1.1.3
    ======
    - FIX: Issue with Sidebar Height
    - FIX: Issue with Sidebar position

    ======
    1.1.2
    ======
    - FIX: Button does not show up on single product pages
    - FIX: Search in this area button styling

    ======
    1.1.1
    ======
    - Name change to WordPress Store locator
    - !!Important!! Before you upgrade make an export of your stores. Then update and import the exported stores.

    ======
    1.1.0
    ======
    - NEW: Drag the map and a button appear to do a search in this area
    - NEW: Stores & Categories can now be shown as items:
    - NEW: Single Store: http://wordpress.db-dzine.com/store/clothes-1/
    - NEW: Store Category: http://wordpress.db-dzine.com/store-categories/clothes-stores/
    - NEW: Option to hide the get directions link
    - NEW: Option to hide the search button
    - NEW: Option to set a custom text for the search button
    - NEW: Option to hide the result list title
    - NEW: Updated Design
    - NEW: When set a default position & auto location is disabled it automatically searches there
    - NEW: Better Versioning
    - FIX: Tel, Email, Web not showing on map
    - FIX: Description showed "undefined"

    ======
    1.0.10
    ======
    - FIX: Import issue with categories (not appended, but replaced)

    ======
    1.0.9
    ======
    - NEW: Enter button now works in search field
    - FIX: Description will now be shown
    - FIX: Premium icon on all result items
    - FIX: Versioning for JS / CSS files

    ======
    1.0.8
    ======
    - NEW:  When user declines HTML5 Geolocation or when it is not support, the user will now be
    		located by his IP address using the free service https://freegeoip.net (max. 10.000 requests per hour!)
    - FIX: switched the Google Maps "Get Direction" position

    ======
    1.0.7
    ======
    - NEW: Code cleanup
    - FIX: capability added for the import page

    ======
    1.0.6
    ======
    - NEW: Better plugin activation
    - FIX: Better advanced settings page (ACE Editor for CSS and JS )
    - FIX: array key exists

    ======
    1.0.5
    ======
    - FIX: Redux Framework error

    ======
    1.0.4
    ======
    - NEW: Import function for XLS-Files
    - NEW: Get Sample Import file (dynamically creates categories / filters too)
    - NEW: Export function to XLS
    - NEW: Delete all stores

    ======
    1.0.3
    ======
    - FIX: Google new requires API Key for everything
    - FIX: API Key now also provided in backend

    ======
    1.0.2
    ======
    - FIX: error when Meta-Box Plugin was not installed & activated

    ======
    1.0.1
    ======
    - NEW: Removed the embedded Redux Framework AND Meta Boxes for update consistency
    //* PLEASE MAKE SURE YOU INSTALL THE REDUX FRAMEWORK & Meta Box PLUGIN *//

    ======
    1.0.0.3
    ======
    - FIX: PHP 5.4 compatible errors

    ======
    1.0.0.2
    ======
    - FIX: Remove close button on shortcode pages
    - FIX: when hiding active filters also hide the active filter text

    ======
    1.0.0.1
    ======
    - FIX: Bring back the close button

    ======
    1.0.0
    ======
    - Inital release

Search