The plugin has three independent parts: the lifecycle (creating the tax rate), the migration (changing product data) and the display (templates, controlled by the active setting). There is no cart processor or tax processor of its own.
The plugin class Mmd\Kleinunternehmer\MmdKleinunternehmer uses these values:
| Value | Meaning |
|---|---|
Tax rate name Kleinunternehmer §19 UStG (0%) |
The tax rate is looked up and created under this name (rate 0, position 0). |
core.tax.defaultTaxRate |
Shopware setting for the default tax rate. The plugin sets it to the 0% tax rate on activation. |
MmdKleinunternehmer.config.originalDefaultTaxId |
The previous default tax rate remembered on activation. Deactivation restores it. |
MmdKleinunternehmer.config.createdTaxId |
The ID of the tax rate newly created by the plugin. Uninstall only deletes the tax rate if this is set. |
MmdKleinunternehmer.config.active |
The "Small business regulation active" setting (bool, default false), overridable per sales channel. |
If a tax rate with this name already exists on activation, the plugin uses it and does not record it as created by itself. It is then not deleted on uninstall.
| Class or file | Purpose |
|---|---|
Service\ConfigService |
Reads active with an optional sales channel ID. |
Service\ProductMigrationService |
Finds the 0% tax rate and products by tax rate, writes tax rate and prices in steps of 100 products. Shared by CLI and API. |
Command\MigrateProductTaxCommand |
CLI command mmd:kleinunternehmer:migrate-products. |
Controller\Api\MigrationController |
The two Admin API routes, see Admin API. |
Twig\SmallBusinessExtension |
Twig function mmd_small_business_active(). |
Resources/views/storefront/... |
Storefront template overrides, see Storefront. |
Resources/views/documents/... |
Template overrides for invoice, cancellation and credit note, see Documents and emails. |
Resources/snippet/... |
Storefront snippets (storefront.de-DE, storefront.en-GB) and the document notice (messages.de-DE, messages.en-GB). |
Resources/app/administration/... |
Module with the migration card (component mmd-kleinunternehmer-migration) and its own admin snippets. |
mmd_small_business_active() returns true if active is switched on for the current sales channel. It determines the sales channel from the variable context (storefront) or from the variable order (documents). If neither exists, the general value applies.
The 6.6 line (mmd/sw66-kleinunternehmer, shopware/core ~6.6.0) has the same structure. Compared with the code of the 6.7 line there are these differences:
| Area | 6.7 line | 6.6 line |
|---|---|---|
| Notice texts | Snippets only. | Additionally two text fields in the configuration (card "Notice Texts"): invoiceHint ("Notice text for invoices (optional)") and priceHint ("Notice text for price display (optional)"). A filled-in value overrides the respective snippet, an empty value uses the snippet. |
| Document notice | Snippet document.smallBusinessNotice. |
Value of invoiceHint, otherwise snippet document.smallBusinessNotice. Applies to invoice, cancellation and credit note. |
| Price notice product page | Snippet mmd-kleinunternehmer.grossTaxInformation as a link to the shipping and payment information. |
Value of priceHint, otherwise snippet mmd-kleinunternehmer.taxInfo ("Price without VAT acc. §19 UStG") as plain text without a link. |
| Price notice offcanvas cart | Snippet mmd-kleinunternehmer.grossTaxInformation. |
Value of priceHint, otherwise snippet mmd-kleinunternehmer.taxInfo. |
| Product listing | Own override of the product box with the price notice. | No override, the listing shows Shopware's default texts. |
| Twig functions | mmd_small_business_active() |
Additionally mmd_small_business_price_hint() and mmd_small_business_invoice_hint(). |
| Admin migration card | Confirmation dialog before the migration and a warning above 1,500 products. | Migration starts directly on click, without dialog and without warning. |
| CLI command | Progress bar during the migration. | Same command with the same options, without a progress bar. |
| Admin API permissions | product:read (status), product:update and system_config:read (migration) |
product.viewer (status), product.editor (migration) |
Identical in both lines are plugin class and technical name, lifecycle (tax rate, default tax rate), the configuration key active, the Admin API routes, the name of the CLI command and its options, the price logic, the overrides of the document templates (apart from the notice text), the checkout override and the footer override.