All guides › Delivery estimate on the cart page
Estimated delivery date on the Shopify cart page, based on the slowest item
Disclosure: I build No-App Sections; this guide was written with AI assistance. The code on this page was written for this guide. It passes Shopify's Theme Check inside Dawn 16.0.0 and automated tests in headless Chrome, run against Dawn's own cart and variant events with mocked store data. It hasn't been run on a live store yet, so try it on a duplicate theme first.
Product-page delivery dates answer "when will this arrive?". In the cart, the question becomes "when will my order arrive?", and with one made-to-order item in a basket of in-stock ones, the answer is the slowest item's date. This guide adds that single estimate under Dawn's cart subtotal, so it's the last thing shoppers read before checkout.
How the date is worked out
- Find the slowest item. Liquid loops through the cart and reads each product's processing days from the metafield
custom.processing_days(a whole number). Products without it use a default. Items that don't need shipping (e.g. digital products and gift cards) are skipped. - Find "today" in your time zone. The browser works out the date and hour in the store's time zone, not the shopper's, using
Intl.DateTimeFormat. A shopper in New York at 9pm is placing an order at 2am in London. - Apply the cutoff. At or after the cutoff hour, or on a weekend or closed date, the order counts from the next working day.
- Dispatch. 1 processing day means it leaves on that working day. 3 means it leaves 2 working days later.
- Transit. Add the courier's minimum and maximum working days for the earliest and latest date. Weekends and the closed dates are skipped here too, which suits courier services that don't deliver on bank holidays.
Example: with the settings in the code, an order on Friday 18 December 2026 at 2pm (after the 1pm cutoff), where the slowest item needs 2 processing days, starts on Monday 21st and is dispatched on Tuesday 22nd. It shows "Estimated delivery: between Wed 23 Dec and Tue 29 Dec". Christmas Day and the 28th are skipped.
The snippet
Settings are at the top: your time zone (IANA name, like Europe/London), cutoff hour, default processing days, transit range, and closed dates as YYYY-MM-DD separated by commas.
{%- comment -%}
snippets/cart-delivery-estimate.liquid: delivery estimate for the whole cart, based on its slowest item.
Optional product metafield (integer): custom.processing_days. Products without it use default_processing.
Settings: your store's IANA time zone, the daily dispatch cutoff (24h clock), and courier transit days.
{%- endcomment -%}
{%- liquid
assign store_timezone = 'Europe/London'
assign cutoff_hour = 13
assign default_processing = 1
assign transit_min = 1
assign transit_max = 3
assign closed_dates = '2026-12-25,2026-12-28,2027-01-01'
assign slowest_days = 0
assign slowest_title = ''
for item in cart.items
if item.requires_shipping == false
continue
endif
assign days = item.product.metafields.custom.processing_days.value | default: default_processing | plus: 0
if days > slowest_days
assign slowest_days = days
assign slowest_title = item.product.title
endif
endfor
-%}
{%- if slowest_days > 0 -%}
<delivery-estimate
class="delivery-estimate"
data-tz="{{ store_timezone }}"
data-cutoff="{{ cutoff_hour }}"
data-processing="{{ slowest_days }}"
data-transit-min="{{ transit_min }}"
data-transit-max="{{ transit_max }}"
data-closed="{{ closed_dates }}"
>
<p class="delivery-estimate__line">
Dispatched within {{ slowest_days }} working day{% if slowest_days != 1 %}s{% endif %}
</p>
{%- if cart.items.size > 1 -%}
<p class="delivery-estimate__why">Based on the slowest item in your cart: {{ slowest_title | escape }}</p>
{%- endif -%}
</delivery-estimate>
{%- endif -%}
<script>
if (!customElements.get('delivery-estimate')) {
customElements.define('delivery-estimate', class extends HTMLElement {
/* Runs on first load AND every time Dawn re-renders the cart footer after a quantity change. */
connectedCallback() {
const d = this.dataset;
const closed = new Set(d.closed.split(',').map((s) => s.trim()).filter(Boolean));
const parts = Object.fromEntries(
new Intl.DateTimeFormat('en-GB', { timeZone: d.tz, year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', hourCycle: 'h23' })
.formatToParts(new Date())
.map((p) => [p.type, p.value])
);
/* Work with calendar dates in the store's time zone, stored as UTC midnight to avoid DST drift. */
let day = new Date(Date.UTC(+parts.year, +parts.month - 1, +parts.day));
const iso = (dt) => dt.toISOString().slice(0, 10);
const workingDay = (dt) => dt.getUTCDay() !== 0 && dt.getUTCDay() !== 6 && !closed.has(iso(dt));
const addWorkingDays = (start, n) => {
const dt = new Date(start);
while (n > 0) {
dt.setUTCDate(dt.getUTCDate() + 1);
if (workingDay(dt)) n--;
}
return dt;
};
/* An order placed after the cutoff or on a closed day counts from the next working day. */
if (!workingDay(day) || +parts.hour >= +d.cutoff) day = addWorkingDays(day, 1);
const dispatch = addWorkingDays(day, +d.processing - 1);
const earliest = addWorkingDays(dispatch, +d.transitMin);
const latest = addWorkingDays(dispatch, +d.transitMax);
const fmt = new Intl.DateTimeFormat('en-GB', { timeZone: 'UTC', weekday: 'short', day: 'numeric', month: 'short' });
this.querySelector('.delivery-estimate__line').textContent =
iso(earliest) === iso(latest)
? 'Estimated delivery: ' + fmt.format(earliest)
: 'Estimated delivery: between ' + fmt.format(earliest) + ' and ' + fmt.format(latest);
}
});
}
</script>
Why a custom element?
When a shopper changes a quantity, Dawn re-renders the cart footer's .js-contents area by replacing its HTML. Ordinary inline scripts in replaced HTML don't run again, but a custom element's connectedCallback does run each time the element is put into the page. So the estimate is recalculated after every cart change, with the new slowest item that Liquid has just rendered. The dates are handled as calendar days at UTC midnight, so the clocks changing can't shift a date by one.
Install it in Dawn's cart footer
- Duplicate your theme. In Online Store → Themes, duplicate your theme. Click … → Edit code on the copy.
- Create the snippet. In snippets, click Add a new snippet, name it
cart-delivery-estimate, paste the code above, and set your time zone, cutoff, transit days and closed dates. Save. - Render it in the cart footer. Open
sections/main-cart-footer.liquid. Find the<div class="js-contents"line in the subtotal block, and just before that div's closing</div>, add{% render 'cart-delivery-estimate' %}. Save. - Test on the cart page. Preview the copy, add products with different processing days, change quantities and remove lines. The estimate should follow the slowest remaining item.
Setting processing days per product
In Settings → Custom data → Products, add a definition: name "Processing days", namespace and key custom.processing_days, type Integer. Then set, for example, 5 on made-to-order products. Everything else uses default_processing.
Keep it honest
- Say "estimated", as the snippet does. The shipping method the customer picks at checkout is what you've actually promised.
- Update
closed_datesbefore each holiday season. The example covers UK Christmas 2026 and New Year 2027. Bank holidays like Boxing Day fall on 28 December in 2026 because the 26th is a Saturday. - If your transit times change in peak season, widen
transit_maxin December rather than letting the estimate be optimistic.
Other themes
The snippet is plain Liquid plus a standard custom element, so it renders in any theme. Where you put the render line is the theme-specific part: in other themes, find the element that contains the subtotal and gets re-rendered after cart changes. If you put it somewhere that isn't re-rendered, it's still correct on page load but won't follow quantity changes. I haven't tested it inside Dawn's cart drawer, only on the cart page.
Delivery dates on the product page as well?
The Estimated delivery section shows a date range under the buy button, with a live "order within" countdown to your cutoff. You set the time zone, dispatch days, handling and transit days, Saturday delivery, closed dates and an optional Christmas line, all in the theme editor. It's a product-page section with one handling time for the store, so it doesn't read the cart. Use the snippet above for the cart. £12 one-off, for one store, tested on Dawn and Horizon. Other Online Store 2.0 themes may need small style tweaks.
FAQ
Why the slowest item and not each item's own date?
Most stores ship an order in one parcel, when everything is ready. If you split shipments, a per-line date is more accurate. That means rendering the snippet logic inside each cart line instead.
Does it use the shopper's time zone?
No, it uses yours, because your cutoff is in your time zone. Dates are shown as calendar dates, so they read correctly anywhere.
What if every item is digital?
Items with requires_shipping false are skipped. If nothing needs shipping, no estimate is shown.
Why do I need to edit a theme file here?
Dawn's cart footer has no Custom Liquid block, and the estimate needs to be inside the part Dawn re-renders, so it follows quantity changes. The edit is one line.
Will a theme update remove it?
Updating Dawn replaces main-cart-footer.liquid, so re-add the one render line after an update. The snippet file itself is kept.