Skip to content
Guides

Shopify estimated delivery date code, no app needed.

Paste one Custom Liquid block into your product template. Liquid alone prints a fixed range. Add the short script below and you get business days, processing time and a daily cutoff countdown.

Published 2026-11-25. Code tested November 25, 2026.

The finished line reads like this, worked out from today: Order within 11h 58m, arrives Thu, Dec 10 – Mon, Dec 14. That is 1 processing day, 2 to 4 delivery days, a 5 PM cutoff and weekends off, the defaults in the code below. On a day you don’t ship, the code leaves out the “Order within” part.

Canvas backpack $89.00 Arrives Thu, Dec 10 – Mon, Dec 14.
What the Option 2 snippet prints under the price, worked out from today.

Where the code goes

  1. Go to Online Store > Themes > Customize and switch to the default product template.
  2. In the product information section, click Add block and pick Custom Liquid.
  3. Paste one of the snippets below, then drag the block under the price or the Add to cart button. Save.
  1. Online Store
  2. Themes
  3. Customize
  4. Product template
  5. Add block
  6. Custom Liquid

Then paste the snippet and save

The path to a Custom Liquid block in the theme editor.

This works in Dawn and most free Shopify themes, and you don’t edit any theme files. Back up your theme first anyway (in Online Store > Themes, the … menu > Duplicate).

Option 1: Liquid only, a fixed range

The simplest version. It adds 3 and 7 calendar days to today and prints both dates.

{%- assign now_s = 'now' | date: '%s' | plus: 0 -%}
{%- assign from_s = 86400 | times: 3 | plus: now_s -%}
{%- assign to_s = 86400 | times: 7 | plus: now_s -%}
<p class="eta-line">Arrives {{ from_s | date: '%a, %b %-d' }} – {{ to_s | date: '%a, %b %-d' }}</p>

What it can’t do:

  • It counts calendar days, so Saturday and Sunday count as delivery days.
  • There is no cutoff: an order at 11 PM gets the same date as one at 9 AM.
  • “Today” is when Shopify rendered the page, and pages can be cached, so the date can be a day behind.

Good for a store that ships slowly and only wants a rough range.

Option 2: business days, processing time and a cutoff

This version runs in the shopper’s browser, so the date is always current. It:

  • starts from today, or tomorrow once your daily cutoff has passed,
  • adds processing days, then minimum and maximum delivery days,
  • skips the weekdays you don’t work (Saturday and Sunday by default),
  • shows “Order within Xh Ym” until the cutoff, and drops it on days you don’t ship,
  • uses your store’s time zone, which Liquid prints into the block, not the shopper’s,
  • reads optional per-product numbers from metafields and hides itself when the product is sold out.
{%- if product.selected_or_first_available_variant.available -%}
<p class="eta-line"
  data-proc="{{ product.metafields.custom.processing_days.value | default: 1 }}"
  data-min="{{ product.metafields.custom.delivery_min.value | default: 2 }}"
  data-max="{{ product.metafields.custom.delivery_max.value | default: 4 }}"
  data-cutoff="17" data-offset="{{ 'now' | date: '%z' }}"></p>
<script>
(function () {
  var s = document.currentScript, el = s && s.previousElementSibling;
  if (!el || !el.hasAttribute('data-cutoff')) el = document.querySelector('.eta-line[data-cutoff]:not([data-eta-on])');
  if (!el) return;
  el.setAttribute('data-eta-on', '');
  var OFF = [0, 6]; // days you don't ship or deliver: 0 = Sunday, 6 = Saturday
  var D = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];
  var M = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
  function isOff(d) { return OFF.indexOf(d.getUTCDay()) > -1; }
  function add(from, n) {
    var d = new Date(from);
    while (isOff(d)) d.setUTCDate(d.getUTCDate() + 1);
    while (n > 0) { d.setUTCDate(d.getUTCDate() + 1); if (!isOff(d)) n--; }
    return d;
  }
  function fmt(d) { return D[d.getUTCDay()] + ', ' + M[d.getUTCMonth()] + ' ' + d.getUTCDate(); }
  function show() {
    if (OFF.length >= 7) return;
    var z = el.dataset.offset || '+0000', sign = z[0] === '-' ? -1 : 1;
    var shop = new Date(Date.now() + sign * (z.slice(1, 3) * 60 + +z.slice(3, 5)) * 60000);
    var cut = new Date(shop);
    cut.setUTCHours(+el.dataset.cutoff, 0, 0, 0);
    if (cut <= shop) cut.setUTCDate(cut.getUTCDate() + 1);
    var min = Math.max(0, +el.dataset.min), max = Math.max(min, +el.dataset.max);
    var ship = add(cut, Math.max(0, +el.dataset.proc));
    var secs = isOff(cut) ? 0 : Math.floor((cut - shop) / 1000);
    var h = Math.floor(secs / 3600), m = Math.floor(secs % 3600 / 60);
    el.innerHTML = (secs > 0 ? '<span>Order within ' + h + 'h ' + (m < 10 ? '0' : '') + m + 'm,</span> <span>arrives ' : '<span>Arrives ') +
      fmt(add(ship, min)) + ' – ' + fmt(add(ship, max)) + '</span>';
  }
  show();
  setInterval(show, 60000);
})();
</script>
{%- endif -%}

Change these to your own:

  • data-cutoff="17": your daily cutoff hour, 0 to 23, in the store’s time zone. 17 is 5 PM.
  • OFF = [0, 6]: the days you don’t ship or deliver. Add 5 to skip Fridays too.
  • The default: numbers: processing days, minimum and maximum delivery days for products without metafields.

Processing 0 means it ships the same day before the cutoff. If the maximum is lower than the minimum, the code uses the minimum for both, so a typo never prints a backwards range.

A delivery time per product

  1. Go to Settings > Metafields and metaobjects > Products and add three definitions of type Integer: custom.processing_days, custom.delivery_min and custom.delivery_max.
  2. Fill them in on the products that differ: 10 processing days for a made-to-order item, 0 for stock you ship the same day.
  3. Leave the rest empty and they use the defaults.

For how to pick the numbers, see our guides to processing time and delivery time.

Show it on two lines

The script wraps the countdown and the date in their own spans. Add this to the same Custom Liquid block inside <style> tags, or to your theme’s custom CSS, to put them on two lines:

.eta-line span { display: block; }
.eta-line span:first-child { font-weight: 600; }

Only for in-stock products

Option 2 already starts with this check. To show a different line when the product is sold out:

{%- if product.selected_or_first_available_variant.available -%}
  ...the delivery line...
{%- else -%}
  <p class="eta-line">Out of stock. We'll show a date when it's back.</p>
{%- endif -%}

The check runs when Shopify renders the page, for the selected or first available variant. In many themes, switching to a sold-out variant doesn’t re-run a Custom Liquid block, so the line stays until the page reloads. Hiding it on variant change needs extra script tied to your theme’s variant events.

Common mistakes

  • The wrong time zone. A script that reads only new Date() uses the shopper’s clock, so a shopper in another country sees your cutoff at the wrong hour. The code above reads the store’s offset from Liquid. Daylight saving changes it twice a year, and a cached page can keep the old offset for a while.
  • A date printed by Liquid alone. It is frozen at render time and can be cached, so it lags.
  • Forgetting holidays. The code skips weekdays, not single dates like December 25.
  • Promising transit time only. Delivery time is processing plus transit. Leave processing days at 0 only if you really ship the same day.
  • Two blocks on one page. If you add the block twice, both work, but check that they show the same date.

What the code can’t do, and when an app is worth it

The code shows one store-wide set of rules plus per-product numbers. It doesn’t do collection rules, a different date per country, a live preview, designs or dates in the cart, and you maintain it through theme changes.

If you need those, ETA Bird does the same maths without code: processing days 0 to 30, delivery days, weekly days off and a daily cutoff with a countdown, with rules by product, collection and country. Shoppers’ country comes from Shopify Markets, with geolocation as a fallback, and the date can show in the cart too. See how ETA Bird shows the date. For all the ways to add a date, code or not, see how to add an estimated delivery date in Shopify.

Questions

Can I add an estimated delivery date to Shopify without an app?

Yes. Paste a Custom Liquid block into your product template. Liquid alone can print a fixed range of calendar days. A short script can skip weekends, add processing days and roll to the next day after a cutoff.

Where do I paste estimated delivery date code in Dawn?

Online Store > Themes > Customize, open the product template, click Add block in the product information section and pick Custom Liquid. Paste the code there and drag the block under the price or the Add to cart button. No theme file edits.

Why does my estimated delivery date show the wrong day?

Usually the time zone or the cache. Liquid prints the date when Shopify renders the page, and the page can be cached, so a Liquid-only date can lag. A script that runs in the browser is current, but it has to know your store’s time zone, which the code above reads from Liquid.

How do I show the delivery date on two lines?

Wrap each part in its own span and add CSS that sets the spans to display: block, as in the two-line example above.

How do I show the delivery date only for in-stock products?

Wrap the block in an if on product.selected_or_first_available_variant.available. In many themes that check only runs when the page loads, so switching to a sold-out variant won’t hide the line without more script.

Does this code handle holidays?

No. It skips the weekdays in the OFF list only. For single holiday dates you would add a list of dates and skip them in the add function.

Can I give each product its own delivery time?

Yes. Add Integer product metafields called processing_days, delivery_min and delivery_max in the custom namespace and fill them in per product. The code falls back to 1, 2 and 4 when a product has none.

Free for 7 days · No code

Give every product a date.

Set one rule and the delivery date shows up on every product page. It takes a few minutes.

★★★★★ 5.0 on the Shopify App Store · $4.99 a month after the trial
Dec
14
Arrives Monday
Order within 11:58:40
Arrives by Mon, Dec 14