Engineering · EU Omnibus Directive
One metafield per variant: the most cost-efficient way to show Omnibus prices on Shopify
The rule, in one paragraph
Since 28 May 2022, any shop that announces a price reduction to consumers in the EU must show the prior price: the lowest price it charged for that product in at least the 30 days before the reduction. That is Article 6a of the Price Indication Directive 98/6/EC, added by the “Omnibus” Directive (EU) 2019/2161. A crossed-out price on its own no longer counts, and a reduction must be measured from the real prior price, not from whatever the shop chooses to cross out.
For a Shopify store this is a data problem before it is a display problem. Shopify knows today's price and today's compare-at price. It does not keep the history the rule asks about. So an app has to record that history, and then get the answer onto the product page. How it does the second part decides most of what the app costs you.
Three ways to get the answer onto the page
1. Ask a server on every page view
The theme loads a script that calls the app's servers for each product a shopper opens. It is simple to build. But every product view now waits on someone else's server, the app pays to answer every one of those calls, and if that server is slow or down, the prior price is slow or missing on your page.
2. Write the answer into the product
The app works out the lowest 30-day price each night and writes it into a metafield. The page just reads a number. Better, but that number is only true on the day it was computed. As the window slides, old prices fall out of it and the answer changes even when your prices do not, so the app has to keep rewriting. Miss a run and the page shows yesterday's answer. Store a day-by-day record instead, to let the page compute, and you are writing kilobytes per variant, often spread over several fields.
3. Publish the evidence, and derive the answer
Record only the changes to a price, never a price per day, and publish them in one compact field per variant. The theme block works out the answer for today's date as the page loads, from data that is already on the page. This is what we built.
A variant whose price has not moved in six months takes almost no space at all.
What it means for one product
Say a sweater sold at €49.90 from 14 October, and on 20 November you cut it to €39.90, showing €59.90 crossed out. The app has recorded two changes, each once, and written nothing on any of the days in between.
When a shopper opens the product, the block works out that the lowest price in the 30 days before the reduction was €49.90. That is what the shopper sees, and the reduction reads −20%, not the −33% that the crossed-out price would suggest. A discount code that lowers what a customer could actually pay is recorded the same way, and each extra market keeps its own history, in its own currency, in the same field. A typical variant's field is about 100 bytes.
Why this is the most cost-efficient approach
Cost here means three things: what the app does to your store, what it does to your storefront, and what it costs to run, which is what you end up paying.
Writes follow your prices, not your catalogue
Because the field holds changes, it changes only when a price does. On a day when nothing moved, the app writes nothing to your store at all. The only other write is housekeeping: when an old change ages out of the 90 days the field carries by default.
Take an illustrative store with 20,000 variants, where 2% of prices change on a given day:
| Approach | Writes that day | On a day nothing changed |
|---|---|---|
| Daily rewrite of every variant | 20,000 | 20,000 |
| A stored answer, kept current | 400, plus every variant whose old low aged out | Still every variant whose old low aged out |
| Price history in one metafield | About 400 | None |
And those writes go to Shopify as a single bulk job rather than thousands of separate calls, so a large catalogue is no harder on your store than a small one.
Nothing for the storefront to wait for
The block reads a metafield that Shopify already renders into the product page, and adds under 10 KB of script. It makes no network request, so there is no round trip on any product view and nothing that depends on our servers being up. Your page speed, and the Core Web Vitals that go with it, are not ours to spend.
Cheap to run, so cheap to buy
An app that answers every page view, or rewrites the whole catalogue nightly, pays for that work and passes it on. Ours does neither, which is why EU Omnibus Compliance is free up to 100 variants, starts at $9.99 a month, and puts no catalogue charge on the first 10,000 variants.
Light is not enough: it also has to be right
A cheap wrong answer is still a wrong answer on a legal notice. Three cases decide whether an Omnibus price is correct:
- A sale in progress. The prior price is the lowest of the 30 days before the sale began. Measure from today instead and, a few weeks into a sale, you quote the sale price back to the shopper as its own reference.
- Discounts. An automatic discount or a code changes what a customer could actually pay. We record it, so you can choose to publish that price.
- Markets. A shop selling in several countries has a price history per market and currency. Each gets its own prior price.
There is one more rule we hold ourselves to: one implementation of the directive. The storefront block, the merchant's admin and our pipeline all run the same calculation, built from the same code. The number a shopper sees cannot drift away from the number we reasoned about, because there is only one place it is worked out.
Why we call it state of the art
We would hold any Omnibus app, including ours, to this checklist:
- Does it write to your store only when a price actually changes?
- Does your product page work without calling the app's servers?
- Is the prior price still right tomorrow if the app does not run tonight?
- Is a sale measured from the 30 days before it began?
- Are discount codes, automatic discounts and markets included?
EU Omnibus Compliance answers yes to all five. We know of no lighter way to meet the rule on Shopify, and we built it that way on purpose: it is the best approach we know, for the merchant and for the shopper.
Questions people ask
What is the most cost-efficient way to show the Omnibus 30-day lowest price on Shopify?
Publish each variant's price changes, compactly, in one metafield, and let the theme work out the lowest prior price for today's date as the page loads. Writes then scale with the prices that actually move rather than with the size of the catalogue, and the storefront makes no call to the app's servers.
Why not just store the lowest 30-day price in a metafield?
Because that number is only right for the day it was computed. As the window moves, an old low price drops out and the number has to be rewritten, and a missed run leaves a stale price on the page. A history stays right as the days pass.
Does a theme block that calculates the price slow down a Shopify store?
Not when it is built for it. Ours reads a metafield already on the product page, adds under 10 KB of script and makes no network request, so there is no round trip to wait for.