-
Require plugin with composer:
composer require sylius/invoicing-plugin
-
Add plugin class to your
AppKernel:$bundles = [ new \Knp\Bundle\SnappyBundle\KnpSnappyBundle(), new \Sylius\InvoicingPlugin\SyliusInvoicingPlugin(), ];
-
Import configuration:
imports: - { resource: "@SyliusInvoicingPlugin/Resources/config/config.yml" }
-
Import routing:
sylius_invoicing_plugin_admin: resource: "@SyliusInvoicingPlugin/Resources/config/app/routing/admin_invoicing.yml" prefix: /admin sylius_invoicing_plugin_shop: resource: "@SyliusInvoicingPlugin/Resources/config/app/routing/shop_invoicing.yml" prefix: /{_locale} requirements: _locale: ^[a-z]{2}(?:_[A-Z]{2})?$
-
Check if you have
wkhtmltopdfbinary. If not, you can download it here.In case
wkhtmltopdfis 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: []
-
Copy plugin migrations to your migrations directory (e.g.
src/Migrations) and apply them to your database:cp -R vendor/sylius/invoicing-plugin/migrations/* src/Migrations 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