Admin sets coordinates for each store and plugin find nearest store from user's location in a API request.
This wordpress plugin adds menu beside dokan-menu and admin can set latitude, longitude, acceptable diameter for each store. Also, set new WP-api endpoint that accept lat & lng args as user location and response only nearest store name or message.
- Upload
zip-file
to the/wp-content/plugins/
directory - Activate the plugin through the 'Plugins' menu in WordPress
- go to
Dokan Stores PDB
menu and set latitude, longitude, diameter, enabled options - enable WP-API and set message for no store found condition
- installed Dokan-lite & Dokan-pro.
- WP-API enabled.
every vendor/store must have City
field that Dokan-pro provide this option.
POST http://{WEBSITE_URL}/wp-json/dgcpdb/v1/find_store
BODY [form-data]
lat : 31.138181
lng : 48.606906
{
"message": "",
"city": "Tehran"
}
POST http://{WEBSITE_URL}/wp-json/dgcpdb/v1/find_store
BODY [form-data]
lat : 32.0
lng : 48.0
{
"message": "هیچ فروشگاهی در نزدیکی شما پیدا نشد! سوالی دارید؟ <a href=\"http://romroid.ir\">اینجا کلیک کنید</a>",
"city": null
}
Contributors: @pooryaDb website / telegram
Donate link:
USDT (TRC20) : TKpWx9sukxDqfRhWzXTKmUbYSm37BeeC4F
USDT (ERC20) : 0x8a3e8bf35f52b391727782f6c40e463ffad23327
ETH (BSC) : 0x8a3e8bf35f52b391727782f6c40e463ffad23327
ETH (ERC20) : 0x8a3e8bf35f52b391727782f6c40e463ffad23327
Tags: wordpress, dokan, plugin, geolocation, rest-api, api, php, woocommerce, multivendor, multi-vendor, shop, vendor, seller, store, sell, online,multi seller, multi store, multi vendor, multi vendors, multistore, multivendor, product vendor, product vendors, vendor, vendor system, vendors, wc market place, wc marketplace, wc vendors, woo vendors, woocommerce market place, woocommerce marketplace, woocommerce multi vendor, e-commerce
Requires at least: 3.0.1
Tested up to: 5.4.4
Stable tag: 5.4.4
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html