black / sylius-cookie-alert-plugin
Add cookie alert to your shop
Installs: 4 158
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 3
Forks: 5
Open Issues: 3
Type:sylius-plugin
Requires
- php: ^8.0
- sylius/sylius: ~1.9.0 || ~1.10.0 || ~1.11.0 || ~1.12.0
Requires (Dev)
- behat/behat: ^3.6.1
- behat/mink-selenium2-driver: ^1.4
- dmore/behat-chrome-extension: ^1.3
- dmore/chrome-mink-driver: ^2.7
- friends-of-behat/mink: ^1.8
- friends-of-behat/mink-browserkit-driver: ^1.4
- friends-of-behat/mink-debug-extension: ^2.0.0
- friends-of-behat/mink-extension: ^2.4
- friends-of-behat/page-object-extension: ^0.3
- friends-of-behat/suite-settings-extension: ^1.0
- friends-of-behat/symfony-extension: ^2.1
- friends-of-behat/variadic-extension: ^1.3
- friendsofsymfony/oauth-server-bundle: ^1.6 || >2.0.0-alpha.0 ^2.0@dev
- phpspec/phpspec: ^7.0
- phpstan/extension-installer: ^1.2.0
- phpstan/phpstan: ^1.9
- phpstan/phpstan-doctrine: ^1.3.25
- phpstan/phpstan-strict-rules: ^1.4.4
- phpstan/phpstan-webmozart-assert: ^1.2.2
- phpunit/phpunit: ^9.5
- polishsymfonycommunity/symfony-mocker-container: ^1.0
- sensiolabs/security-checker: ^6.0
- sylius-labs/coding-standard: ^4.0
- symfony/browser-kit: ^4.4 || ^5.2
- symfony/debug-bundle: ^4.4 || ^5.2
- symfony/dotenv: ^4.4 || ^5.2
- symfony/intl: ^4.4 || ^5.2
- symfony/web-profiler-bundle: ^4.4 || ^5.2
- symfony/webpack-encore-bundle: ^1.12
- vimeo/psalm: 4.7.1
This package is auto-updated.
Last update: 2024-11-17 20:40:22 UTC
README
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
- 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/config/app/config.php" }
- 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';
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
Quickstart Installation (docker)
-
Run
composer create-project pocky/modern-plugin-skeleton ProjectName
or clone this project -
From the plugin skeleton root directory, run the following commands:
$ sudo chmod -Rf 777 tests/Application/var $ docker-compose exec php php -d memory_limit=-1 /usr/bin/composer install $ docker-compose exec nodejs yarn --cwd tests/Application install $ docker-compose exec php tests/Application/bin/console doctrine:database:create --if-not-exists -vvv $ docker-compose exec php tests/Application/bin/console doctrine:schema:create -vvv $ docker-compose exec php tests/Application/bin/console assets:install tests/Application/public -vvv $ docker-compose exec nodejs yarn --cwd tests/Application build $ docker-compose exec php tests/Application/bin/console cache:warmup -vvv $ docker-compose exec php tests/Application/bin/console sylius:fixtures:load -n
Quality tools
$ docker-compose exec php composer validate --ansi --strict $ docker-compose exec php vendor/bin/phpstan analyse -c phpstan.neon -l max src/ $ docker-compose exec php vendor/bin/psalm $ docker-compose exec php vendor/bin/phpspec run --ansi -f progress --no-interaction $ docker-compose exec php vendor/bin/phpunit --colors=always $ docker-compose exec php vendor/bin/behat --profile docker --colors --strict -vvv --no-interaction
ProTip use Makefile
;)
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: