In this Digital Era, People tend to shop more online at their convenience instead of wasting time in a visit to nearest offline stores and It’s necessary for store owners to provide invoice copy for a purchase they have made. E-invoicing is very helpful for store owners in terms of providing instant invoice copies along with the digital signature, which is not only cost effective & environment-friendly but also helps to build trust among customers.

Default Magento comes with functionality of generating invoices out of the box, but majority of the time, it’s not enough for store owners and they often need the invoice to be customized. One of our Clients came up with invoice customization requirement to add product images in invoice PDF in Magento 2. Showing product name along with product image is very useful to recognize product when there is bunch of products are existed.

Quick Steps to Add Product Images in Magento 2 Invoice PDF

All you need to do is just create one Product image function in Invoice.php file available at below location.
app\code\\\Model\Magento\Sales\Order\Pdf\invoice.php

After creating this function, you have to add following code in DefaultInvoice.php file available on below path that displays product image every time it generates new invoice for a product.

\app\code\\\Model\Magento\Sales\Order\Pdf\Items\Invoice

That’s it, after adding this code it will automatically display product image in each and every invoice generated in your Magento store. If you are facing any issue while using this code, I will be glad to help you.
Happy Coding!

[Total: 14   Average: 4.2/5]