Resource & Grid
The Invoice is a first-class Sylius Resource. It’s exposed in the Admin as a read-only listing (index) with a “Download PDF” action. You can extend the grid (fields/filters/actions) like any other Sylius grid.
Resource
Learn more about Sylius Resource here.
Extending the Invoice grid
Base grid name: sylius_invoicing_invoice
.
You can add columns, filters, and actions via standard grid config.
Add/adjust columns (Example)
# config/packages/sylius_grid.yaml
sylius_grid:
grids:
sylius_invoicing_invoice:
fields:
number:
type: string
label: sylius_invoicing.ui.invoice_number
issued_at:
type: datetime
label: sylius_invoicing.ui.issued_at
order_number:
type: string
label: sylius.ui.order
path: order.number
customer_email:
type: string
label: sylius.ui.customer
path: order.customer.email
Learn more about grids here.
Where do invoice files live?
When the target state is reached (e.g., paid / created per your config), an immutable PDF is written to the configured directory..
There’s no direct DB relation between
Invoice
and the file. The path is resolved from the invoice number by a provider service.
Order page integration
The Order → Invoices block on the Admin order view is injected via Twig Hooks in Sylius 2.x (replacing the old Sonata events). If you want to move or restyle it, see Extension Points → Twig Hooks & PDF Templates.
Verify your changes
Routes:
bin/console debug:router | grep invoic
Grid config loaded:
bin/console debug:config sylius_grid | less
UI check: open Admin → Invoices and confirm new columns/filters/actions.
Last updated
Was this helpful?