Installation

circle-info

This installation instruction assumes that you're using Symfony Flex. If you don't, take a look at the manual installation, but we strongly recommend using Flex for speed and simplicity.

Prerequisites

Before installing the plugin, ensure that your project:

  • Uses Sylius 2.x with Symfony Flex

  • Has Doctrine ORM and Twig properly configured

  • Uses Webpack Encore if customizing templates that require JavaScript assets

  • (Optional) Has the wkhtmltopdf binary installed for PDF generation

1. Enable Community Recipes

Allow Symfony to install community-contributed recipes:

composer config extra.symfony.allow-contrib true

2. Install the Plugin

Run the following command to add the plugin:

composer require sylius/invoicing-plugin

This command installs the plugin and applies the Symfony Flex recipe, registering necessary services and configuration automatically.

3. Run Migrations

The plugin includes database changes. Apply them with:

If you're running in production:

4. [Optional] Configure PDF Generation

To enable or disable PDF invoice generation, and configure save paths, add the following to your configuration:

To set the path to wkhtmltopdf, export this in your environment:

5. [Optional] Generate Invoices for Existing Orders

If you want to generate invoices for orders placed before plugin installation:

6. Clear Cache

Result

After successful installation:

  • Invoices will be generated automatically based on configured order state transitions (default: created)

  • Admins and customers can download invoice PDFs

  • Invoices are accessible in the admin and linked to related orders

Last updated

Was this helpful?