The Shopware standard component for PDF document creation is used to create the quotation PDF. You can find the corresponding configuration under Configuration → Basic settings → Shop settings → PDF document creation. Here you can adapt the document to your requirements by using a template file you have created yourself. The template extends the Shopware standard invoice template index.tpl, which means that the template inherits the basic structure and styling of the invoice template. Click here for Shopware's instructions on how to create or customise PDF documents.
Create or adapt template file
- Create a .tpl file in the folder themes/Frontend/Bare/documents or in the folder of your theme for documents with the following content:
{extends file=“documents/offer.tpl”}
{namespace name=“documents/viison_offer_management/offer”} - Alternatively, you can open the existing template file for the quotation PDF under: /engine/Shopware/Plugins/Community/Backend/ViisonOfferManagement/Views/documents/offer.tpl
- Now, according to the Shopware standard logic for document extension, custom fields can be added. For own fields per position on the document extra_fields blocks are provided.
- Each column of the table (header row and content) can be extended or replaced by blocks.
- Within the table (block name="document_index_table_each") you have access to the item information of the respective offer item via {$position.articleDetail} [instance of the Shopware model Shopware\Models\Article\Detail]. Please note that item information is not necessarily available for every offer item. When accessing the article information of an offer item, you should therefore always first check whether this is also available:
{if $position.articleDetail}
{$position.articleDetail->getNumber()}
{/if} - Afterwards, the name of the "template" must be replaced by the name of the new .tpl file in the PDF document creation.
- Important: The file created must NOT be called "offer.tpl".
Please note that after successfully adjusting the document template, the preview function in the PDF document creation of Shopware may not work correctly for the quotation PDF. The PDF will nevertheless be created correctly when the offer is created.