sylius

Sylius InvoicingPlugin : Hi, how can I customize the design of the PDF invoice using the InvoicingPlugin?


Someone has already customized the position of the content for PDF invoices using the InvoicingPlugin in Sylius.

Iwantto change de position of the the seller and the buyer, change logo, and change the color of the invoice. I use from vendor the InvoicingPlugin and i can't change something in the invoice


Solution

  • To customize the appearance of PDF invoices generated by SyliusInvoicingPlugin, you need to overwrite Twig templates.

    1. Find the pdf.html.twig and/or pdfLayout.html.twig files in the vendor/sylius/invoicing-plugin/src/Resources/views/Invoice/Download/ directory and copy them to the templates/bundles/SyliusInvoicingPlugin/Invoice/Download/ directory in your Sylius project.
    2. Make the necessary changes to the design, logo, or color scheme in the copied files.
    3. Clear the Symfony cache using the bin/console cache:clear

    More on how to overwrite twig templates in symfony bundle or check out how to overwrite sylius templates