Magento 1 / OpenMage
Install and configure the VerifyID age verification module for Magento 1.9.4 and OpenMage LTS, with MitID and BankID.
Overview
The VerifyID module for Magento 1 and OpenMage adds age verification with MitID (Denmark) and BankID (Sweden). Shoppers verify their age before checkout in the VerifyID card, which covers the page, and the module checks the verification again on the server when the order is placed, so an unverified age-restricted order cannot be placed through any checkout. It has the same rules, card and texts as the Magento 2 module.
| Item | Value |
|---|---|
| Module | VerifyID_AgeVerification (code pool community) |
| Composer package | verifyid/magento1-age-verification (type magento-module) |
| Version | 1.0.0 |
| Languages | Danish, Swedish, Norwegian (Bokmål), English, with a language switch in the verification card |
| Download | verifyid-magento1.zip on the Plugin page of the VerifyID Dashboard |
| Licence | Proprietary licence from VerifyID ApS (LICENSE.txt in the zip) |
The module rewrites no core class. It works through events, layout updates and configuration only, so it does not conflict with other extensions' rewrites. It calls the VerifyID API for you: you do not need the API endpoints from the other pages of these docs.
Requirements
| Component | Requirement |
|---|---|
| Magento | OpenMage LTS 20.x, or Magento 1.9.4.x and OpenMage LTS 19.x (tested: OpenMage 20.18.0 and OpenMage 19.5.3; Magento Open Source 1.9.4.x runs the same code paths but was not tested separately). Earlier Magento 1 versions are not supported |
| PHP | 8.1 – 8.3 with OpenMage 20 (tested on 8.2); 7.4 with Magento 1.9.4.x / OpenMage 19 (tested on 7.4.33). PHP 7.3 and older are not supported |
| VerifyID | An active VerifyID subscription and the plugin key from the VerifyID Dashboard |
| Server | Outbound HTTPS (port 443) to app.verifyid.dk, the storefront served over HTTPS, Magento cron running (cron.sh or cron.php) |
| Themes | Any theme that falls back to base/default and renders the standard before_body_end block (rwd and the legacy default theme do). Tested with rwd |
| Database | MySQL 5.6+ or MariaDB 10.x |
Installation
Install the module one way only: the zip, modman or Composer. Run every command from the Magento root as the user that owns the Magento files (the user that runs Magento's cron, not root).
Live stores: use a maintenance window and back up the database first. Installing adds columns to sales_flat_quote, sales_flat_order and sales_flat_order_grid. On a store with many orders this can take several minutes and locks those tables while it runs.
Magento 1.9.4 with compilation on (System › Tools › Compilation): run php shell/compiler.php disable before you copy the files and php shell/compiler.php compile at the end. OpenMage 20 has no compiler, so skip both there.
In the VerifyID Dashboard, open Plugin, choose the MitID Plugins or BankID Plugins tab and click Download on the Magento 1 / OpenMage card. Both tabs give the same file, verifyid-magento1.zip. It uses the Magento root layout and only adds new files (app/code/community/VerifyID/AgeVerification, app/etc/modules/VerifyID_AgeVerification.xml, layouts, templates, locale files, skin files and shell/verifyid.php).
cd /path/to/magento
# 1. pause Magento cron (comment out the cron.sh / cron.php line in the crontab), then:
touch maintenance.flag
# 2. copy the files
unzip /path/to/verifyid-magento1.zip
# 3. clear the cache
rm -rf var/cache/* var/full_page_cache/*
# 4. run the module's setup script
n98-magerun.phar sys:setup:run
# 5. end maintenance mode, then re-enable cron
rm maintenance.flagWithout n98-magerun, run step 4 as php -r 'require "app/Mage.php"; Mage::app("admin"); Mage_Core_Model_Resource_Setup::applyAllUpdates(); Mage_Core_Model_Resource_Setup::applyAllDataUpdates();'. With a Redis or Memcached cache backend, flush the cache in System › Cache Management instead of step 3.
Use the package zip verifyid-magento1-age-verification-1.0.0.zip (the module files plus modman and composer.json at its root).
cd /path/to/magento
modman init # only if the store has no .modman directory yet
mkdir -p .modman/VerifyID_AgeVerification
unzip /path/to/verifyid-magento1-age-verification-1.0.0.zip -d .modman/VerifyID_AgeVerification
modman deploy --copy VerifyID_AgeVerificationThen clear the cache and run the setup script as in the zip tab (steps 3 and 4). Use --copy: with symlinks, Magento 1 only renders the module's templates when Allow Symlinks is on, which Magento advises against on production stores.
For stores managed with Composer and magento-hackathon/magento-composer-installer (OpenMage 20 installed with Composer has it), with "magento-deploystrategy": "copy":
cd /path/to/project
mkdir -p artifacts
cp /path/to/verifyid-magento1-age-verification-1.0.0.zip artifacts/
composer config repositories.verifyid artifact ./artifacts
composer require verifyid/magento1-age-verification:1.0.0Then clear the cache and run the setup script as in the zip tab (steps 3 and 4). Commit composer.json, composer.lock and artifacts/ to your deployment repository.
To upgrade a zip install: maintenance mode on and cron paused, delete the module's files, unzip the new zip right away, clear the cache, run the setup script, then maintenance mode off and cron on. Never leave the store without the module's files while the module is installed (see Switching off or uninstalling). Always read the CHANGELOG first.
After installing
Log out of the admin and log in again
Magento 1 loads the permissions of a new configuration section only at login. Until then System › Configuration › VerifyID shows "Access denied" or a 404 page.
Connect your account
Add the plugin key and enable the module (Configuration). The module stays disabled until you enable it.
Register every storefront host
Add each host to your VerifyID account (Register your storefront domains).
Set ages
Set ages on products, categories, tags or a store default (Setting ages).
Check cron and test
Make sure Magento cron runs (the module adds verifyid_cleanup daily and verifyid_pending_holds every 15 minutes). If System › Index Management shows Category Flat Data as "Reindex Required", rebuild it. Then place one test order per storefront host with a real MitID or BankID. Each test is a billed verification.
Configuration
Open System › Configuration › VerifyID › Age Verification (shortcut: System › VerifyID Age Verification). Enable and the plugin key are set at Default Config or website scope; methods, texts and appearance can also be set per store view. Admin users with a restricted role need the VerifyID Age Verification resources under System › Permissions › Roles › Role Resources.
Plugin key
- Copy your plugin key from the VerifyID Dashboard.
- Paste it into Plugin Key, set Enable Age Verification to Yes and click Save Config.
- Click Test Connection. It checks the key and the account status without starting a verification, so nothing is billed. The result also lists the storefront hosts of this scope that you must register.
From the command line: php shell/verifyid.php ping (also free).
The plugin key works like a password to your VerifyID dashboard. The module stores it encrypted, never sends it to browsers and never writes it to a log. Do not email it or paste it into support tickets.
Main settings
| Setting | Default | Notes |
|---|---|---|
| MitID (Denmark) | Yes | Verifies 16+ and 18+ only |
| BankID (Sweden) | No | Verifies every age tier |
| Preferred Method | Automatic | The method named in the cart notice when both methods can verify the cart. It does not change the card: the card always shows a button for every method that can verify the cart, MitID first. |
| Store Default Age | None | Applies to products with no own, tag or category age |
| Tags Attribute | (none) | Product attribute holding tags such as 18+ or +18 |
| Verification Valid For (minutes) | 60 | How long a verification counts for the shopper's cart and browser session (15 – 1440) |
| Exempt Customer Groups | (none) | For example verified B2B groups. Guests can never be exempt. |
| Admin-created Orders | Skip and add an order comment | Or Require a valid verification |
| Skip Check for API Orders | Yes | Orders placed through the Magento API by an API user (ERP, POS, marketplaces) get an order comment instead |
| When VerifyID Is Unavailable | Block restricted orders | Fail closed (recommended). The alternative accepts and puts the order on hold for manual review. |
| Allow Self-declaration | No | For customers outside Denmark and Sweden; accepted only when the order is not delivered to a covered country |
| Checkout Gate Routes | checkout_onepage_index, checkout_multishipping_index | Pages that send shoppers with an unverified, age-restricted cart to the verification page first. Add the route of a one-step checkout extension here (for example onestepcheckout_index_index) |
| Verify on All Pages | No | A blocking overlay on every page until the visitor is verified |
Texts (per store view, plain text only), appearance (logo, colours, z-index and the language switch) and the start limits under Advanced can also be changed. Leave Advanced at its defaults unless VerifyID support asks otherwise.
Register your storefront domains
VerifyID only accepts verifications from hosts registered in your VerifyID account, and every verification start is billed, including starts that VerifyID refuses because the host is not registered.
Register every host where shoppers verify:
- each website's and store view's secure base URL host, with and without
www(for exampleshop.dk,www.shop.dk,shop.se,www.shop.se); - every staging or test host on which you use a live plugin key.
Shoppers return from MitID or BankID to https://your-host/verifyid/verify/return, and VerifyID checks that host. Test Connection lists the hosts it finds, but cannot confirm that they are registered: only a real (billed) verification can, so verify once yourself on each host after go-live.
If a host is not registered, VerifyID answers 403, the admin shows a notice naming the host, and the module pauses new verifications for that store view so the failures are not billed again and again. Register the host, then click Test Connection to end the pause.
MitID and BankID
| Cart requires | MitID | BankID |
|---|---|---|
| 16+ | Yes | Yes |
| 18+ | Yes | Yes |
| 19+, 20+, 21+, 23+, 25+ | No | Yes |
- MitID can only verify 16+ and 18+. When both methods are enabled, the card shows both buttons, MitID first. When the cart needs 19+ or more, the card shows only the BankID button, with one line saying that MitID can verify only 16+ and 18+.
- If only MitID is enabled and the cart needs more than 18+, the shopper cannot check out. Enable BankID or use 16+/18+ ages only. When you save the configuration, the admin warns you about ages above 18+ that no enabled method can verify.
- A verification counts only when the verified tier is at least the cart's requirement. If the shopper adds a product with a higher age, they verify again.
- The module stores only the tier (for example 18+), never the shopper's exact age, name or CPR/personal identity number.
What shoppers see
When a verification is needed, an opaque full-screen layer covers the shop and only the VerifyID card shows: the VerifyID logo (or yours), a title, a short text, two numbered steps and one full-width button per method. It is the card of the earlier VerifyID plugins, the same as in the Magento 2 module. The page stays loaded underneath, so the checkout carries on after the verification.
| Where | When | Can the shopper close it? |
|---|---|---|
Verification page /verifyid/verify/ | The checkout gate or the place-order check sends a shopper with an unverified, age-restricted cart here. Works without JavaScript. | No. A small back to cart link leads back to the cart. |
| Cart page and checkout | The shopper clicks the link in the cart notice, or opens the checkout page with an unverified cart | Yes, with × or Escape. The cart and checkout stay as they were. |
| Every page | Verify on All Pages is on and the visitor is not verified yet | No |
Buttons
| Methods enabled | Cart needs 16+ or 18+ | Cart needs 19+ to 25+ |
|---|---|---|
| MitID and BankID | MitID and BankID, MitID first | BankID only, with a line saying why MitID is missing |
| MitID only | MitID | No button: the shop cannot verify this cart |
| BankID only | BankID | BankID |
The order is always MitID, then BankID; Preferred Method does not change it. A method that VerifyID has paused after repeated errors stays on the card as a disabled button with the reason.
One click, one verification
Each click on a MitID or BankID button starts one verification, and VerifyID bills every started verification, including one that the shopper cancels or that fails. While a start runs, every button on the card is disabled, so a double click cannot start two. Opening or closing the card and switching its language start nothing. If the shopper clicks the same button again within 5 minutes without finishing, they return to the verification that is already open, and nothing new is billed.
Language switch
The card has a small language menu in its top corner: Dansk, Svenska, English and Norsk.
- The store view's locale is the default language. Danish, Swedish and Norwegian store views open the card in their language; every other locale opens it in English.
- A choice changes the card's texts at once, without reloading the page, and is kept while the shopper stays in the same browser tab. It changes only the card, not the rest of the shop.
- Your own texts (Texts) are shown in the store view's language. The other languages use the module's built-in texts.
To hide the menu, set System › Configuration › VerifyID › Age Verification › Appearance › Show Language Switch to No (default Yes; it can be set per store view). The card then uses the store view's language only.
To offer fewer languages, choose them in Appearance › Languages in Switch (default: all four). The store view's own language is always offered.
Setting ages
Age tiers: 16+, 18+, 19+, 20+, 21+, 23+, 25+. A product with no age requirement needs no verification.
Where to set them
- Product: Catalog › Manage Products › (product) › VerifyID Age Verification › VerifyID age requirement: Use category / store default, Exempt, or a tier. The attribute has global scope (one value for all store views).
- Many products: in the Catalog › Manage Products grid, select products, then Actions › Set VerifyID age.
- Category: Catalog › Manage Categories › (category) › General Information › VerifyID age requirement. Subcategories inherit it when Age Rules › Categories Inherit Parent Ages is on (default).
- Store default: Age Rules › Store Default Age, for a store-wide requirement.
php shell/verifyid.php category-age --id 12 --age 18 # category 12 requires 18+
php shell/verifyid.php category-age --id 12 --age 21 --recursive --dry-run # preview 21+ for 12 and subcategories
php shell/verifyid.php category-age --id 12 --age none # remove the requirement
php shell/verifyid.php explain --product SKU # show how a product's age is worked outOrder of precedence
- Exempt on the product beats everything.
- Otherwise the higher of the product's own age and its tag age. A product's own value wins even when it is lower than its category's.
- Otherwise the highest age among the product's categories. Store root categories (for example Default Category) are ignored.
- Otherwise the Store Default Age.
For the cart, the highest line wins:
- configurable product: the parent's age, or the selected child's when the child has its own value;
- bundle product: the highest of the bundle and its selected children;
- grouped product: the higher of the item and its grouped parent.
Example. Category Beer is 18+ and category Spirits is 21+. A whisky in both categories needs 21+. An alcohol-free beer in Beer set to Exempt needs nothing. A cart with a beer and the whisky needs 21+, so the card shows only the BankID button.
Tags (18+ or +18)
Choose a text, select or multiselect product attribute under Age Rules › Tags Attribute. Values are split on commas, semicolons, | and new lines. A tag counts only when it is exactly NN+ or +NN with a known tier; when several match, the highest wins.
| Attribute value | Tag age |
|---|---|
18+ | 18 |
+21 | 21 |
beer, 18+ | 18 |
18+; +21 | 21 |
Alcohol 18+ | none (not an exact tag) |
18 | none (no +) |
17+ | none (not a known tier) |
How enforcement works
- A cart with age-restricted items shows a notice, and the checkout gate sends the shopper to the verification page (
/verifyid/verify/, which also works without JavaScript) before checkout, where the VerifyID card covers the page (What shoppers see). - The shopper clicks MitID or BankID, verifies and returns to the shop. The module checks the result from the server. A verification is single use, tied to the browser that started it, and valid for 60 minutes by default.
- At order placement, every way of placing an order runs the same server-side check: one-page checkout, multishipping, one-step checkout extensions, PayPal Express, the SOAP/XML-RPC cart API, admin order creation and recurring profiles. Without a valid verification for the cart's age, the order is not created. Browser-side checks alone are never trusted.
Each order records the VerifyID status, method, verified tier, required age and time, in the order view (tab Age Verification) and as columns in the Sales › Orders grid, plus an order comment.
Exceptions
These orders are not checked against a verification. Review them before you rely on the module for compliance.
| Case | Default |
|---|---|
| Admin-created orders | Skipped, with an order comment (or set Require a valid verification) |
API orders (an API user's cart.order, REST calls of an admin-type API user) | Skipped, with an order comment naming the API user (Skip Check for API Orders) |
| Orders written straight as order records (bulk imports) | Treated as trusted imports: not checked, not recorded |
| Cron | Checked (Skip Check for Cron = No) |
| Exempt customer groups | Skipped and recorded |
| Self-declaration (when enabled) | Accepted only for orders not delivered to a covered country, and recorded |
| VerifyID unavailable or no valid plugin key | Restricted orders blocked (fail closed), unless you choose accept and hold |
Recurring profiles (PayPal recurring payments) are checked when the profile is created; later billing orders are not checked again. Headless storefronts: version 1.0 enforces the check on API orders, but has no API to start a verification from a headless frontend.
Full-page cache, Varnish and sessions
- Pages contain only per-store settings; each shopper's state is loaded from
/verifyid/verify/status, which is never cached. Category, product and CMS pages may be cached, but the module's own routes must not be: with Lesti_Fpc do not addverifyid_*actions to the cacheable actions; with Turpentine (Varnish) addverifyid/to the URL blacklist. - If a CDN or proxy strips unknown query parameters, keep
token_age_verifiedandtoken_age_verified_newon/verifyid/verify/return. - Keep the session cookie's SameSite at Lax or unset. With Strict, the browser does not send the session cookie when the shopper returns from MitID or BankID, and the verification does not count.
- On OpenMage 20 with CSP headers on, the module adds
https://netseidbroker.dkandhttps://www.ident.nets.eutoform-action. If you set CSP outside Magento, add them there.
Behind Varnish, a load balancer or a CDN
PHP then sees the proxy's IP address, so all shoppers would share one start limit. Tell the module which proxies to trust in app/etc/local.xml, inside config/global; it uses the rightmost address in the forwarding header that is not a trusted proxy:
<verifyid>
<client_ip>
<!-- IPs or CIDRs of every proxy in front of PHP -->
<trusted_proxies>10.0.0.0/8,172.16.0.0/12</trusted_proxies>
<!-- $_SERVER key of the forwarding header; default HTTP_X_FORWARDED_FOR -->
<header>HTTP_X_FORWARDED_FOR</header>
</client_ip>
</verifyid>For Cloudflare, list Cloudflare's IP ranges and set header to HTTP_CF_CONNECTING_IP. Clear the cache after editing local.xml.
Troubleshooting
The module logs to var/log/verifyid.log (more detail with Advanced › Debug Logging). The log never contains the plugin key, verification tokens, device ids or shopper names, so you can send it to VerifyID support.
| Symptom | Cause and fix |
|---|---|
| System › Configuration › VerifyID shows "Access denied" or a 404 page right after installing | Log out of the admin and log in again. For restricted roles, add the VerifyID resources. |
The VerifyID section is missing, or /verifyid/verify/ answers 404 | Check that app/etc/modules/VerifyID_AgeVerification.xml exists, then clear the cache. On 1.9.4 with compilation on, compile again. |
Table '…verifyid_verification' doesn't exist, or an unknown column verifyid_status | The setup script did not run. Clear the cache and run it (installation step 4). |
| Category pages fail with "Invalid backend model specified" | The module's files were removed without uninstalling first (below). |
VerifyID answers 403; admin notice "VerifyID refused verifications for website …" | The subscription is not paid, or the storefront host is not registered. Pay or register the host, then click Test Connection to end the pause. |
| Test Connection: "Could not reach VerifyID" | The server cannot make outbound HTTPS requests to app.verifyid.dk. Check the firewall, proxy and DNS. |
| Test Connection: "The plugin key was not recognised" | Copy the key again from the dashboard, without spaces. Check the scope (Default Config or website). |
| Shoppers see "Age verification is temporarily unavailable" | VerifyID failed repeatedly and new starts are paused (15 minutes by default), or the key or account has a problem. Check the admin notice and the log. |
| The cart says the shop cannot verify the age | The cart needs more than 18+ and only MitID is enabled. Enable BankID. |
| The card shows only the BankID button | The cart needs 19+ or more, which MitID cannot verify. This is expected. |
| The card has no language menu | Appearance › Show Language Switch is No. |
| A shopper verified but checkout asks again | The verification expired, a product with a higher age was added, the shopper finished in another browser or app, or the session cookie is SameSite Strict. |
| "Too many verification attempts" for many shoppers at once | The shop runs behind a proxy and all shoppers share one IP limit. Configure trusted proxies (above). |
| Orders On hold (verification unavailable) | When VerifyID Is Unavailable is set to accept and hold. Check the customers' ages before these orders ship. |
| The card appears behind the header or cookie banner | Raise Appearance › Overlay z-index. |
Switching off or uninstalling
To switch VerifyID off, set Enable Age Verification to No.
Magento 1 has no uninstall command, so the module brings its own: php shell/verifyid.php uninstall lists what it would remove, and php shell/verifyid.php uninstall --confirm removes it. It deletes VerifyID's data, including the age-verification details stored on orders, so export what you need for audits and back up the database first. Run it in maintenance mode with cron and API traffic stopped, then remove the files (app/etc/modules/VerifyID_AgeVerification.xml first) and clear the cache. Never delete the module files without running the uninstall first. The full steps are in README.md inside the zip.