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.
Where the code goes
- Go to Online Store > Themes > Customize and switch to the default product template.
- In the product information section, click Add block and pick Custom Liquid.
- Paste one of the snippets below, then drag the block under the price or the Add to cart button. Save.
- Online Store
- Themes
- Customize
- Product template
- Add block
- Custom Liquid
Then paste the snippet and save
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
- Go to Settings > Metafields and metaobjects > Products and add three definitions of type Integer:
custom.processing_days,custom.delivery_minandcustom.delivery_max. - 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.
- Leave the rest empty and they use the defaults.
For how to pick the numbers, see our guides to processing time and delivery time.