Configuration
Flexible Shipping Distance Based Shipping Rates requires Flexible Shipping or Flexible Shipping PRO installed and activated.
To start configuration, go to WooCommerce → Settings → Shipping → Flexible Shipping Distance Based Shipping Rates

Google API Type – Distance Matrix API has been transitioned to Legacy status. In this case Google strongly encourages to use Routes API instead of Distance Matrix API. New customers are eligible to use Routes API.
API Key – fill this field with Google Maps API key in order to use distance and duration conditions in Flexible Shipping methods. To obtain a key please refer to this article.
In the project in Google Cloud Console go to APIs & Services > Enabled APIs & Services.

And ensure that the Routes API is enabled.

Distance Matrix API has been transitioned to Legacy status. In this case Google strongly encourage to use Routes API instead of Distance Matrix API.
API Connection Status – see the status of the API connection. Save plugin settings to reload.
Travel mode – choose between Driving, Cycling and Walking.
Distance Unit – choose between Imperial and Metric for better fit with your local requirements.
Origin – choose Store address to use Woocommerce address as an origin. Alternatively, provide custom address details after selecting Custom address.
Integrations – As part of a 3.0.0 update, there has been introduced integration with Dokan plugin and WCFM Marketplace plugin. The checkboxes are available only in the situation when they are installed and active. After ticking checkbox of Dokan or WCFM, address of the vendor from Dokan or WCFM instead of Origin store address is used by the Distance Based Shipping Rates plugin.
Please note: If you tick the checkbox of Dokan, and in the settings of user – Dokan settings are not filled out. The rules of Distance Based Shipping rates plugin won’t be working.
Please note: It is not recommended to use Dokan and WCFM integrations at the same time.
Usage
In Flexible Shipping rules table new conditions will be available: Distance and Duration.

For each condition you can set a values range to calculate precise shipping cost. Distance and Duration can be combined with any other cost calculation rules condition.
Exemplary checkout with Dokan integration can be found below:

Additional Cost
Flexible Shipping Distance Based Shipping Rates enables adding the ‘Additional cost’ field. This can be done by hovering over a field next to the rule cost. You will see a “plus” button:

As a result you will get:
