BeHappyCommunication / SyliusInvoicePlugin

A Plugin for Sylius to generate invoices (! deprecated, use sylius/invoicing-plugin instead)
MIT License
13 stars 3 forks source link

[Symfony 3.4] Overriding pdf.html.twig #2

Closed Adraesh closed 6 years ago

Adraesh commented 6 years ago

hello and thanks for this plugin.

I am trying to override the pdf.html.twig to be able to pu my company header but without success even by putting the pdf.html.twig into app/Resources/BehappyInvoicePlugin/view/Invoice folder.

Any idea?

Thanks.

Roshyo commented 6 years ago

Hi,

I did reproduced it indeed, and found a fix. In config.yml, replace the following :

twig:
    paths:
        '%kernel.project_dir%/vendor/behappy/invoice-plugin/src/Resources/views': BehappyInvoice

By :

twig:
    paths:
        '%kernel.project_dir%/app/Resources/BehappyInvoicePlugin/views': BehappyInvoice
        '%kernel.project_dir%/vendor/behappy/invoice-plugin/src/Resources/views': BehappyInvoice

However, I'm sure it's not the right way of doing so in the plugin itself. I'll try to find what is the best way of doing it, since simply removing this block results in an error.

Tell me if this doesn't work for you.

By the way, I'm glad you'r enjoying this plugin, we are currently working on a bunch of Sylius plugins that we'll probably publish on our GitHub.

Adraesh commented 6 years ago

Hi @Roshyo and thank you for the quick answer!

Indeed it worked!

Cheers!