FLUX-SE / SyliusEUVatPlugin

This Sylius Plugin allow you to add European VAT Number to the addresses and manage European VAT number rule
MIT License
16 stars 8 forks source link

Extend templates #8

Closed kappaj closed 5 years ago

kappaj commented 5 years ago

I have some problems extending the @SyliusShop/Checkout/Address/_form.html.twig Template. Because of the CompilerPass in PrometeeSyliusVIESClientPlugin, the common way to override templates is not working. Is there an good way to override the form template without writing my own CompilerPass?

Prometee commented 5 years ago

Normally you just have to add a new twig file into /templates/bundles/SyliusShopBundle/Checkout/Address/_form.html.twig and it will be overrode. The CompilerPass used into PrometeeSyliusVIESClientPlugin is just a quick way to override the Sylius base template letting the user override it into /templates/bundles/*.

The file your are mentioning is not used into this plugin maybe you forgot to cache:clear because the list of overrides are built during the warmup, so if you add or delete an overrode file you should clear the cache.

kappaj commented 5 years ago

Oh it was the wrong file. I mean @SyliusShop/Common/Form/_address.html.twig I have a file in the /templates/bundles/* folder but after installing the plugin it is not recognized anymore.

Prometee commented 5 years ago

Let me retest it

Prometee commented 5 years ago

I have no easy way to avoid copying those templates overrides so I delete the CompilerPass, add a new section into the README to explain how to copy those overrides, and I move src/Resources/views/overrides/* one folder up.

New release is coming

kappaj commented 5 years ago

Good solution. Thank you!