How to Setup CodeCanyon WooCommerce Distance & Date Shipping: A Beginner’s Guide
Want to offer shipping based on distance and estimated delivery dates in your WooCommerce store? The “WooCommerce Distance & Date Shipping” plugin from CodeCanyon is a powerful tool that can help you do just that. It allows you to calculate shipping costs based on the distance between your store and the customer’s address, and even lets you display estimated delivery dates, enhancing the customer experience.
This guide will walk you through the setup process, even if you’re a complete beginner. We’ll break it down into simple, easy-to-understand steps, with real-world examples to illustrate how it works.
Why Use Distance and Date Shipping?
Traditional flat-rate or weight-based shipping doesn’t always accurately reflect the real cost and time it takes to deliver an order. Imagine you sell handcrafted furniture. Shipping a large sofa a few blocks away shouldn’t cost the same as shipping it across the country! This is where distance-based shipping shines.
Here’s why you should consider using distance and date shipping:
- Accurate Shipping Costs: Calculate shipping fees based on the actual distance traveled, ensuring profitability and fair pricing.
- Improved Customer Experience: Provide realistic delivery date estimates, building trust and reducing customer anxiety. Nobody likes being left in the dark about when their order will arrive.
- Competitive Advantage: Offer a more tailored shipping experience compared to competitors using generic shipping methods.
- Flexibility: Configure different shipping rates for different distance ranges and delivery options.
- Reduced Cart Abandonment: Accurate shipping costs and realistic delivery dates reduce surprise costs and can lead to higher conversion rates.
- In your WordPress dashboard, go to Plugins > Add New.
- Click “Upload Plugin” and choose the .zip file you downloaded.
- Click “Install Now” and then “Activate Plugin.”
- Google Maps API Key: This is crucial! You’ll need a Google Maps API key to calculate distances. Go to the Google Cloud Console, create a project (if you don’t have one), enable the “Distance Matrix API” and the “Maps JavaScript API,” and generate an API key. Restrict the key to your website for security. Without this key, the plugin won’t be able to calculate distances.
- Default Origin Address: Enter your store’s address or warehouse location. This is the starting point for distance calculations. Example: *123 Main Street, Anytown, CA 91234*
- Unit of Measurement: Choose your preferred unit (miles or kilometers).
- Distance Calculation Method: Select the method you want to use (e.g., driving, walking, bicycling). Driving is the most common and practical option for most businesses.
- Enable Debug Mode: Turn this on temporarily for troubleshooting.
- Add Shipping Zone: Click “Add Shipping Zone” and give it a descriptive name. Example: *Local Delivery (Within 50 Miles)*
- Zone Locations: You can restrict the zone to specific countries, states, or even postcodes if needed.
- Add Shipping Rule: Within each zone, add shipping rules based on distance.
- Distance From: The starting distance (in your chosen unit). Example: *0*
- Distance To: The ending distance. Example: *50*
- Cost: The shipping cost for that distance range. Example: *25.00*
- Cost Per Distance Unit: An additional cost per mile/kilometer. Example: *0.50* This is useful for longer distances where the cost increases linearly.
- Base Delivery Days: The minimum number of days for delivery within this zone. Example: *1*
- Additional Delivery Days Per Distance Unit: Add extra days based on distance. Example: *0.1* (This adds 0.1 day for each mile/kilometer, reflecting longer transit times)
- Maximum Delivery Days: Set a maximum delivery time. Example: *5*
- Weekday Shipping: You can exclude certain weekdays from delivery calculations (e.g., Sundays).
- Holiday Management: Add holidays to prevent deliveries on those days.
- Conditional Logic: Create more complex shipping rules based on product categories, weights, or other factors (requires the Advanced Conditional Logic add-on, sold separately).
- Google Maps API Errors: The most common issue is an invalid or missing Google Maps API key. Double-check that you’ve correctly generated and configured your API key, and that the necessary APIs are enabled in the Google Cloud Console.
- Incorrect Distance Calculations: Verify that your origin address is correct and that you’ve chosen the appropriate distance calculation method.
- No Shipping Methods Available: Ensure that you’ve created at least one shipping zone with a rule that covers the customer’s location.
- Delivery Dates Not Displaying: Double-check your date formatting settings and make sure that the plugin’s “Display Delivery Date” option is enabled.
Getting Started: Purchasing and Installing the Plugin
1. Purchase the Plugin: Head over to CodeCanyon and purchase the “WooCommerce Distance & Date Shipping” plugin. Make sure to choose the right license based on your needs (single site or multiple sites).
2. Download the Plugin: After purchasing, download the plugin .zip file from your CodeCanyon account.
3. Install and Activate:
Configuring the Plugin: A Step-by-Step Guide
Once the plugin is activated, you’ll find a new section within your WooCommerce settings. Let’s explore the core configuration options.
1. Accessing the Settings: Go to WooCommerce > Settings > Shipping > Distance & Date Shipping.
2. General Settings:
3. Shipping Zones and Rules:
This is where you define your shipping rules based on distance ranges. This is the heart of the plugin.
Example Scenario: Bakery Delivery
Let’s say you run a bakery and offer local delivery. You might set up the following zone:
* Zone Name: Local Bakery Delivery
* Zone Location: Restricted to the postcode area of your city.
* Rule 1:
* Distance From: 0
* Distance To: 5
* Cost: 5.00
* Base Delivery Days: 1
* Additional Delivery Days Per Distance Unit: 0
* Rule 2:
* Distance From: 5
* Distance To: 15
* Cost: 10.00
* Base Delivery Days: 1
* Additional Delivery Days Per Distance Unit: 0.2
* Maximum Delivery Days: 3
This means delivery within 5 miles costs $5 and takes 1 day. Delivery between 5 and 15 miles costs $10, takes at least 1 day, and adds 0.2 days per mile, with a maximum delivery time of 3 days.
4. Date Formatting:
Configure how delivery dates are displayed to customers. You can choose from various date formats.
Advanced Options:
The plugin offers several advanced features you can explore as you become more comfortable with the basics:
Troubleshooting
Code Examples (For Customization):
While most configuration can be done through the admin interface, you might want to customize things further. Here’s a very basic example of filtering the calculated shipping cost:
add_filter( 'woocommerce_distance_shipping_calculated_cost', 'adjust_shipping_cost', 10, 4 );
function adjust_shipping_cost( $cost, $distance, $zone_id, $args ) {
// Example: Add a surcharge for distances over 100 miles.
if ( $distance > 100 ) {
$cost += 20; // Add $20 surcharge
}
return $cost;
}
Important: This is a simplified example. Consult the plugin documentation for more advanced customization options and always test your code thoroughly on a staging site before implementing it on your live store.
Conclusion
The CodeCanyon WooCommerce Distance & Date Shipping plugin provides a powerful and flexible way to calculate shipping costs based on distance and display estimated delivery dates. By following the steps outlined in this guide, you can easily set up the plugin and offer a more accurate and customer-friendly shipping experience in your WooCommerce store. Remember to always test your configuration and consult the plugin documentation for detailed information and advanced options. Good luck!