Shipping Costs Based on Distance

Version v1.8.2
Platform Magento 2
Released 4 November 2025

Troubleshooting Shipping Costs Extension

Solutions for common issues with the Shipping Costs Based on Distance extension.

Shipping Method Not Showing

Check Basic Configuration

  • Module Enabled: Magmodules → Shipping Costs Based on Distance → General → Enabled = Yes
  • Shipping Method Enabled: Shipping Method → Name and Position → Enabled = Yes
  • API Key Set: General → API and Location Details → API Key is filled in
  • Store Address Set: General → API and Location Details → Store Address is filled in

Check Limit Rules

  • Country: Is the customer's country in the allowed countries list?
  • Distance: Is the customer within the maximum distance limit?
  • Order Amount: Does the order meet the minimum order amount requirement?

Check Product Conditions

If conditions are enabled:

  • Are all cart products eligible for distance-based shipping?
  • If using "Show only for eligible products," ensure products meet criteria
  • Check the product attribute used for eligibility

Test the API Connection

  1. Click Test Credentials in configuration
  2. Run CLI selftest: bin/magento distancebasedshipping:selftest
  3. Check if API key is valid and has proper permissions

Wrong Shipping Price Calculated

Verify Pricing Table

  • Check that distance ranges don't have gaps
  • Ensure the customer's distance falls within a defined range
  • Review fixed price and per-km rate settings

Check Rounding Settings

  • Round Distance: Affects the distance used in calculations
  • Round Total Price: Affects the final displayed price

Review Price Caps

  • Minimal Price: Is the calculated price being raised to minimum?
  • Maximum Price: Is the calculated price being capped?

Check Free Shipping

  • Is free shipping enabled?
  • Does the order meet the free shipping threshold?

Debug the Calculation

  1. Enable Debug Mode in configuration
  2. Place a test order
  3. Check logs in var/log/ for calculation details

API Errors

"API key not valid"

  • Verify the key is copied correctly without extra spaces
  • Check the key exists in Google Cloud Console
  • Ensure the key hasn't been deleted or regenerated

"Distance Matrix API has not been used"

  • Enable Distance Matrix API in your Google Cloud project
  • Wait a few minutes after enabling
  • Verify you're using the correct project

"REQUEST_DENIED"

  • Check API key restrictions in Google Cloud Console
  • Verify billing is set up on the project
  • Ensure server IP is whitelisted (if IP restriction is enabled)

"OVER_QUERY_LIMIT"

  • You've exceeded your API quota
  • Wait for quota to reset (daily/monthly)
  • Consider upgrading your Google Cloud plan

"ZERO_RESULTS"

  • Google can't find a route between addresses
  • Verify store address is valid and findable
  • Customer address may be incomplete or invalid

"INVALID_REQUEST"

  • Store or customer address is malformed
  • Check address format in configuration
  • Ensure address includes all required components

Address Not Found Issues

Store Address Problems

  • Test your store address in Google Maps directly
  • Use full address format: street, city, postal code, country
  • Avoid PO Box addresses
  • Don't use special characters

Customer Address Problems

Configure fallback behavior:

  1. Go to Shipping Method → Address Not Found
  2. Choose Hide shipping method or Show with message
  3. Set a helpful error message for customers

Shipping Estimation on Product Page

Not Showing

  • Check Add Shipping Estimation to Product Page is enabled
  • Clear cache after enabling
  • Verify the product page template supports the estimation block

Showing Wrong Price

  • Product page estimation uses entered postcode only
  • Full address at checkout may result in different distance
  • This is expected behavior

Performance Issues

Slow Checkout

  • Distance calculation adds API latency
  • Enable caching if available
  • Consider using a closer Google Cloud region

High API Costs

  • Monitor usage in Google Cloud Console
  • Set up billing alerts
  • Review if unnecessary API calls are being made

Cache Issues

After configuration changes:

bin/magento cache:flush

For persistent issues:

bin/magento cache:clean
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:flush

Debug Mode

Enable detailed logging:

  1. Go to Magmodules → Shipping Costs Based on Distance → Debug & Logging
  2. Set Debug Mode to Yes
  3. Click Save Config

Logs are written to var/log/. Look for:

  • API request/response details
  • Distance calculation steps
  • Price calculation breakdown
  • Any errors or warnings

Note: Disable debug mode in production to reduce log size.

Selftest

Run the built-in diagnostic:

bin/magento distancebasedshipping:selftest

The selftest checks:

  • Module configuration
  • API connectivity
  • Required settings
  • Common misconfigurations

Common Scenarios

Shipping Shows for Some Customers, Not Others

  • Check distance limits - some customers may be too far
  • Verify country restrictions
  • Check if customer's address is findable by Google

Price Different Than Expected

  • Review the pricing table and calculation method
  • Check which distance range applies
  • Verify rounding settings
  • Look for min/max price caps

Method Disappeared After Working

  • API key may have expired or been deleted
  • Billing may have been disabled on Google Cloud
  • Configuration may have been changed
  • Run selftest to diagnose

Need More Help?

Documentation:

Support:

When contacting support, include:

  • Magento and extension version
  • Selftest results
  • Debug log excerpts (if applicable)
  • Screenshots of configuration
  • Steps to reproduce the issue
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