Document customization
The PDF documents are intentionally configuration-driven — most layout changes are switches and number inputs in plugin settings, not Twig template edits.
What you can change in settings
Section titled “What you can change in settings”| Change | Where |
|---|---|
| Add a product custom field as an extra column | |
| Set that column’s width | Additional column 1 width (px) |
| Show / hide photo, product number, manufacturer number, EAN | Columns to display in the items list |
| Choose which line-item types to print | Types of items to display |
| Hide digital items | Don’t show digital items |
| Sort order | Sort order + Sort direction |
| Group rows (Items List) | Group by |
| Show / hide payment, shipping, summary blocks (Packing Slip) | Show payment method / shipping method / order summary |
| Adjust font sizes | Font size, Line item font size, Comment font size |
| Bold the customer comment | Bold font for comment |
| Highlight quantity > 1 | Highlight quantity switch |
Each PDF type (Packing Slip, Items List) has its own card so the two layouts are tuned independently.
Custom field column
Section titled “Custom field column”The custom-field selector accepts any product custom field. In your output:
- The column title is the custom field’s label.
- The cell value is the custom field’s value for that product, with no formatting beyond escaping.
- Empty values render as an empty cell.
Use cases: warehouse location (storage_location), batch code, age-restriction flag, weight, packaging notes.
Typography ladder
Section titled “Typography ladder”Three font-size knobs cover almost every readability need:
- Font size — the base text size used for addresses, headers, footer.
- Line item font size — usually larger than the base so pickers can read it at arm’s length.
- Comment font size — the customer’s checkout note, sized independently from line items because the comment is “soft” content vs. the “hard” pick list.
The defaults — 12 / 14 / 12 — work for most A4 prints. Bump them up by 2 – 4 for thermal printers and large-format readability.
Beyond settings: editing templates
Section titled “Beyond settings: editing templates”If switches and font sizes don’t cover what you need, the Twig templates live at:
src/Resources/documents/ view_orders.html.twig ← Packing Slips view_items.html.twig ← Items ListThese are standard Shopware Twig templates that can be overridden from your project (e.g. Resources/views/storefront/documents/ in your shop’s plugin / theme override). Common edits:
- Custom header / footer with shop branding.
- Conditional sections for specific sales channels or shipping methods.
- Page break tweaks (Dompdf respects
page-break-after: alwaysetc.).
When overriding, keep in mind the document is rendered by Dompdf — CSS support is a subset of full browser CSS. Stick to layout primitives (table-based layouts, simple float / display rules, no flexbox / grid).
Page numbering
Section titled “Page numbering”The “X / Y” page footer is added in PHP after Dompdf has rendered the document, by reading the Dompdf canvas. It’s not part of the Twig template — don’t try to add your own “page” placeholder, it will collide.