Dokan Business package introduces the new module, Geolocation to allow customers to search products and vendors by location.
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.
You can also go for Mapbox. It is an alternative to Google Maps. The link to acquire access key is given. You can easily attain the access token and use Mapbox as your geolocation.
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.
When you are setting location on Mapbox, you need to write the location precisely. Or you can write the location of the adjacent areas then drag the locator on to your location.
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:
You can see all the stores location when you use Mapbox.
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:
Show geolocation filters by shortcode
Alternatively, you can also render the geolocation filter form by shortcode.
- To do this, enter the shortcode [dokan-geolocation-filter-form] on your Edit Page section in the relevant place.
- Or you can also select Geolocation Filter Form from the Forms drop-down, as shown below.
- Then Save the update:
View from the front after using shortcode:
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.