Troubleshooting
This guide addresses common questions and troubleshooting steps when working with the Magento 2 Age Restriction extension.
1. Popup Modal Does Not Appear
Potential Causes & Solutions:
Active Verification Cookie Exists in Browser:
If you have already verified your age in your current browser session, theage_verifiedcookie prevents the modal from appearing again.
Fix: Open a new Incognito / Private Window or clear cookies for your domain.Module is Disabled in Configuration:
Verify that Stores > Configuration > Webkul > Age Verification > General Settings > Enable Plugin is set toYes.Page is Not Restricted:
- For Products: Ensure the product attribute
Age Verification(product_age_verification) is set toYes, and Display on Products is enabled. - For Categories: Ensure the category attribute
Age Verification(category_age_varification) is set toYes, and Display on Categories is enabled. - For CMS Pages: Ensure the target page is selected in Select CMS Pages.
- For Products: Ensure the product attribute
Stale Cache:
Flush the Magento configuration and full page cache:php bin/magento cache:clean config full_page
2. "This product needs age verification" Cart Error
Why It Happens:
The extension includes a backend plugin (Webkul\AgeRestriction\Model\Plugin\Cart::beforeAddProduct) that blocks unverified cart additions (such as via direct URL query parameters or quick view modules).
Solution:
Verify your age on the product page before clicking Add to Cart. If you are developing a headless storefront or custom theme, ensure your frontend invokes the setAgeVerification GraphQL mutation or AJAX endpoint before dispatching cart mutations.
3. Cookie Lifetime & Safari Compatibility
- In Safari and iOS devices, Apple's Intelligent Tracking Prevention (ITP) enforces strict policies on client-side cookies.
- Webkul Age Restriction handles this by setting server-side public cookie metadata (
setPublicCookie) with an explicit duration calculated from your configured Cookie Lifetime (Days). - To change how often returning visitors must re-verify, update Stores > Configuration > Webkul > Age Verification > Content > Cookie Lifetime (Days).
4. Multi-Store View Configuration
Configuration options under Content, Terms & Conditions, and Design support Store View scope.
If changes made at the Default Config level do not reflect on your localized store views:
- Select the specific Store View from the top-left store switcher in the admin panel.
- Uncheck Use Default next to the target fields.
- Apply localized values (such as translated titles, button texts, or specific terms URLs) and save.
5. CSS / Styling Changes Not Reflecting
If custom colors or button styles configured in the backend are not appearing:
- Deploy static assets:
php bin/magento setup:static-content:deploy -f - Flush cache:
php bin/magento cache:flush - Hard refresh your browser using
Ctrl + F5(Windows/Linux) orCmd + Shift + R(macOS).
