-
Require plugin with composer:
composer require sylius/invoicing-plugin
-
Add plugin class and other required bundles to your
config/bundles.php
:$bundles = [ Knp\Bundle\SnappyBundle\KnpSnappyBundle::class => ['all' => true], Sylius\InvoicingPlugin\SyliusInvoicingPlugin::class => ['all' => true], ];
-
Import configuration:
imports: - { resource: '@SyliusInvoicingPlugin/config/config.yaml' }
-
Import routes:
sylius_invoicing: resource: "@SyliusInvoicingPlugin/config/routes.yaml"
-
Check if you have
wkhtmltopdf
binary. If not, you can download it here.In case
wkhtmltopdf
is not located in/usr/local/bin/wkhtmltopdf
, add a following snippet at the end of your application'sconfig.yml
:knp_snappy: pdf: enabled: true binary: /usr/local/bin/wkhtmltopdf # Change this! :) options: []
-
Apply migrations to your database:
bin/console doctrine:migrations:migrate
-
If you want to generate invoices for orders placed before plugin's installation run the following command using your terminal:
bin/console sylius-invoicing:generate-invoices
-
Clear cache:
bin/console cache:clear