Small Business: Storefront
Where and when the Sylius plugin Small Business §19 UStG shows its notice in the storefront: product page, cart, checkout, credit memo PDF, hook positions and Twig functions.
Small Business: Storefront
Live Demo: Try this and other plugins live — no installation, no risk: demo.markus-michalski.net
Where the notice appears
While the regulation is active, the plugin inserts the notice through Twig hooks wherever customers see a price or a tax total. You do not have to adapt any template.
| Place | Hook | Position |
|---|---|---|
| Product page | sylius_shop.product.show.content.info.summary.prices |
below the prices |
| Product card (listings, recommendations) | sylius_shop.shared.product.card.prices |
below the prices |
| Cart | sylius_shop.cart.index.content.form.sections.general.summary |
directly below "Taxes total" |
| Checkout sidebar (address, shipping, payment) | sylius_shop.checkout.common.sidebar.summary.total |
between "Taxes total" and "Total" |
| Order summary (checkout completion and order history in the account) | sylius_shop.shared.order.show.summary.table_summary |
below "Total" |
The product page, product card and cart use a paragraph template, the two table-based summaries use a table row.
When the notice appears
The notice appears only if the regulation is active and the notice fits the respective object:
| Place | Condition |
|---|---|
| Cart, checkout, order | Both tax totals of the cart or order are 0 |
| Product variant | The variant is on the tax category kleinunternehmer_zero |
| Product | The product has enabled variants, and all enabled variants are on kleinunternehmer_zero |
Without a cart, order, variant or product the notice stays off: a tax statement that cannot be verified is worse than none.
graph TD
A["Hook renders the notice template"] --> B{"Regulation active?"}
B -->|No| Z["No notice"]
B -->|Yes| C{"Cart or order in context?"}
C -->|Yes| D{"Both tax totals 0?"}
C -->|No| E{"Variant or product in context?"}
D -->|Yes| Y["Show notice"]
D -->|No| Z
E -->|Yes| F{"All relevant variants on kleinunternehmer_zero?"}
E -->|No| Z
F -->|Yes| Y
F -->|No| Z
An order placed before the regulation was switched shows the notice only if its tax totals are actually 0. A partially migrated cart does not show it, because the notice would otherwise sit next to a "Taxes total" line with an amount.
Notice text
You edit the text in the admin, see Configuration. Without your own text these defaults apply:
| Language | Text |
|---|---|
| German | Gemäß §19 UStG wird keine Umsatzsteuer berechnet. |
| English | No VAT charged according to §19 UStG (German small business regulation). |
The notices carry the CSS class mmd-kleinunternehmer-notice and, in the storefront, additionally text-secondary small, in the table rows also text-end. The notice in the credit memo PDF has only mmd-kleinunternehmer-notice. You can use these to adjust the appearance in your theme.
Moving or disabling the notice
All five hooks register the hookable kleinunternehmer_notice. The priority determines the position: -100 for product page, product card and order summary, 150 for the cart, 50 for the checkout sidebar. In your own sylius_twig_hooks configuration you can disable it under the same hook name with enabled: false or move it with a different priority. The template IDs are @MmdSyliusKleinunternehmerPlugin/shop/product/kleinunternehmer_notice.html.twig (paragraph) and @MmdSyliusKleinunternehmerPlugin/shop/order_summary/kleinunternehmer_notice_row.html.twig (table row).
Credit memo PDF
If sylius/refund-plugin is installed, this plugin replaces the template of the credit memo PDF with a variant that extends the original and adds the notice below the table. The notice appears only if the regulation is active and the credit memo contains no tax. It is written in the language the credit memo was issued in and uses the same text as the storefront, including your admin overrides.
The refund plugin is not a dependency. If it is not installed, nothing changes. If another extension has already replaced the credit memo template, this plugin leaves it untouched.
Invoices and cancellation documents are not handled by the plugin. The notice is not added there, only on credit memos of the refund plugin.
Twig functions
For your own templates the plugin provides these functions:
| Function | Returns | Description |
|---|---|---|
kleinunternehmer_active() |
bool |
Is the regulation active? |
kleinunternehmer_notice_applies(order, variant, product) |
bool |
Does the notice apply to the passed object? All three arguments are optional, you pass one of them |
kleinunternehmer_notice_applies_to_tax_total(taxTotal) |
bool |
Active and taxTotal is 0? For documents that only know a tax total |
kleinunternehmer_notice_text(locale) |
string |
Notice text in the given language, in the current request language if omitted |
kleinunternehmer_plugin_version() |
string |
Installed plugin version, as shown under the title in the admin |
Example of your own notice in a theme template:
{% if kleinunternehmer_notice_applies(order) %}
<p class="mmd-kleinunternehmer-notice">{{ kleinunternehmer_notice_text() }}</p>
{% endif %}
Theme compatibility
The hooks attach to the standard Sylius markup. If your theme replaces one of the templates that contain one of these hook points and no longer renders the hook, the notice disappears there too. In that case render the hook again or use the Twig functions above directly.