Skip to main content

The question of the age verification is a sticking point for every tobacco and alcohol vendor, especially in the USA. It’s not enough just to implement an age verification system to your website as every state has its own tobacco and alcohol laws prohibiting the sale of these products to minors.

Let’s take Alabama as an example. Smoking is allowed there from 19 years old. But if it’s a military man, then it’s allowed for him to smoke from 18 years old! In Alaska, the smoking age is 19 but in the city of Sitka, it’s 21. That’s the most tricky thing about age verification in the USA, even if you use a tool based on EVS.

One of our clients sells tobacco production and vapes. Every time they were receiving an order, their manager was opening Wikipedia and checking the smoking age in a particular state. This manual work was taking too much time, so we were asked to optimize this process.

We set the following objectives:

  1. Build a table in Magento, that copies a Wiki table (state, city, purchase age, rule text);
  2. Add to the user block in order section his actual Age;
  3. Add a block in order page, that will show the text of the Rule, that complies with the City and State from the Magento table (from the 1st point);
  4. Find the way to track if https://en.wikipedia.org/wiki/Smoking_age page was changed and send an email to the admin to verify that.

As you see, it contains the following information: state, city, smoking and purchase age, notes.

After the table, there’s a settings block. I will comment only two of them as the others seem to be clear.

1) “Wiki Last Edit Time”. This setting contains the date of the last recorded update of the Wikipedia page. Each time you start the cron, this date is compared with the current date on the Wikipedia page. Therefore, if this setting is somehow changed (for example, reset) and no longer matches the current Wikipedia page date, admin gets a notification. Then, the current date of an update is entered.

2) “How Many Successive Times to Ignore Possible Wiki Page Error”. This setting was added to prevent panic if this Wiki page is unavailable while the cron check. You set the number of cron launches without any access to the Wiki page and only after this number of unsuccessful operations an admin gets a notification.

That’s what we’ve done in the order view section:

Order-View-Customization-1024x5491-1 Age Verification Optimization for a Vape Store

Under the Date Of Birth attribute, we put the information about the age of a customer at the time of order. In the Shipping Adress block, you see the notes from the Wiki page. It helps an admin to check is it allowed to sell tobacco products to a client in a particular state and city.

Now it takes much less time to check the local legislation and process an order. You have all the information you need in your admin panel.

The same work we’ve done on M2.

Vladimir Repalo

Vladimir Repalo

Magento Developer at Mobecls, 8+ years of experience. Feel free to ask me anything about this post in the comments below.