Shipping Costs Based on Distance

Version v1.8.2
Platform Magento 2
Released 4 November 2025

Pricing Setup for Shipping Costs

Learn how to configure distance-based pricing tables for the Shipping Costs Based on Distance extension. Create flexible pricing rules that combine fixed rates with per-distance charges.

How Pricing Works

The extension calculates shipping costs using a pricing table with distance ranges. Each range can have:

  • Fixed Price - A base amount charged for that distance range
  • Per km/mile Rate - An additional charge multiplied by the total distance

Final Cost = Fixed Price + (Distance × Per km Rate)

Creating a Pricing Table

Navigate to Magmodules → Shipping Costs Based on Distance → Shipping Method → Calculation and Pricing.

Table Structure

Column Description
From Start of the distance range (inclusive)
To End of the distance range (inclusive)
Fixed Price Base shipping cost for this range
Per km/mile Additional cost per distance unit

Adding Rows

  1. Click Add to create a new pricing row
  2. Enter the distance range (From/To)
  3. Set the fixed price
  4. Set the per km/mile rate (use 0 for flat rate)
  5. Click Save Config

Pricing Examples

Example 1: Simple Flat Rate by Distance

From To Fixed Per km
0 10 5.00 0
10 25 10.00 0
25 50 15.00 0

Result: Fixed prices based on distance zones. A customer 8 km away pays €5.00, a customer 20 km away pays €10.00.

Example 2: Per-Kilometer Only

From To Fixed Per km
0 100 0 0.50

Result: Pure distance-based pricing. A customer 30 km away pays €15.00 (30 × €0.50).

Example 3: Base Fee + Per-Kilometer

From To Fixed Per km
0 10 5.00 0
10 30 5.00 0.50
30 50 10.00 0.75

Calculation for 25 km:

  • Falls in 10-30 km range
  • Fixed: €5.00
  • Per km: 25 × €0.50 = €12.50
  • Total: €17.50

Calculation for 40 km:

  • Falls in 30-50 km range
  • Fixed: €10.00
  • Per km: 40 × €0.75 = €30.00
  • Total: €40.00

Example 4: Tiered Progressive Pricing

From To Fixed Per km
0 5 3.00 0
5 15 5.00 0.30
15 30 8.00 0.50
30 50 12.00 0.75

Result: Increasing rates for longer distances, encouraging local customers.

Using Price Caps

Combine the pricing table with minimum and maximum price settings for additional control.

Configuration: Shipping Costs Based on Distance → Limit Rules → Minimal and Maximum Shipping Price

Setting Use Case
Minimal Price Ensure a minimum charge even for very short distances
Maximum Price Cap the shipping cost for long distances

Example:

  • Pricing table calculates €45.00 for a long-distance order
  • Maximum Price set to €30.00
  • Customer pays €30.00

Combining with Free Shipping

Set up free shipping thresholds that override the pricing table.

Configuration: Shipping Costs Based on Distance → Limit Rules → Free Shipping

Setting Description
Enable Free Shipping Turn on free shipping feature
Minimal Order Amount Order subtotal required for free shipping

When the order meets the threshold, shipping cost becomes €0.00 regardless of distance.

Rounding Options

Control how the extension rounds calculated values.

Round Distance

Apply rounding to the calculated distance before price calculation:

  • No rounding - Use exact distance (e.g., 12.7 km)
  • Round up - Always round up (12.7 → 13 km)
  • Round down - Always round down (12.7 → 12 km)
  • Round to nearest - Standard rounding (12.7 → 13 km, 12.4 → 12 km)

Round Total Price

Apply rounding to the final shipping price:

  • No rounding - Use exact calculated price
  • Round up - Round to next whole number
  • Round down - Round down to whole number
  • Round to nearest - Standard rounding

Tips for Effective Pricing

Cover All Distances

  • Ensure your ranges cover all possible distances
  • Use your maximum delivery distance as the final "To" value
  • Gaps in ranges will result in no shipping method shown

Consider Your Costs

  • Factor in fuel costs, time, and vehicle wear
  • Account for return trips
  • Include handling and packaging time

Test Your Pricing

  • Use the checkout with different test addresses
  • Verify calculations match your expectations
  • Check edge cases (exact range boundaries)

Monitor and Adjust

  • Review actual delivery costs vs. charged rates
  • Adjust pricing based on customer feedback
  • Consider seasonal variations (winter driving conditions)

Need More Help?

Documentation:

Support:

Created:
Updated:
star star star star star
star star star star star
Alexandru-Manuel Carabus
Magmodules sets the bar for Magento module quality and support—we check their catalog first for client feature requests, and they’re our first choice for licenses.
Google 11 Nov 2025
star star star star star
star star star star star
Matt Austin
Possibly the fastest support response times of any Magento Extension vendor. Great extensions too!
Google 09 Sep 2025
star star star star star
star star star star star
Jan Privé
Dankzij de heldere uitleg en snelle reactie van Magmodules kon mijn vraag, en dus mijn Magento-probleem, binnen enkele uren worden beantwoord. Doeltreffend, zonder moeilijke termen, gewoon zo als het zou moeten zijn.... Bedankt!
Google 05 Sep 2025
star star star star star
star star star star star
Denis Metzler
To evaluate a provider, it is not enough to consider only the product offered, but also its after-sales service, such as support and troubleshooting. Magmodules has been extremely satisfactory at all levels on multiple occasions and sets the bar at the top when comparing the competition.
Google 02 Sep 2025
star star star star star
star star star star star
Bleijenberg winkelinrichting en materialen
Goed bereikbaar, reageren snel en denken oplossingsgericht. Een aanrader.
Google 30 Jul 2025
star star star star star
star star star star star
Patrick Verduijn
Magmodules biedt plugins aan die van hoge kwaliteit zijn tegen een goede prijs, waar dit bedrijf in uitblinkt is de bereidheid om de zeldzame feedback & problemen met de plugins te willen onderzoeken, mee te willen denken in het debuggen van problemen en goede oplossingen toe te passen. In mijn decennium ervaring met Magento & 3th parties is Magmodules absoluut een uniqum binnen de markt.
Google 25 Jul 2025
star star star star star
star star star star star
Erik de Groot
Magemodules heeft hele sterke Magento extensies en een proactieve support. Al jaren heel erg tevreden over jullie service en producten!
Google 18 Jul 2025
star star star star star
star star star star star
René Zeuner
We are using the Mollie Magento extension from Magmodules. It works excellently without flaws. Very fast, competent and friendly support. Thanks!
Google 30 Jun 2025
star star star star star
star star star star star
R. U.
Erg goed team, reageren snel en duidelijk en hebben met toegang tot onze database erg goed geholpen (eigenlijk een gratis customization).
Google 18 Jun 2025
star star star star star
star star star star star
Hugo de Groot
Uitstekende support! Wij gebruiken o.a. de Rich Snippets Suite extensie voor onze Magento 2 webshop (Hyvä) en hadden een specifieke vraag over structured data op PLP-pagina’s. Binnen no-time kregen we een inhoudelijk en duidelijk antwoord. Zeer prettig contact en goed onderbouwde uitleg. Absoluut een betrouwbare partner voor Magento-extensies!
Google 13 Jun 2025