Override document template

Hi,

I’m trying to override the default document template for deliery notes (index_ls.tpl) but I can’t make it work. If I made the changes in bare/documents/index_ls.tpl I can see those changes in my pdf file but if I create a copy of the file in mytheme/documents/index_ls.tpl nothing seem to happen. I’ve deleted chache and compiled the theme, but nothing.

Anyone have made changes to this?

Hi roberto,

did you set the document template:

2 Likes

@simkli schrieb:

Hi roberto,

did you set the document template:

 

That works like a charm! It totally did the trick for me, thank you so much! :smiley:

 

How did you set the document template? Can you further explain this?

I have the problem with index.tpl

{extends file="parent:documents/index.tpl"}

{block name='document_index_body'}
    Test
{/block}

This doesnt take affect the preview and the generated document at all.

Here is another one with the same problem, that not had been solved. https://forum.shopware.com/discussion/33496/extending-bare-themes-pdf-template-for-invoice

Did it as described in the documentation: https://developers.shopware.com/designers-guide/edit-newsletter-and-document-templates/#edit-document-templates

Please help me.

Hi  zodysaidoo

You can find the document template under the basic configuration > shops > Document template (on the right). Selecting the one you are modifying should work for you. if you can’t see any change at the moment could be Shopware is usnig a different document template than the one you are amending

Hope this will help you

I have the same problem - or worse: Even if I modify the index.tpl inside the “Bare” theme, it has no effect to the resulting PDF. If I set another - invalid - template name, I got an error as expected. If I then copy the index.tpl inside the “Bare” theme to the new name, I do not longer get an error - good - but an empty PDF.

Very strange. Any help is greatly appreciated.

Update: Changing the index.tpl inside the “Bare” theme indeed has an effect. But the rest of the problems remain.