Skip to content

jakubfrasunek/SyliusCookieAlertPlugin

 
 

Repository files navigation

Cookie Alert Plugin

Add a simple cookie alert to your shop

Warning

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.

Installation

  1. Install Sylius
  2. Add the bundle and dependencies in your composer.json

composer require black/sylius-cookie-alert-plugin:^1.0.0@dev

  1. Register the bundle:
<?php

// config/bundles.php

return [
    // ...
    Black\SyliusCookieAlertPlugin\BlackSyliusCookieAlertPlugin::class => ['all' => true],
];
  1. Import the configuration
# config/packages/sylius_cookie_alert.yaml
imports:
    - { resource: "@BlackSyliusCookieAlertPlugin/Resources/config/app/config.yml" }
  1. Add the cookie-alert javascript dependency yarn add bootstrap-cookie-alert
  2. Add the cookie-alert dependency in your main javascript file
  require('bootstrap-cookie-alert/cookiealert');
  1. Add the cookie alert dependency in your main scss file
@import '~bootstrap-cookie-alert/cookiealert.css';

Usage

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

License and Copyright

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.

Credits

Created by Alexandre Balmes.

Sponsors

This project was made possible thanks to the support of:

Vanoix.com

About

Add a simple cookie alert to your shop

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 82.3%
  • JavaScript 13.6%
  • Twig 2.2%
  • Gherkin 1.9%