# Estimated Delivery Dates Above Checkout

> Shows "Estimated delivery: Tue 4 - Thu 6 Nov" at the top of the checkout page, counting only working days from today.

- Type: PHP
- Runs: Woocommerce before checkout form
- Category: [WooCommerce](https://wpide.com/library/category/woocommerce/)
- Requires: WooCommerce
- Tags: woocommerce, checkout, delivery, shipping
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/woo-checkout-delivery-estimate/

## Code

```php
$min_days     = 2;                      // Fastest delivery, in working days.
$max_days     = 4;                      // Slowest delivery, in working days.
$working_days = array( 1, 2, 3, 4, 5 ); // 1 = Monday ... 7 = Sunday.

$add_working_days = function ( $days ) use ( $working_days ) {
    $date = new DateTime( 'now', wp_timezone() );

    while ( $days > 0 ) {
        $date->modify( '+1 day' );

        if ( in_array( (int) $date->format( 'N' ), $working_days, true ) ) {
            $days--;
        }
    }

    return $date;
};

$from = $add_working_days( $min_days );
$to   = $add_working_days( $max_days );

printf(
    '<p class="wpide-delivery-estimate" style="margin:0 0 20px;padding:12px 16px;border-radius:6px;background:#f6f7f7;">&#128230; Estimated delivery: <strong>%1$s &ndash; %2$s</strong></p>',
    esc_html( wp_date( 'D j M', $from->getTimestamp() ) ),
    esc_html( wp_date( 'D j M', $to->getTimestamp() ) )
);
```

## Notes

Set $min_days and $max_days to your usual delivery window in working days and adjust $working_days.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Estimated Delivery Dates Above Checkout" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
