Vendor Distance Rate Shipping

A- A+

Vendors can now calculate the shipping based on the distance using the Distance rate shipping feature. The cost will be calculated based on the distance from the vendor shipping location to the customer’s location.

Rules can be set up to charge shipping based on the distance and total travel time, or the number of items in the cart, the weight of the items, or the total value of the cart.

Here's how to set up the distance rate shipping of Dokan.


  • WooCommerce
  • Dokan Lite
  • Dokan Pro (Latest Version)

Enable Table Rate Shipping Module – Admin

First of all, you need to enable the module from the backend. Navigate to WP-Admin–> Dokan–> Modules. Here enable the Table Rate Shipping module.

enable table rate shipping module

Create Shipping Class and Shipping Zones – Admin

Now, if you have set up shipping zones and shipping classes beforehand, then you can skip this step. Else, you can set up shipping zones and shipping classes from WooCommerce–> Settings –> Shipping.

shipping zones and class

Add Shipping Method – Admin

After enabling the Table Rate Shipping feature, you will find a new shipping method in the shipping method list ” Vendor Distance Rate Shipping“. Select this method to your selected zone. You can choose other methods as well.

Select your shipping zone and there click on the Add Shipping Method option.

add shipping method

Choose the Vendor Distance Rate Shipping from the dropdown box,

distance rate shipping

After adding the shipping method, hit the Save Changes button.

save changes button

Configure Google/Mapbox API

Now, the admin needs to enable the Map API source. This will enable the system to configure the distance between the vendors location to customer's location and help calculate the shipping charges. Admin will find the settings in Dokan–> Settings–> Appearance.

Here, admins need Google Map API and save the settings.

Google map

The admin part is done.

Note: Without google maps API key distance rate shipping will not accessible for vendors.

Configuring Distance Rate Shipping – Vendor

The vendor can configure the distance rate shipping right from the vendor dashboard. Navigate to Vendor Dashboard–> Settings–> Shipping. There click on the Edit option for the selected shipping zone.

edit shipping zone

In the next page, the vendor needs to add the shipping method. Click on the Add Shipping method option,

add shipping method-vendor

Select Distance Rate Shipping from the dropdown box,

distance rate shipping vendor

Enable the shipping method and Hit the Save Changes button.

enable shipping method

How to Add Different Rules

After the Zone settings are saved successfully, vendors need to edit the shipping method to set their respective rules.

edit shipping method

On the next page, the vendors will find different fields to set up shipping rules,

  • Method Title – Name the shipping method. This is visible to customers.
  • Tax Status – Whether the rates includes tax or not.
  • Transportation Mode – Method of transportation that is being used for delivering your products.
  • Avoid – Things to avoid when working out the distance; None, Tolls, Highways, or Ferries.
  • Distance Unit – Whether to use the Metric or Imperial system for working out distances.
  • Show Distance – Whether to show the actual distance on the cart/checkout pages when presenting the customer with their shipping rate.
  • Show Duration – Whether to show an approximation of how long the delivery would take.
  • Shipping Address – The address from where you are shipping from, this can be your store location or, if you ship from a different location to your store, enter the address of that location here.
shipping method fields

You will find different distance rules to set your shipping charges,

  • Condition is to specify what rules are based on, be it distance, total travel time, cart item count, weight, or cart total value.
  • Min and Max to specify a range the type will fall in (travel time based in Minutes). Leave the fields blank if there is no limit.
  • Base Cost to apply if the rule matches, excluding tax. Other calculations will be added on top of this cost.
  • Cost Per Distance / Minute is the value to charge based on the total travel time or distance to the customer address, excluding tax.
  • Handling Fee allows you to enter a fixed amount or percentage that is added to the shipping cost (such as 2.50 or 5%).
  • Break will stop looking for any other rates below this rule (top-down), if the condition is met. Rates calculated up to the Break point will be offered.
  • Abort will disable this shipping method, if the condition is met. No rates will be offered.
distance rate rules

Here are some examples to understand how distance rate-based shipping works.

Example 1:

If the distance is between 1km-100km, then for every km the vendor will charge $1. So,

Condition: Distance

Min: 1km

Max: 100km

Per Distance Cost: $1

distance based example

If the total amount of the order is $90, and the distance is 1.9Km then the shipping charge will be ( 1*1.9)=$1.9. The total amount will be $91.9.

distance based cart

Example 2:

If it takes 1-100 minutes to complete the order, then for every minute the vendor will charge $1.

Condition: Total Travel Time

Min: 1m

Max: 100m

Per Distance Cost: $1

time based example

Here is the calculation,

time based rate

Example 3: The break option will tell the system to stop calculating after the first condition is met.

Condition 1: Distance

Min: 1km

Max: 100km

Per Distance Cost: $1

Condition 2: Total Travel Time

Min: 1m

Max: 100m

Per Distance Cost: $1


Here's what the cart page will look like, as the distance condition is met, it will not calculate the total travel time condition.

Break option result

So, this is how you can configure the distance rate shipping module for Dokan.