WordPress

How to Add Estimated Delivery Dates to WooCommerce Product Pages

How to Add Estimated Delivery Dates to WooCommerce Product Pages

Why Show Estimated Delivery Dates?

Customers love transparency. Displaying estimated delivery dates:

  • Improves trust and buying confidence
  • Reduces cart abandonment
  • Decreases support inquiries about shipping times

Let’s explore how to add this info dynamically to product pages without using a plugin.


Step 1: Decide Your Delivery Logic

We’ll assume a standard logic: “Delivery in 3–7 business days from today”. You can adjust it later based on product type, region, or shipping method.


Step 2: Add Code to functions.php

Paste this in your theme’s functions.php or in a custom plugin:


function show_estimated_delivery_date() {
    // Delivery range in days
    $min_days = 3;
    $max_days = 7;

    // Skip weekends
    $start = strtotime("+{$min_days} weekdays");
    $end = strtotime("+{$max_days} weekdays");

    $start_date = date_i18n('F j', $start);
    $end_date = date_i18n('F j, Y', $end);

    echo '<p class="estimated-delivery">
        📦 Estimated Delivery: ' . $start_date . ' – ' . $end_date . '
    </p>';
}
add_action('woocommerce_single_product_summary', 'show_estimated_delivery_date', 25);

This will display the delivery estimate just after the product price on single product pages.


Step 3: Style It with CSS (Optional)


.estimated-delivery {
  font-size: 14px;
  color: #2e8b57;
  background: #f0fdf4;
  padding: 8px 12px;
  border-radius: 4px;
  margin-top: 10px;
  display: inline-block;
}

Optional: Make It Conditional

Want to show delivery only for certain categories?


if ( has_term( 'shirts', 'product_cat' ) ) {
    // Output delivery estimate
}

Bonus: Show Different Dates Based on Shipping Zones

This requires accessing customer IP or using checkout info — best handled with a plugin or AJAX. But a simple approach is to show region-specific messages like:


if ( WC()->customer->get_shipping_country() == 'US' ) {
    echo 'Estimated Delivery: 3–5 business days';
} else {
    echo 'Estimated Delivery: 7–14 days (international)';
}

Note: This only works when the customer has entered a shipping address or logged in.


Conclusion

Adding estimated delivery dates to WooCommerce product pages is a subtle but powerful conversion booster. It sets clear expectations and improves customer trust.

With a bit of PHP and CSS, you can tailor this message to your store’s shipping rules — without needing another plugin.