Age Verification for Magento 2, is a must needed module for the store owner who wants to sell the products to a particular age group of customers.
With the help of this module, the admin can restrict the users to access the store from the store category, cms pages, and the product page. Then a pop-up will show to the user to confirm the age.
Now, the users can confirm the age by providing the date of birth then access the restricted page easily.
- Upload custom image for the pop-up
- The admin can manage the pop-up content setting
- Select methods to verify users age – checkbox, date of birth, yes/no
- The admin can enter the custom text for Enter and Leave buttons
- The admin can set the Leave button URL
- Set where to apply the module – products, categories, or cms pages
- Customizable design – width, button color, background color, text color
Customers will get a zip folder then they have to extract the contents of this zip folder on their system. Then, the extracted folder has an src folder, inside the src folder you have the app folder.
You need to transfer this app folder into the Magento2 root directory on the server as shown below.
After the successful installation, then you have to run these commands in the Magento2 root directory.
First command- php bin/magento setup:upgrade
Second Command – php bin/magento setup:di:compile
Third Command – php bin/magento setup:static-content:deploy
After running the commands, you have to flush the cache from the Magento admin panel by navigating through System>Cache management as shown below in the snapshot-
For translating the module language, navigate through src/app/code/Webkul/AgeRestriction/i18n then edit the en_US.csv file.
Now rename the CSV as “en_SA.csv” and translate all right side content after the comma in the Arabic language. Then after editing the CSV, save it.
Now upload the file to the path src/app/code/Webkul/AgeRestriction/i18n which already have Magento2 installed, on the server.
Now the module will be translated into the Arabic Language which supports RTL & LTR languages.
The admin can configure the module from the back-end easily. To configure the module, the admin can navigate to Stores> Configuration> Age Verification
Note: For configuring the entire module, the admin needs to select Default Configuration by using Store View.
Here, the admin can-
- Enable or Disable the module from the back-end.
- Select the Store View(multiple store view can be selected at a time)
- Upload the image to show on the front end on the pop-up screen.
In the content section, the admin can-
- Enter the title for the pop-up
- Enter the pop-up content title/ Description
- Select the method to verify user age-
The admin can select the different type of method to verify the user age as: Date of Birth, Checkbox Option, and Yes/No button
- Select the format of date of birth.
- The will enter the age required for the age confirmation
- The text which will be shown on the button
- Enter the text for the leave button.
- Enter the url for the leave button.
Display Setting: In the display section, the admin can configure the module where the age restriction should be applied then-
- Select yes, if you want to apply age restriction on CMS Pages and after that, the admin can select the CMS pages where he want to apply age restriction.
- The admin can select if, the age verification should be applied on the Categories
- The admin can decide if, the age verification should be applied to the Products.
Design: The admin can set the design for the pop-up. Here, the admin can-
- Set the pop-up width by entering the pop-up width value between the range 200-1000
- Enter the color for the pop-up background.
- Enter the color for the text.
- The admin can set what should be the button color.
- the admin can enter the text color for the button.
Configure Store View
Similarly, the admin can configure particular store view by navigating through Stores> Configuration> Store View.
By using the Store View the admin can select the particular store view which he wants to configure.
Note: After selecting a particular store view the admin can configure only the Content and Design settings for that store view.
Age verification on the product page
The admin can enable or disable the age verification on the product page. To manage the age verification on the product page the admin can navigate to catalog> products
Now select the product for which the admin wants to enable the age verification then click on the edit button as shown in the image below-
Now the admin can enable or disable the age verification then click on the save button as shown in the image below-
Age verification on the category page
The admin can enable or disable the age verification on the category page. To manage the age verification on the category page, the admin can navigate to catalog> categories
Now the admin can select the category for which the admin wants to enable or disable the module as shown in the image below-
Age Verification on the Product Page- When age verification is applied to the product page, the customer can’t access to that product page until the customer verifies the age according to the applied age restriction.
After verifying the age, the customer can access that product page then shop for that particular product too.
If the customer clicks on the Leave button, then the customer will be redirected to the URL which is set by the admin.
Note: The layout of the age verification pop-up will change in terms of Content and Design, according to the select Store View but the method will remain same.
Age Verification on the Cateogy Page
Now, when the age verification is applied to the category page then the customers will not be able to access that category page until the customer verify the age-
After verifying the age according to the set by the admin, the customer can access to that particular category-
If the customer clicks on the Leave button, the customer will be redirected to the URL which is set by the admin.
Age Verification on the CMS Pages
Not only category, product, but also cms pages can be restricted using this module. The admin can apply the age verification for the cms pages too.
That’s all for Age Verification For Magento2. Still, have any issues please raise a ticket or get back to us at firstname.lastname@example.org
Current Product Version - 5.0.0
Supported Framework Version - Magento 2.0.x, 2.1.x, 2.2.x,2.3.x, 2.4.x