Setting up Age Verification
TitanCart’s built-in Age Verification gates age-sensitive products — alcohol, vaping, knives, adult content — behind an age check. It works at three levels you can mix: a single product, a whole category, or the entire storefront. The check is enforced on the server as well as on the page: a restricted item cannot be added to the cart or checked out until the visitor has verified an age that meets the requirement, so closing the pop-up or posting straight to the cart does not get around it. It ships in TitanCart Lite and Pro, with no keys or outside service.
1. Enable the extension
Go to TitanCart → Extensions → Installed Extensions, find Age Verification in the Built-in Extensions card, make sure it is enabled, and click the gear icon to open its settings page. The page has two sections, General and Site-wide Gate.
2. The General settings
These defaults apply everywhere unless a product or category overrides them:
- Default minimum age — 18 by default. Used by any restricted product or category that has no explicit age of its own.
- Verification method — how the visitor proves their age (see §5). The default is Enter date of birth.
- Warning message — shown when a restricted item is blocked at the cart or checkout. Write
{age}and it is replaced with the required age. - Action if age not met — what happens when the visitor fails or declines (see §6). Default: Redirect to homepage.
- Remember verification (days) — 30 by default. How long a successful check is remembered in the visitor’s browser before they are asked again; 0 asks on every visit.
3. Restrict a product
Open the product under Products → Products, expand the Extra section of the General tab, tick This product is age-restricted, and optionally set a Minimum age. Leave it at 0 to use the Default minimum age. Save. The controls appear only while the extension is enabled.
4. Restrict a category
If everything in a category is age-sensitive, restrict the category instead: open it under Products → Categories, tick Products in this category are age-restricted, optionally set a Minimum age, and save. Every product in that category inherits the requirement.
Which age wins? The strictest. A product’s own minimum age and the highest minimum age of any restricted category it belongs to are compared, and the higher one applies; each side falls back to the global default when it is left at 0. A 21+ product in an 18+ category asks for 21; an unflagged product in a 21+ category asks for 21.
5. How visitors verify
The Verification method decides what the age gate asks for. All three set the same verification once passed:
- Enter date of birth (default) — a date field; the age is calculated and compared with the requirement.
- Simple “I am over X” confirmation — two buttons, “I am X+ years old” and “I am under X”.
- Checkbox acknowledgment — one checkbox, “I confirm I am X years of age or older”, and a Continue button.
A pass is stored in the visitor’s browser as the age they verified, for the number of days you set. Because the age is stored rather than a yes/no, a visitor who verified 18 for one product is asked again on a product that needs 21.
6. What happens when the age is not met
Action if age not met offers Redirect to homepage, Show denial message (the gate turns into an “Access Denied” card and the visitor stays on the page) and Hide product entirely. In this release Hide product entirely behaves exactly like Redirect to homepage: the visitor is sent to the home page, and the product stays visible in listings. Choose between Redirect and the denial message.
7. Gate the whole storefront
For a store where everything is age-restricted (a vape shop, say), open the Site-wide Gate section, tick Gate the whole site, set a Site-wide minimum age (0 uses the default) and, if you like, the Site-wide gate message ({age} works here too). Save.
The gate appears before any storefront page, including the login page, so a visitor must verify before they can even sign in. It uses the same stored verification as the product and category gates, so one pass satisfies all of them; a product that needs a higher age than the site-wide minimum still asks the visitor to step up.
8. How enforcement works
- On the page — the product page (or every page, with the site-wide gate) shows the age-gate overlay until the visitor passes.
- On the server — adding a restricted item to the cart is refused with your Warning message unless the stored verification meets that product’s requirement, and placing an order is refused unless it meets the highest requirement among the items in the cart.
That second layer is what matters: deleting the overlay or calling the cart endpoint directly still fails. (The stored verification is a browser cookie; it stops casual bypasses, not a determined forger.)
9. Test it
- Open the storefront in a private window so nothing is remembered.
- Visit a restricted product (or any page, with the site-wide gate). The gate should appear; pass it with the method you chose and the page should reveal.
- In a fresh private window, try to add the restricted product to the cart without passing the gate (for example from a category page) and confirm the Warning message.
Troubleshooting
- The age-restricted controls are missing from the editor. The extension is not enabled under Installed Extensions.
- A product I did not flag asks for age. It belongs to a restricted category.
- The required age is higher than I set on the product. The strictest age wins; check the product’s categories.
- Visitors are asked on every visit. Remember verification is 0, or they clear cookies.
- I set a product’s age but it uses 18. A minimum age of 0 means “use the default”. Enter the age on the product, or change the Default minimum age.
- The site-wide gate blocks the login page. By design; verify once and the login works for the remembered period.
- “Hide product entirely” does not hide anything. Correct for this release; it redirects. Use the denial message if you want visitors to stay on the page.
See also
- Setting up reCAPTCHA (v2 & v3) — bot protection for the storefront forms.
- GDPR & cookie consent
- Products overview & the product editor tabs — the Extra section.