Add Estimated Delivery Date in WooCommerce (No Plugin)

Shoppers ask one question before they buy: when will this reach me? WooCommerce leaves that answer to you, so this guide shows you how to add an estimated delivery date in WooCommerce without a plugin, using a small PHP snippet you control. The finished product page shows a clear delivery window based on your cutoff time, processing days, and transit days.
You will build the estimate in two stages. Method 1 adds one storewide rule that works for most products. Method 2 adds a per product processing time for items that need longer preparation. Both methods skip weekends, respect your store timezone, and stay silent on virtual and downloadable products where delivery dates make no sense.
Why Does WooCommerce Need a Custom Delivery Estimate?
WooCommerce has no native delivery estimate feature. Shipping methods carry a title and a cost, and nothing in the default settings converts those methods into a calendar date for the shopper. A method named Standard Shipping tells the customer almost nothing about arrival timing, so shoppers either guess or message your support inbox before ordering.
Vague text performs poorly against a real date. A line saying delivery takes 3 to 5 business days forces the shopper to count days, guess whether weekends count, and wonder when counting starts. A real date range removes that mental work. Shoppers plan around a date, for example a birthday or a trip, and a clear window reduces messages asking where an order is after purchase. The WooCommerce developer documentation confirms that delivery presentation is left to themes, extensions, and custom code.
A delivery estimate also works well beside your other conversion helpers. Pair it with a free shipping progress bar and shoppers see both the cost threshold and the arrival window before checkout.
What Rules Should Sit Behind the Date?
A trustworthy estimate comes from simple rules applied consistently. Write your rules down before touching code, because the snippet only automates the rules you choose. Most stores need four values, and each one maps directly to a variable in the code below.
- Daily order cutoff time: orders placed before the cutoff start processing the same day, and later orders start the next business day.
- Processing days: the business days your team needs to pack and hand the parcel to the courier.
- Transit days: the business days the courier needs after dispatch, expressed as a minimum and a maximum.
- Business days only: Saturdays and Sundays never count, because packing teams and most couriers pause on weekends.
Show a date range rather than one fragile single date. A single date looks precise, yet one courier delay turns it into a broken promise. A range such as Monday, December 7 to Wednesday, December 9 sets an honest window and absorbs normal transit variation.
How Do You Add the Estimate With a Small Snippet?
Method 1 hooks into the product page after the add to cart form, calculates the window, and prints one line under the button. Add the code to a child theme functions.php file or a small custom plugin. Never edit WooCommerce plugin files directly, because updates will erase your changes. Take a backup first, and test on staging when you have it.
add_action('woocommerce_after_add_to_cart_form', 'vutg_estimated_delivery');
function vutg_add_business_days($timestamp, $days, $holidays) {
while ($days > 0) {
$timestamp = strtotime('+1 day', $timestamp);
$day_number = (int) date('N', $timestamp);
$ymd = date('Y-m-d', $timestamp);
if ($day_number < 6 && !in_array($ymd, $holidays, true)) {
$days--;
}
}
return $timestamp;
}
function vutg_estimated_delivery() {
global $product;
if (!$product || $product->is_virtual() || $product->is_downloadable()) {
return;
}
$cutoff_hour = 14;
$processing_days = 1;
$transit_min = 2;
$transit_max = 4;
$holidays = array('2026-12-25', '2027-01-01');
$now = current_time('timestamp');
$hour = (int) current_time('H');
$start = strtotime(date('Y-m-d', $now));
if ($hour >= $cutoff_hour) {
$start = strtotime('+1 day', $start);
}
$dispatch = vutg_add_business_days($start, $processing_days, $holidays);
$earliest = vutg_add_business_days($dispatch, $transit_min, $holidays);
$latest = vutg_add_business_days($dispatch, $transit_max, $holidays);
$from = date_i18n('l, F j', $earliest);
$to = date_i18n('l, F j', $latest);
echo '<p class="vutg-delivery-estimate">Order today before 2:00 PM, estimated delivery ' . esc_html($from) . ' to ' . esc_html($to) . '.</p>';
}
The printed line reads like this example: Order today before 2:00 PM, estimated delivery Monday, December 7 to Wednesday, December 9. The wording stays fixed while the dates move with the calendar, the cutoff, and your rule values. Style the vutg delivery estimate class in your theme CSS to match your product page typography.
Each value has a clear job. The cutoff hour uses 24 hour time, so 14 means 2:00 PM in your store timezone. The processing days value counts business days before dispatch. The transit minimum and maximum values shape the window width. The helper function counts only days that are neither weekend days nor listed holidays. Date output uses date_i18n so day and month names follow your site language, and the date_i18n reference explains its format options.
The virtual and downloadable check matters more than it looks. Digital products ship instantly, and a delivery window under a download button confuses buyers and generates support tickets. The early return keeps those pages clean. If your theme places the hook in an awkward spot, the woocommerce_single_product_summary hook offers an alternative position inside the summary column.
How Do You Set Processing Time Per Product?
Method 2 handles products that need longer preparation, such as made to order items, printed goods, or items stocked at a second location. A single storewide processing value overpromises on those products. The fix adds a number field to the product edit screen, saves the value as product meta, and reads it inside the estimate calculation.
add_action('woocommerce_product_options_general_product_data', 'vutg_processing_field');
function vutg_processing_field() {
woocommerce_wp_text_input(array(
'id' => '_vutg_processing_days',
'label' => 'Processing days',
'type' => 'number',
'custom_attributes' => array('min' => '0', 'step' => '1'),
'description' => 'Business days before dispatch for this product.',
));
}
add_action('woocommerce_process_product_meta', 'vutg_save_processing_field');
function vutg_save_processing_field($post_id) {
if (isset($_POST['_vutg_processing_days'])) {
update_post_meta($post_id, '_vutg_processing_days', absint($_POST['_vutg_processing_days']));
}
}
Now replace the fixed processing value in Method 1 with a meta lookup. Read the saved value for the current product, and fall back to your storewide default when the field is empty or zero. Products with a saved value show longer estimates automatically, while standard products keep the default rule.
$processing_days = (int) get_post_meta($product->get_id(), '_vutg_processing_days', true);
if ($processing_days <= 0) {
$processing_days = 1;
}
Set the field only where preparation genuinely differs. A handmade item might need 4 processing days, while a stocked item keeps the default of 1. Review these values whenever your packing workflow changes, because stale processing values quietly produce wrong promises on your highest value products.
How Do Holidays and Cart Messages Keep the Promise Consistent?
Holidays break naive date math, because a warehouse closure day looks like a normal weekday to simple code. The holidays array in Method 1 solves this with a small list of closure dates. The helper function skips those dates exactly as it skips weekends. Add public holidays and planned closures at the start of each season, and remove past dates during routine maintenance.
Repeat the promise in the cart so the estimate stays consistent from product page to checkout. A short note above the cart table reassures shoppers at the moment they review totals. The snippet below prints a general window using your default values. Stores with mixed processing times can keep the wording general and point shoppers back to each product page for item level dates.
add_action('woocommerce_before_cart', 'vutg_cart_delivery_note');
function vutg_cart_delivery_note() {
$holidays = array('2026-12-25', '2027-01-01');
$now = current_time('timestamp');
$hour = (int) current_time('H');
$start = strtotime(date('Y-m-d', $now));
if ($hour >= 14) {
$start = strtotime('+1 day', $start);
}
$dispatch = vutg_add_business_days($start, 1, $holidays);
$earliest = vutg_add_business_days($dispatch, 2, $holidays);
$latest = vutg_add_business_days($dispatch, 4, $holidays);
echo '<p class="vutg-delivery-estimate">Estimated delivery ' . esc_html(date_i18n('l, F j', $earliest)) . ' to ' . esc_html(date_i18n('l, F j', $latest)) . ' for in stock items.</p>';
}
Consistency also means your other cart rules should not contradict the delivery line. If you use a minimum order amount or a continue shopping button, keep the cart layout tidy so the delivery note stays visible.
How Do You Stay Honest About Delivery Times?
Only promise what your courier actually delivers. Measure real transit times from recent orders before choosing your minimum and maximum values, and prefer a slightly wider window over an optimistic narrow one. When courier performance changes during sale seasons or weather disruptions, update the numbers the same week. An estimate is a promise, and a broken promise costs more than a cautious window ever will.
Pakistan stores using cash on delivery need extra care here. Couriers commonly take 2 to 4 working days in major cities, and remote areas often need longer. A single nationwide window either overpromises to remote customers or undersells fast city delivery. Widen the maximum, mention city based variation in your shipping policy, and read our cash on delivery guide for WooCommerce for payment side setup that matches these delivery realities.
Keep the whole store fast enough that estimates load instantly. Date math in PHP costs almost nothing, yet slow hosting delays every product page around it. A reliable plan from our web hosting guide keeps product pages, cart, and checkout responsive during traffic spikes.
How Do You Test the Estimate Before Launch?
Testing protects you from the two classic failures: weekend orders promising impossible dates, and digital products showing delivery text. Run through this checklist on staging first, then repeat the key checks on the live store after deployment.
- View a standard product before the cutoff and confirm the window counts from today.
- View the same product after the cutoff and confirm dispatch moves one business day later.
- Simulate a weekend order and confirm dispatch rolls forward to Monday.
- Open a virtual or downloadable product and confirm no estimate appears.
- Set a longer processing value on one product and confirm its window moves later.
- Add a near holiday date temporarily and confirm the window skips it.
- Place test orders at different times and compare the shown window with your manual count.
Recheck the estimate after theme updates, WooCommerce updates, and timezone changes. A monthly spot check of two product pages and the cart keeps the promise accurate with almost no effort.
Frequently Asked Questions
Does WooCommerce show delivery dates by default?
No. Default shipping methods carry a title and a cost only, with no calendar calculation. A snippet or extension must convert your cutoff, processing, and transit rules into dates, which is exactly what the code in this guide does.
Why show a date range instead of one exact date?
Courier transit varies by city, weather, and season, so one exact date breaks easily. A range sets an honest window shoppers can plan around, and it absorbs normal delays without turning your estimate into a broken promise.
How do weekend orders behave with this snippet?
The helper function counts business days only, so a Saturday or Sunday order rolls dispatch forward to Monday before transit days are added. Holidays listed in the array are skipped the same way, keeping weekend and closure handling consistent.
Can different products show different delivery windows?
Yes. Method 2 adds a processing days field to each product edit screen and saves it as product meta. The estimate reads that value per product, so made to order items show longer windows while stocked items keep your storewide default.
Last updated: December 2026.



