Hello Magento mates,
Invoices are critical documents in every eCommerce business, providing details of product purchases, pricing, taxes, and other relevant information. One of the key customization that merchants often seek is enhancing their invoice PDFs to provide more detailed information, such as the number of products purchased.

This seemingly small feature significantly improves the clarity and organization of invoices for both customers and sellers.

By default, Magento 2 generates clean and structured invoices, but businesses often need more customized layouts to suit their operational needs. Today, in this blog, we will learn to add the number of products on every page of the invoice PDF.

Steps to Add Number of Products Displayed Per Page in Invoice PDF in Magento 2

Step 1 – First, we need to create a “di.xml” file inside our extension at the following path.

app/code/Vendor/Extension/etc/di.xml

Then enter the following code

Step 2 – Following this, we need to create an “Invoices.php” file inside ur extension at the following path.

app/code/Vendor/Extension/Model/Order/Pdf/Invoices.php

After that, enter the following code

Output –

Conclusion

Customizing Magento 2 invoice PDFs to add the number of products displayed per page can be a powerful way to enhance both customer experience and operational efficiency.

With this step-by-step guide, you can easily implement this feature, creating a more detailed and professional invoice for your Magento 2 store.

By following these steps and maintaining good coding practices, you can ensure that your invoice PDFs are as informative and user-friendly as possible.

Click to rate this post!
[Total: 0 Average: 0]