Manual installation
This page describes how to install the Invoicing Plugin in older Sylius or Symfony projects that do not use Symfony Flex and cannot rely on automatic recipe configuration.
Step 1: Require the Package
In your composer.json
, add:
"require": {
"sylius/invoicing-plugin": "^2.0"
}
Then run:
composer update
Step 2: Register Bundles (if not auto-registered)
In your kernel (e.g. config/bundles.php
or equivalent), register:
return [
// ...
Sylius\InvoicingPlugin\SyliusInvoicingPlugin::class => ['all' => true],
];
Or if using Flex‑less configuration: register the bundle in your AppKernel.
Step 3: Configuration
Create a config file, e.g. config/packages/sylius_invoicing.yaml
(or in your bundle config paths), with:
sylius_invoicing:
pdf_generator:
enabled: true
invoice_save_path: '%kernel.project_dir%/var/invoices'
Also make sure to load any routing configuration:
In config/routes/invoicing.yaml
:
sylius_invoicing:
resource: "@SyliusInvoicingPlugin/Resources/config/routing.yaml"
prefix: /admin
Or adjust prefix as needed.
Step 4: Doctrine & Migrations
Copy or include the plugin’s migrations into your project.
Run:
bin/console doctrine:migrations:migrate
Ensure your migrations path includes the plugin migrations.
Step 5: Publish Assets & Templates (if needed)
If the plugin has assets or template resources, copy or override them:
php bin/console assets:install public
# Or manually symlink or copy templates from vendor/Sylius/InvoicingPlugin/Resources/views
Step 6: (Optional) Generate Invoices for Existing Orders
bin/console sylius-invoicing:generate-invoices
Step 7: Clear Cache & Warmup
bin/console cache:clear
bin/console cache:warmup
Notes & Caveats
Since you’re bypassing Symfony Flex, ensure that service definitions, autoconfiguration, and autowiring are properly loaded (e.g. via
services.yaml
includes).Be careful to match paths, bundle namespaces, and resource loading setups.
Test invoice generation, file creation, and download UI after setup to confirm that configuration and wiring are correct.
Last updated
Was this helpful?