solution25 / age-checker
Age Checker - Shopware 6 Plugin
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:shopware-platform-plugin
Requires
- shopware/core: ~6.6.0
- shopware/storefront: ^6.6
README
AgeChecker
Introduction
The AgeChecker plugin helps merchants enforce age verification on their Shopware 6 storefronts. By integrating with an external age verification service, it ensures that customers meet age requirements before proceeding to checkout.
This tool is especially useful for businesses selling age-restricted products, providing a configurable and user-friendly verification layer that integrates seamlessly with Shopware's sales channels.
Key Features
- Sales Channel Integration
- Add API keys per sales channel for flexible configuration.
- Age Verification Options
- Customers can verify their age by entering their date of birth.
- Retry Management
- Users have 3 attempts by default to verify their age.
- Temporary Denial Logic
- Block users temporarily after 3 failed attempts.
- Admin Panel Configuration
- Easily manage settings from the Shopware admin panel.
Get Started
Installation & Activation
- Download
Git
- Clone the Plugin Repository:
- Open your terminal and run the following command in your Shopware 6 custom plugins directory (usually located at custom/plugins/):
git clone https://github.com/solution25com/agechecker-shopware-6-solution25.git
- Install the Plugin in Shopware 6
- Log in to your Shopware 6 Administration panel.
- Navigate to Extensions > My Extensions.
- Locate the newly cloned plugin and click Install.
- Activate the Plugin
- After installation, click Activate or toggle the plugin to activate it
- Verify Installation
- After activation, you will see AgeChecker in the list of installed plugins.
- The plugin name, version, and installation date should appear as shown in the screenshot below.
Plugin Configuration
- Access Plugin Settings
- Go to Settings > System > Plugins.
- Locate AgeChecker and click the three dots (...) icon or the plugin name to open its settings.
- API Key Setup
- Go to Extensions > My Extensions > AgeChecker.
- Select the appropriate Sales Channel.
- Enter the API Key provided by AgeChecker.net. You must create an account there to obtain your API Key.
Warning
Each sales channel requires a unique API key.
- Save Configuration
- Click Save in the top-right corner to store your settings.
How It Works
- User Initiates Checkout
- AgeChecker triggers a popup based on the configured method.
- Verification Attempt
- The user provides their birthdate.
- If successful, checkout proceeds.
- If unsuccessful:
- The user can retry up to 3 times.
- After 3 failed attempts, the user is temporarily denied access.
- Temporary Denial Logic
- Denied users are blocked for 24 hours before they can try again.
Age Checker Plugin - API Documentation
This document describes the API endpoint for the Age Checker Plugin for Shopware 6. The plugin integrates with AgeChecker.net to verify a customer’s age and stores the result in the customer’s custom fields.
Update Customer Age Verification Status
Endpoint
POST /age-checker-user-status
Description
Updates the custom_age_confirmed_
custom field for a logged-in customer based on the age verification result received from the AgeChecker.net service.
System Checks
- Customer must be logged in.
- The
uuid
from AgeChecker.net must be provided. - Calls the AgeChecker.net API to verify the result.
- Sets the customer’s custom field
custom_age_confirmed_
totrue
if the verification is successful (status: accepted
).
Request Headers
sw-context-token: <your-sales-channel-context-token>
Content-Type: application/json
Note: The
sw-context-token
must be obtained via the Shopware Store API authentication process or created automatically in a Storefront session.
Example Request Body
{ "uuid": "8e7c35e2-3f48-4fc9-9283-fb0e198b0fd5" }
Successful Response
{ "message": "Customer age verification status updated" }
Example Error Response
{ "message": "uuid is required" }
Troubleshooting
Verify Functionality
- Confirm popup appears on checkout.
- Test both verification methods.
- Simulate 3 failed attempts to confirm that the user is blocked afterward.
FAQ
-
Is an API key required?
Yes. Without a valid API key, age verification will not function. -
Can I limit it to certain sales channels?
Yes. You can enable or disable the plugin per sales channel. -
Does this plugin block checkout?
Yes, until the user passes age verification. -
What happens after 3 failed attempts?
The user is redirected to a temporary denial page and cannot retry until the timeout expires.Wiki