=== Calculate Prices based on Distance For WooCommerce ===
Contributors: ammarahmad786
Tags: distance rate shipping, woocommerce delivery plugin, calculate shipping by distance, google maps shipping, local delivery, woocommerce distance rate shipping alternative, shipping cost calculator, delivery fee by km, delivery by mile, block checkout shipping
Requires at least: 6.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.3.7
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

The best FREE WooCommerce Distance Rate Shipping alternative. Calculate delivery fee by KM or Mile via Google Maps API. Supports WooCommerce checkout blocks.

== Description ==

Looking for a **free WooCommerce Distance Rate Shipping** alternative? **Calculate Prices based on Distance For WooCommerce** is the ultimate high-performance solution to automatically calculate delivery fees by KM (Kilometers) or Miles using the live Google Maps API. 

Stop losing money on flat-rate shipping. Whether you run a local pizza delivery, grocery store, furniture shop, or courier service, this plugin allows you to charge your customers accurate shipping rates based on the exact road distance from your store to their doorstep. 

Unlike older plugins, this is fully compatible with the modern **WooCommerce Block Checkout** and includes a built-in **Delivery Date & Time Picker** completely free.

### 🔐 CRITICAL SECURITY NOTICE (API KEYS)
To prevent your Google Maps API key from being stolen and abused by third parties, this plugin uses an advanced Dual-Key security architecture:
1. **Public Key (Web Restricted):** Used for front-end features like Maps JavaScript & Places Autocomplete API.
2. **Private Key (IP Restricted):** Used securely on the server side for Geocoding, Routes, & Directions API.
📌 [Step-by-Step: How to Get your Google Maps API Keys safely](https://www.routepricing.com/how-to-get-google-maps-api-key/)

---

### 🔥 Why Switch from Paid Distance Rate Shipping Extensions?
Most distance shipping plugins cost upwards of $150/year. This lightweight, powerful plugin gives you premium local delivery logistics features for **FREE**, making it the best alternative to official WooCommerce Distance Rate Shipping, WPCargo, and Flexible Shipping.

### 🌟 Free Version Features
* **Accurate Distance Shipping Calculation** – Automatically calculates shipping costs based on real-world driving routes via Google Maps.
* **Charge Per Kilometer (KM) or Mile** – Seamlessly switches between Metric and Imperial units to match your regional delivery setup.
* **Google Maps Address Autocomplete** – Speeds up user checkout and stops failed deliveries by suggesting verified addresses in real time.
* **Free Delivery Datepicker & Timepicker** – Let customers schedule their preferred local delivery day and time slot right on the checkout page.
* **Live Dynamic Shipping Rates** – Customers see their delivery fees adjust instantly as they type their delivery address.
* **WooCommerce Blocks & Classic Checkout Support** – Works flawlessly with traditional checkout pages and the new modern Gutenberg Cart/Checkout blocks.

### 🚀 Advanced Features in PRO Version
Take total control of your delivery zones and complex logistics routing:
* **Tiered Distance Pricing Rules** – Set up complex brackets (e.g., $5 flat for 0–5 KM, then $1.50 per additional KM up to 15 KM).
* **Maximum Delivery Radius Restriction** – Set a hard mileage or KM limit to block orders from customers living outside your delivery zone.
* **Store-to-Store & Custom Dual Addresses** – Calculate delivery rates between two completely custom locations (perfect for point-to-point courier services).
* **White-Label Custom Admin Labels** – Change checkout text fields and delivery fee labels to match your store’s branding perfectly.
* **Free Delivery Threshold by Cart Total** – Offer free shipping by distance once a user spends a specific amount (e.g., Free delivery over $100 within a 10km radius).
* **Force Checkout Address Verification** – Prevent orders from processing until an accurate distance rate has been queried.
👉 **[Unlock Advanced Pricing Brackets - Upgrade to PRO](https://www.routepricing.com/wordpress-plugins/)**

### 📽️ Proof & Live Demos
🎬 **Watch our 3D Animated Explainer:** [Watch on YouTube](https://www.youtube.com/watch?v=KdtlKJxTTNw)
🚀 **Test the Plugin Live (Free vs PRO Comparison):** [Try Live Demo](https://demo.routepricing.com/)

== Installation ==
1. Search for **Calculate Prices based on Distance For WooCommerce** in your WordPress dashboard, or upload the files to `/wp-content/plugins/`.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Navigate to **WooCommerce > WC Distance Calculator** in your sidebar.
4. Input your **Public & Private API keys** following our secure restriction guide.
👉 [Read the Complete Setup & Configuration Guide](https://www.routepricing.com/step-by-step-guide/)

== Frequently Asked Questions ==

= Is this a free alternative to WooCommerce Distance Rate Shipping? =
Yes! This plugin serves as a highly optimized, fully functional free alternative to the official $150/year WooCommerce Distance Rate Shipping extension. It provides core mileage and kilometer-based calculations without forcing you into an expensive annual subscription.

= How do I charge delivery fees per Mile or per KM? =
Inside the plugin settings page (**WooCommerce > WC Distance Calculator**), you can choose your preferred unit of measurement (Kilometers or Miles). Once selected, you can set your base flat rate and cost per unit of distance.

= Does this plugin support the new WooCommerce Block Checkout? =
Yes. Unlike many legacy shipping plugins that break on modern WordPress setups, this plugin completely supports both the traditional WooCommerce Classic Checkout shortcode and the new high-conversion **Cart and Checkout Blocks**.

= Why do I need two separate Google Maps API keys? =
Security is our priority. If you use a single API key for map rendering and distance calculations, malicious users can scrape your key from the front-end code and use your billing account for their own apps. By splitting it into a **Public Key (Web Restricted)** and a **Private Key (IP/Server Restricted)**, your Google Cloud billing is 100% safe from theft.

= Can I restrict delivery if a customer lives too far away? =
Limiting your delivery zone to a maximum radius (e.g., refusing to deliver past 25 Miles) is supported natively in our **PRO version**, which lets you block checkouts for addresses that fall outside your operational range.

= Can customers select a specific delivery date and time? =
Yes! Unlike other plugins that charge extra for scheduler modules, our **Free version** includes a built-in, lightweight Delivery Datepicker and Timepicker that embeds directly into your checkout page.

= Does this plugin slow down my site's checkout performance? =
Not at all. The distance queries are optimized to fire asynchronously only when a valid address is typed. It utilizes the latest ultra-fast Google Routes API endpoint, ensuring your page speed scores and SEO metrics remain perfect.

== Screenshots ==
1. Admin Dashboard - Simple configuration for Public and Private API keys.
2. Distance Rules - Setting up your delivery price per KM/Mile.
3. Date & Time Picker - Customer-facing local delivery scheduler on checkout.
4. Block Checkout - Seamless integration with modern Gutenberg-built online stores.

== Changelog ==
= 1.3.6 =
* 🔐 **Security:** Mandatory Separate Public & Private API keys to prevent front-end key theft.
* 🚀 **Performance:** Upgraded to the new Google Routes API for faster calculations and lower latency.
* 🛠 **Compatibility:** Fully tested and verified with WordPress 6.9+ and WooCommerce 9.0+.