Markus Michalski FAQ

Klaro Cookie Consent: Installation

Installing the Klaro Cookie Consent plugin for Sylius 2 via Packeton, bundle registration, setup command, update and uninstallation.

Deutsche Version

Back to overview

Klaro Cookie Consent: Installation

This documentation always describes the latest published version.

Installation

Note: This plugin is commercial and distributed exclusively via Packeton (https://packeton.markus-michalski.net). You receive credentials after purchasing a license.

{ "repositories": [{ "type": "composer", "url": "https://packeton.markus-michalski.net" }] }
composer require mmd/sylius-klaro-consent-plugin

Afterwards, always in this order:

  1. Register the bundle in config/bundles.php:
    Mmd\SyliusKlaroConsentPlugin\MmdSyliusKlaroConsentPlugin::class => ['all' => true],
    
  2. Import the admin routes (the storefront banner ships no routes of its own, only the admin area needs an import):
    mmd_sylius_klaro_consent_admin:
        resource: "@MmdSyliusKlaroConsentPlugin/config/routes/admin.yaml"
    
  3. Run the setup command:
    bin/console mmd:klaro-consent:setup
    
    What the command does:
    • executes only this plugin's own still-open migrations, creating mmd_sylius_klaro_consent_service (+ translation table, + channel pivot) and mmd_sylius_klaro_channel_configuration
    • is idempotent: with no new migration pending, it reports that and changes nothing
    • aborts if Sylius core migrations are still open, pointing you to run doctrine:migrations:migrate first
    • checks whether the admin routes from step 2 are imported and only prints a hint if not; it never writes to config/ itself
  4. Install the assets:
    bin/console assets:install public
    

The bundle registers admin grids, Twig hooks and the Doctrine mapping itself in the host container, so no further import is needed for those.

If the tables are still missing, for example because the setup command was skipped, the storefront silently renders no banner and logs a warning instead of failing.

Update

composer update mmd/sylius-klaro-consent-plugin

Then run the setup command again (idempotent, see above) and clear the cache:

bin/console mmd:klaro-consent:setup
bin/console cache:clear

Migrations

The setup command runs only this plugin's own three migrations, never the host project's or another plugin's. The global doctrine:migrations:migrate command remains usable and is only needed when the setup command reports that Sylius core migrations are still open.

Uninstallation

  1. Remove any of your own hook/template overrides, if present
  2. Roll back the migrations while the bundle is still registered, newest first:
    bin/console doctrine:migrations:execute --down "Mmd\SyliusKlaroConsentPlugin\Migrations\Version20261003090000"
    bin/console doctrine:migrations:execute --down "Mmd\SyliusKlaroConsentPlugin\Migrations\Version20261002101014"
    bin/console doctrine:migrations:execute --down "Mmd\SyliusKlaroConsentPlugin\Migrations\Version20261002100417"
    
  3. Remove the route import from step 2 and the bundle entry from config/bundles.php
  4. composer remove mmd/sylius-klaro-consent-plugin