Hello Magento Friends,

Today’s subject is Magento 2: How to Add New Field at Order Total Block in Order PDF.

When an order is placed, Magento provides the option for customers to download an order PDF that contains all the details of the buyer, seller, and the product that is being purchased. However, you can add some custom fields to order PDF rather than the default format provided by Magento. Learn How to Change Order PDF Format in Magento 2.

Sometimes we need to add some fields in order total and it should reflect in order PDF as well. For e.g, we are going to add a new tax, ABC TAX, and that will be displayed in order total in order view. But also need to add in order PDF which customers will download for their reference. 

So, here I will explain how you can achieve it.

Steps to Add New Field at Order Total Block in Order PDF in Magento 2:

Let us take an example, I have added ABC TAX 

Step 1: Move to the below path

app\code\Vendor\Extension\etc\pdf.xml

Now add the code as follows

Still, if you want more understanding and customization, you need to understand the Magento core file. Here is the path,

vendor\Magento\Sales\Model\Order\Pdf\Config\Converter.php

To view more tag, you need to check out the following file

vendor\magento\module-sales\etc\pdf_files.xsd

Conclusion:

Hence, this way you can Add New Field at Order Total Block in Order PDF in Magento 2. In case of any difficulty share the issue with me via the comment section. Stay in touch with us so that you do not miss out on any important Magento solution.

Happy Coding!

Click to rate this post!
[Total: 2 Average: 5]