Conlabz Agecheck ist eine Magento 1 Extension für Altersverifikation, die einen Age-Gate-Splashscreen im Shop-Frontend anzeigt und Besucher zur Bestätigung ihres Mindestalters zwingt, bevor sie den Shop-Inhalt sehen.
Das Modul zeigt einen Age-Gate auf jeder Seite des Shop-Frontends. Der Besucher muss das Mindestalter bestätigen, bevor er den Shop-Inhalt sehen kann.
Das Modul führt diese Schritte aus:
- Es fügt einen Overlay-Block direkt nach dem Start des
body-Elements ein. - Es blendet alle Elemente mit der CSS-Klasse
wrapperaus. - Es zeigt zwei Buttons. Ein Button bestätigt das Alter, der andere lehnt es ab.
- Bestätigt der Besucher das Alter, setzt das Modul das Cookie
agepassedauf1. Danach blendet es das Overlay aus und zeigt die Seite. - Lehnt der Besucher das Alter ab, leitet das Modul den Browser auf eine konfigurierte URL um.
Das Cookie ist 1 Tag gültig. Wählt der Besucher die Checkbox "Diese Auswahl speichern", ist das Cookie 365 Tage gültig.
Das Modul prüft nicht serverseitig. Das HTML der Seite ist immer in der Antwort enthalten. Nutze dieses Modul nicht als Zugriffskontrolle.
Enthält der User-Agent den Text Preview, führt das Modul die Prüfung beim
Seitenaufruf nicht durch. Dieses Verhalten hält die Magento Design-Vorschau nutzbar.
Screenshot hier einfügen: Age-Gate-Overlay im Shop-Frontend
Nutze modman oder Composer.
Mit modman:
modman clone git@github.com:conlabz/magex_agecheck.git
Mit Composer lautet der Paketname conlabz/magex_agecheck. Das Paket benötigt
magento-hackathon/magento-composer-installer.
Leere nach der Installation den Magento-Cache.
Öffne System > Konfiguration > Kunden > Kundenkonfiguration. Öffne dann die Gruppe Age verification settings.
| Feld | Konfigurationspfad | Standard |
|---|---|---|
| Enable Age verification page | customer/age_verification/enable_agecheck |
No |
| Restriction Age | customer/age_verification/age |
18 |
| Introduction Text | customer/age_verification/introtext |
Text zu verantwortungsvollem Alkoholkonsum |
| Validation fail redirect url | customer/age_verification/fail_redirect |
http://www.kinderstarkmachen.de/index.php?page=66 |
Du kannst alle Felder für den Default Scope, den Website Scope und den Store View Scope setzen.
Das Modul ist ausgeschaltet, solange Enable Age verification page nicht auf Yes steht.
Das Feld Introduction Text erlaubt HTML. Das Modul nutzt den Wert zusätzlich als Übersetzungsschlüssel.
| Pfad | Funktion |
|---|---|
app/code/community/Conlabz/Agecheck/Block/Intro.php |
Fügt das Overlay und den JavaScript-Code ein |
app/code/community/Conlabz/Agecheck/Block/Template.php |
Erzeugt das HTML des Overlays |
app/code/community/Conlabz/Agecheck/Helper/Data.php |
Liest die Konfigurationswerte |
app/design/frontend/base/default/layout/agecheck/layout.xml |
Fügt den Block und die CSS-Datei hinzu |
app/design/frontend/base/default/template/agecheck/ |
Templates intro.phtml und template.phtml |
js/conlabz/agecheck/agecheck.js |
Cookie-Funktionen und Ein-/Ausblend-Logik (Prototype) |
skin/frontend/base/default/css/agecheck/styles.css |
Styles des Overlays |
app/locale/de_DE/Conlabz_Agecheck.csv |
Deutsche Übersetzung |
app/locale/en_US/Conlabz_Agecheck.csv |
Englische Übersetzung |
Das Modul nutzt keine Datenbank. Es hat keine SQL-Setup-Skripte.
Das Overlay benötigt diese Elemente im Theme:
- Ein oder mehrere Elemente mit der CSS-Klasse
wrapper. Der JavaScript-Code blendet diese Elemente aus. - Das Bild
images/logo.gifim Skin-Verzeichnis. - Einen Wert unter Allgemein > Shop-Informationen > Shop-Name.
- Der Age-Gate funktioniert nur im Browser. Nutze ihn nicht als Zugriffskontrolle.
- Das Overlay benötigt die Theme-Elemente aus Abschnitt "Theme-Anforderungen".
- Das Modul schreibt kein Log der Bestätigungen.
The module shows an age gate on each page of the shop front end. The visitor must confirm the minimum age before the visitor can see the shop content.
The module does these steps:
- It adds an overlay block after the start of the
bodyelement. - It hides all elements that have the CSS class
wrapper. - It shows two buttons. One button confirms the age. The other button refuses the age.
- If the visitor confirms the age, the module sets the cookie
agepassedto1. Then it hides the overlay and shows the page. - If the visitor refuses the age, the module sends the browser to a configured URL.
The cookie is valid for 1 day. If the visitor selects the check box "Save this choice", the cookie is valid for 365 days.
The module does not do the check on the server. The HTML of the page is always in the response. Do not use this module as an access control.
If the user agent contains the text Preview, the module does not do the check
at page load. This behavior keeps the Magento design preview usable.
Insert screenshot here: age gate overlay on the shop front end
Use modman or Composer.
With modman:
modman clone git@github.com:conlabz/magex_agecheck.git
With Composer, the package name is conlabz/magex_agecheck. The package needs
magento-hackathon/magento-composer-installer.
After the installation, clear the Magento cache.
Open System > Configuration > Customer > Customer Configuration. Then open the group Age verification settings.
| Field | Config path | Default |
|---|---|---|
| Enable Age verification page | customer/age_verification/enable_agecheck |
No |
| Restriction Age | customer/age_verification/age |
18 |
| Introduction Text | customer/age_verification/introtext |
text about responsible drinking |
| Validation fail redirect url | customer/age_verification/fail_redirect |
http://www.kinderstarkmachen.de/index.php?page=66 |
You can set all fields for the default scope, the web site scope and the store view scope.
The module is off until you set Enable Age verification page to Yes.
The field Introduction Text permits HTML. The module also uses the value as a translation key.
| Path | Function |
|---|---|
app/code/community/Conlabz/Agecheck/Block/Intro.php |
Injects the overlay and the JavaScript code |
app/code/community/Conlabz/Agecheck/Block/Template.php |
Makes the HTML of the overlay |
app/code/community/Conlabz/Agecheck/Helper/Data.php |
Reads the configuration values |
app/design/frontend/base/default/layout/agecheck/layout.xml |
Adds the block and the CSS file |
app/design/frontend/base/default/template/agecheck/ |
Templates intro.phtml and template.phtml |
js/conlabz/agecheck/agecheck.js |
Cookie functions and show or hide logic (Prototype) |
skin/frontend/base/default/css/agecheck/styles.css |
Styles of the overlay |
app/locale/de_DE/Conlabz_Agecheck.csv |
German translation |
app/locale/en_US/Conlabz_Agecheck.csv |
English translation |
The module does not use the database. It does not have SQL setup scripts.
The overlay needs these items in the theme:
- One or more elements that have the CSS class
wrapper. The JavaScript code hides these elements. - The image
images/logo.gifin the skin directory. - A value in General > Store Information > Store Name.
- The age gate works only in the browser. Do not use it as an access control.
- The overlay needs the theme items in the section "Theme requirements".
- The module does not write a log of the confirmations.
Diese Extension steht unter der MIT-Lizenz. Details siehe LICENSE.
This extension is licensed under the MIT License. See LICENSE for details.
Fragen und Support: conlabz.de