=== Calculate Prices based on Distance For WooCommerce ===
Contributors: ammarahmad786
Tags: local delivery, woocommerce shipping plugin, woocommerce delivery plugin, woocommerce, shipping, distance, delivery, google maps, dynamic pricing, distance based pricing, woocommerce shipping rates, delivery charge calculator,
Requires at least: 6.5
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.3.6
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

**🚨 ATTENTION REQUIRED FOR VERSION 1.3.6 AND ABOVE 🚨**

Starting from **version 1.3.6**, the plugin now uses **TWO SEPARATE Google Maps API keys** for better **security, performance, and compliance with Google’s best practices**.

👉 **If you upgrade from 1.3.5 or earlier, you MUST update your Google Maps API configuration**, otherwise distance calculation will not work.

📌 **[How to Get a Google Maps API Key](https://www.routepricing.com/how-to-get-google-maps-api-key/)**  


### 🔐 New API Key Structure (v1.3.6+)

**1️⃣ Public API Key (Frontend – Web Restricted)**
Enable ONLY:
- Maps JavaScript API  
- Places API  

Restriction:
- **HTTP Referrer (Website restriction)**

**2️⃣ Private API Key (Server-side – IP Restricted)**
Enable ONLY:
- Geocoding API  
- Routes API  
- Directions API  

Restriction:
- **Server IP Address**

📌 This change replaces the old setup where **one unrestricted API key** was used for all services.

---

Easily **automate WooCommerce shipping costs** by calculating delivery prices **based on real-world driving distance** using the **Google Maps API**.  
This plugin **ensures dynamic, accurate pricing**, helping reduce cart abandonment and boost conversions.  
Perfect for local delivery businesses and eCommerce stores using WooCommerce.  

💡 Now compatible with both **WooCommerce Classic Checkout** and the new **Block-Based Checkout (Cart and Checkout Blocks)**.

📌 **Need help setting up the plugin?**  
👉 **[Follow this Step-by-Step Guide](https://www.routepricing.com/step-by-step-guide/)**  

🚀 **[Test the Plugin Live (FREE + PRO)](https://demo.routepricing.com/)**  

== Short Description ==
Automatically calculate WooCommerce delivery fees based on real-world distance using Google Maps API.

== Requirements ==
✔ **Google Maps API Keys Required (v1.3.6+)**

**Public API Key (Web Restricted):**
- Maps JavaScript API  
- Places API  

**Private API Key (IP Restricted):**
- Geocoding API  
- Routes API  
- Directions API  

📌 **Google requires billing details for API activation, but standard API usage is FREE with monthly credits.**

👉 **Need help? Follow this guide:**  
📌 **[How to Get a Google Maps API Key](https://www.routepricing.com/how-to-get-google-maps-api-key/)**  

== 🔥 Features in Free Version ==
✅ **Distance-Based Pricing** – Automatically calculate delivery charges based on the distance between your store and the customer’s address.  
✅ **Google Maps Address Autocomplete** – Provides address suggestions in real time, improving checkout speed and accuracy.  
✅ **Charge Per Kilometer or Mile** – Fully customizable delivery charges based on preferred unit.  
✅ **Delivery Datepicker & Timepicker** – Allow customers to choose preferred delivery date and time.  
✅ **Live Calculation Display at Checkout** – Customers see calculated delivery charges instantly.  
✅ **Works Seamlessly with WooCommerce Classic & Block Checkout** – Full compatibility with both checkout types.  
✅ **Lightweight & Easy to Set Up** – Designed for store owners and non-developers.  

== 🚀 Features in PRO Version ==
✔ **Advanced Pricing Rules** – Create tiered pricing brackets (e.g., $5 for 0–5 KM, $10 for 5–15 KM).  
✔ **Maximum Delivery Distance** – Restrict deliveries beyond a certain radius.  
✔ **Dual Address Fields** – Allow pricing between two locations (e.g., pickup & drop-off).  
✔ **Admin Label Customization** – Rename plugin labels for better customer UI experience.  
✔ **Free Delivery Threshold** – Automatically waive delivery fees when the cart total reaches a set amount.
✔ **Force Delivery Fee Calculation** – Option to require delivery cost calculation before customers can complete checkout.
📌 **Upgrade to PRO for full control over WooCommerce delivery pricing!**  
👉 **[Get PRO](https://www.routepricing.com/wordpress-plugins/)**  

== 📽️ How It Works ==
🎬 **Watch our 3D Animated Video to See the Plugin in Action:**  
📺 **[Watch Now](https://www.youtube.com/watch?v=KdtlKJxTTNw)**  

== Installation ==
1. Download & upload **"calculate-prices-based-on-distance-for-woocommerce.php"** to `/wp-content/plugins/`.  
2. Activate the plugin via **Plugins > Installed Plugins** in WordPress.  
3. Go to **WooCommerce > WC Distance Calculator** to configure your settings.  
4. **Add both Google Maps API keys (Public + Private)** and define your pricing rules.  

👉 **Need help? Follow this guide:**  
📌 **[Set up Guide](https://www.routepricing.com/step-by-step-guide/)**  

== Changelog ==

= 1.3.6 =
- 🔐 **Improved Google Maps API security** using separate Public & Private API keys  
- Added **Web & IP-based API restrictions** support  
- Updated documentation and setup guide  
- Performance and stability improvements  

= 1.3.5 =
- Improved Google Maps API setup guide  
- Compatibility added for WooCommerce Block-Based Checkout  
- Minor bug fixes  

== Upgrade Notice ==

= 1.3.6 =
**Important update!** You must reconfigure your Google Maps API keys using the new secure setup.

== Screenshots ==
1. Plugin Admin Settings  
2. Distance-Based Pricing Configuration  
3. Datepicker & Timepicker Settings  
4. Checkout Page with Automated Delivery Fee Calculation  
5. Custom Pricing Per Distance Range  
6. Multi-Store Distance Pricing  
