A flat delivery fee is either too high for close customers or too low for far ones. Charging by distance fixes that. WooCommerce cannot do it on its own, because it never measures how far away the address is.
Four ways to price delivery
| Rate | Price | Example |
|---|---|---|
| Flat rate | The same price in the whole zone. WooCommerce formulas like [qty] and [cost] work. | $5 in the city zone |
| By driving distance | Price per km or mile × the driving distance | $1.20 per km |
| Fixed rate + driving distance | A start fee plus a price per km or mile | $3 + $1 per km |
| Fixed rate inside a radius, then per km | The fixed rate inside an included straight-line radius, then a price per km beyond it | Free within 1 km, then $1 per km |
The last three are in Shipping Zones by Drawing Premium. Flat rates per drawn zone or radius are free.
How the distance is measured
- Driving distance follows the roads, by car or by bike. It uses Google’s Routes API (or the legacy Directions API) with a server key.
- Straight-line distance is used for the included radius. It only needs the Geocoding API.
- Every distance starts from the method’s shipping origin: your store, or another shop or warehouse.
Set it up with Shipping Zones by Drawing Premium
- Install Shipping Zones by Drawing Premium, add your Google Maps API keys, and enable the Routes API for the server key.
- Add a Shipping Zones by Drawing method to a WooCommerce zone that covers your area.
- Choose the Shipping Rate type and enter the fixed rate and the distance unit rate.
- Optional: limit the method by maximum driving distance or driving time, or by a drawn zone or a radius.
- Optional: set a minimum order amount, or allow free shipping with a coupon.
Test a real address before you go live. The plugin’s setup check shows which methods an address gets, and why.
Combine distance and zones
Distance pricing and zones work together. Example: a drawn zone for the city at a flat $4, and a method by driving distance for everything up to 30 minutes away. For the basics, read WooCommerce local delivery.
Step by step, with screenshots: free within 1 km, then $1 per km and two locations, one checkout, where each address is priced from both stores and the customer sees the cheapest.
Questions
Does the price update at checkout?
Yes. The price is calculated from the delivery address in the cart and the checkout, and changes when the address changes.
Does it work with the block checkout?
Yes, in server mode, which the block checkout requires.
Do I pay Google for each lookup?
Google Maps Platform charges per request above its monthly free usage. Shipping rates are cached, so the same address is not looked up again and again.
Next: Premium, from $39 a year · See the tutorials · Shipping Rate in the docs