Add a simple cookie alert to your shop
This plugin is only for Sylius 1.7.x because it uses the new template events architecture. The following instructions are compatible with Bootstrap and Webpack Encore. This plugin is in beta.
- Install Sylius
- Add the bundle and dependencies in your
composer.json
composer require black/sylius-cookie-alert-plugin:^1.0.0@dev
- Register the bundle:
<?php
// config/bundles.php
return [
// ...
Black\SyliusCookieAlertPlugin\BlackSyliusCookieAlertPlugin::class => ['all' => true],
];
- Import the configuration
# config/packages/sylius_cookie_alert.yaml
imports:
- { resource: "@BlackSyliusCookieAlertPlugin/Resources/config/app/config.yml" }
- Add the cookie-alert javascript dependency
yarn add bootstrap-cookie-alert
- Add the cookie-alert dependency in your main javascript file
require('bootstrap-cookie-alert/cookiealert');
- Add the cookie alert dependency in your main scss file
@import '~bootstrap-cookie-alert/cookiealert.css';
This plugin adds a new block in sylius.shop.layout.after_body
with src/Resources/views/_cookieAlert.html.twig
. Feel free to change this behavior, override the template but I think you should use events...
sylius_ui:
events:
sylius.shop.layout.after_body:
blocks:
cookie:
template: "@BlackSyliusCookieAlertPlugin/_cookieAlert.html.twig"
priority: 1
tl;dr:
- Modifications must be shared,
- It's possible to use this plugin in a commercial project,
- A commercial license is available.
This project is licensed under EUPL-1.2. This license implies that if you modify this plugin, you must share those modifications (like AGPL). However, the EUPL-1.2 license applies only on this plugin and this is not viral (like LGPL).
If you don't want to follow this or do not want to use EUPL-1.2 licensed software, you must buy commercial license. Contact us for more information.
Created by Alexandre Balmes.
This project was made possible thanks to the support of: