Dokan Geolocation

Dokan PRO 2.9.0 introduces the new module, Geolocation to allow customers to search products and vendors by location.

Admin Configuration

1. Turn on Geolocation from wp-admin→Dokan→Modules.

2. Go to Dokan→Settings→Appearance. Turn on the checkbox for Show Map on Store Page if not enabled.

3. Then enter the Google Map API Key in the next field. Obtain the API Key in the manner given in the link.

Google Maps Dokan Docs

4. Click on Save Changes.

5. Go to Dokan→Settings→Geolocation. Here you can configure the position of the map as it would appear on these two storefront pages: Shop Page and Store List Page. You can position the Map on Top, Left, and Right.

Dokan Geolocation Settings

6. By default filters will be enabled. Admins can disable it. Filters include searching for products, categories, and vendors by location.

Shop page view with geolocation:

Store List view with geolocation:

8. By default, maps in single product page will be enabled. Admins can disable it.

Single product page tab view with geolocation:

9. Select the Radius Search Unit as Kilometers or Miles from the drop-down.

10. Admins can also change the minimum and maximum Radius Search Distance using the numeric fields.

11. After configuring, click on Save Changes.

Show location on sidebar

Admins can also show the geolocation feature on storefront using Dokan widgets. Though for this to work, the default setting for Location tab on single product page has to be disabled from wp-admin→Dokan→Settings→Geolocation.

1. Navigate to wp-admin→Appearance→Widgets.

2. Drag and drop Dokan: Product Location widget to Sidebar to show the map on the side of single product page.

3. You can also add the Dokan: Geolocation Filter Form to a page on your site by dragging and dropping the widget. Note: for this widget to render properly, you need to use a child theme.

This is how it will appear on the product page when you use Product Location widget:

Widget view:

Show geolocation filters by shortcode

Alternatively, you can also render the geolocation filter form by shortcode.

  1. To do this, enter the shortcode [dokan-geolocation-filter-form] on your Edit Page section in the relevant place.
  2. Or you can also select Geolocation Filter Form from the Forms drop-down, as shown below.
  3. Then Save the update:

View from the front after using shortcode:

Vendor configuration

1. Vendors go to Vendor Dashboard→Settings→Store. Ensure that under Map you have entered your address. Click on Update Settings.

2. Vendors can set up location product-wise too. To do this go to Vendor Dashboard→Products.

3. Now click on Edit Product. Scroll down the page. Under Geolocation, uncheck Same as store location.

4. Then enter a new location for the product. Then click on Save Product.

Now customers can search for this product by location from shop list page.

Other than that there are no other configurations for vendors.