PHPackages                             setono/sylius-age-verification-plugin - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. setono/sylius-age-verification-plugin

ActiveSylius-plugin

setono/sylius-age-verification-plugin
=====================================

Setono example plugin for Sylius.

v1.0.0(1y ago)1474MITPHPPHP &gt;=8.1CI passing

Since Sep 25Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/Setono/sylius-age-verification-plugin)[ Packagist](https://packagist.org/packages/setono/sylius-age-verification-plugin)[ GitHub Sponsors](https://github.com/Setono)[ RSS](/packages/setono-sylius-age-verification-plugin/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelog (2)Dependencies (39)Versions (6)Used By (0)

Age Verification Plugin for Sylius
==================================

[](#age-verification-plugin-for-sylius)

[![Latest Version](https://camo.githubusercontent.com/785f5608629ff94e19a10a7d499363e3a2e7e8b953ae54ce4ef8beb863c69d02/68747470733a2f2f706f7365722e707567782e6f72672f7365746f6e6f2f73796c6975732d6167652d766572696669636174696f6e2d706c7567696e2f762f737461626c65)](https://packagist.org/packages/setono/sylius-age-verification-plugin)[![Software License](https://camo.githubusercontent.com/1bfb953e30e4f408e0629a3e75f72c83bffb676b05c52e0f2dc667f6a241cb90/68747470733a2f2f706f7365722e707567782e6f72672f7365746f6e6f2f73796c6975732d6167652d766572696669636174696f6e2d706c7567696e2f6c6963656e7365)](LICENSE)[![Build Status](https://github.com/Setono/sylius-age-verification-plugin/workflows/build/badge.svg)](https://github.com/Setono/sylius-age-verification-plugin/actions)[![Code Coverage](https://camo.githubusercontent.com/79a9b2ad16c871b1851045c5ce46fffec14b16f4ac669eccb6e08269d5bed958/68747470733a2f2f636f6465636f762e696f2f67682f5365746f6e6f2f73796c6975732d6167652d766572696669636174696f6e2d706c7567696e2f6272616e63682f322e782f67726170682f62616467652e737667)](https://codecov.io/gh/Setono/sylius-age-verification-plugin)[![Mutation testing](https://camo.githubusercontent.com/fb3793d2ee5a86ac922ab011559a63d20f57fb43449f68be2fc811128e509a52/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d2532465365746f6e6f25324673796c6975732d6167652d766572696669636174696f6e2d706c7567696e253246322e78)](https://dashboard.stryker-mutator.io/reports/github.com/Setono/sylius-age-verification-plugin/2.x)

A plugin to add age verification to your Sylius store using [VerifyID](https://verifyid.dk/) as the age verification provider.

During checkout, if the customer's cart contains products with a minimum age requirement and the shipping address is in an enabled country, the plugin prompts the customer to verify their age via VerifyID before completing the order. Supported minimum age thresholds are 16 and 18.

Prerequisites
-------------

[](#prerequisites)

You need a [VerifyID](https://verifyid.dk/) account. From the VerifyID dashboard, obtain your **Plugin Key**.

Installation
------------

[](#installation)

### Step 1: Install the plugin

[](#step-1-install-the-plugin)

```
composer require setono/sylius-age-verification-plugin
```

### Step 2: Register the bundle

[](#step-2-register-the-bundle)

Add the plugin to your `config/bundles.php` file:

```
return [
    // ...
    Setono\SyliusAgeVerificationPlugin\SetonoSyliusAgeVerificationPlugin::class => ['all' => true],
    // ...
];
```

### Step 3: Configure environment variables

[](#step-3-configure-environment-variables)

Add the following environment variable to your `.env.local`:

```
VERIFYID_PLUGIN_KEY=your-plugin-key
```

### Step 4: Import routes

[](#step-4-import-routes)

Create `config/routes/setono_sylius_age_verification.yaml`:

```
setono_sylius_age_verification:
    resource: "@SetonoSyliusAgeVerificationPlugin/Resources/config/routes.yaml"
```

### Step 5: Configure the plugin

[](#step-5-configure-the-plugin)

Create `config/packages/setono_sylius_age_verification.yaml`:

```
setono_sylius_age_verification:
    enabled_countries:
        - DK # Add the country codes where age verification should be enforced
```

### Step 6: Extend entities

[](#step-6-extend-entities)

#### Extend the `Customer` entity

[](#extend-the-customer-entity)

```
