Markus Michalski FAQ

Small Business: Installation

Installing the Sylius plugin Small Business §19 UStG: Composer via Packeton, bundle, routes, setup command, update and uninstall in the right order.

Deutsche Version

Back to overview

Small Business: Installation

This documentation always describes the latest published version.

Live Demo: Try this and other plugins live — no installation, no risk: demo.markus-michalski.net

Composer

Private repositories are managed through Packeton (https://packeton.markus-michalski.net). Credentials are provided after purchasing a license.

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

After composer require:

  1. Register the bundle in config/bundles.php (there is no Flex recipe):

    Mmd\SyliusKleinunternehmerPlugin\MmdSyliusKleinunternehmerPlugin::class => ['all' => true],
    
  2. Import the admin routes, for example in config/routes/mmd_sylius_kleinunternehmer.yaml. Only this makes the route exist that the admin menu entry points to:

    mmd_sylius_kleinunternehmer_admin:
        resource: "@MmdSyliusKleinunternehmerPlugin/config/routes/admin.yaml"
    
  3. Run the setup command:

    bin/console mmd:kleinunternehmer:setup
    

    The command creates the tables mmd_kleinunternehmer_settings and mmd_kleinunternehmer_migrated_variant. It has no options of its own and does the following:

    • It runs only the open migrations of this plugin, not those of the app or other plugins.
    • It is idempotent: without a new migration nothing happens, so you can safely run it again after every composer update.
    • It checks that the routes from step 2 are imported and prints a snippet otherwise. It never writes to config/ itself.
    • If the plugin has open migrations and Sylius migrations are still open, it stops and asks you to run bin/console doctrine:migrations:migrate first.
    • It asks for confirmation interactively. In scripts, add --no-interaction.

    doctrine:migrations:migrate still works as an alternative.

There is no config/packages/*.yaml file for this plugin and no environment variables it reads.

The setup command does not touch your product prices. Switching existing products to the 0% tax category is a separate step, see Price migration.

First steps after installation

  1. Create a zone with the code DE if it is missing (Admin → Configuration → Zones).
  2. Open Admin → MMKreativ Plugins → Kleinunternehmer §19 UStG and activate the regulation, see Configuration.
  3. Migrate existing products, see Price migration.

Console commands

Command Purpose When
mmd:kleinunternehmer:setup Run this plugin's migrations, check the route import After installation and after every update
mmd:kleinunternehmer:migrate-prices Move prices to 0% or restore them Once, when switching over, see Price migration

You do not need to schedule either command.

Update

composer update mmd/sylius-kleinunternehmer-plugin
bin/console mmd:kleinunternehmer:setup
bin/console cache:clear

Uninstall

  1. If products should get their original tax category back, restore the prices first:
    bin/console mmd:kleinunternehmer:migrate-prices --restore
    
    Note the rounding limit of restoring on the Price migration page.
  2. Roll back the migrations while the bundle is still registered, one version at a time, newest first:
    bin/console doctrine:migrations:execute --down "Mmd\SyliusKleinunternehmerPlugin\Migrations\Version20260829160426"
    bin/console doctrine:migrations:execute --down "Mmd\SyliusKleinunternehmerPlugin\Migrations\Version20260828132209"
    bin/console doctrine:migrations:execute --down "Mmd\SyliusKleinunternehmerPlugin\Migrations\Version20260828121602"
    
  3. Remove the route import (config/routes/mmd_sylius_kleinunternehmer.yaml) and the bundle entry in config/bundles.php.
  4. Remove the package:
    composer remove mmd/sylius-kleinunternehmer-plugin
    

The migrations only create the two tables. The 0% tax category kleinunternehmer_zero and its tax rate remain as regular Sylius data. If you delete them, do so only after no variant points to them any more.