How to Add Order ID in Invoice PDF in Magento 2
Magento 2 order ID can be shown in the sales documents like invoice, shipment, or credit memo. The order ID in Magento 2 makes the admin’s order management task easier.
The admin can get invoice data from order ID as well as the order information in Magento 2.
Not only that, but the customers also use order ID to track their orders in Magento 2 store. The extensions like Magento 2 Order Tracking uses only order ID and email address to let customers track their orders. You can also create barcode and add it in Magento 2 invoice PDF as it helps the customer to scan and get the order id using which it is easy to get order details.
Hence, it can be quite useful to add order ID in invoice PDF in Magento 2.
Steps to Add Order ID in Invoice PDF in Magento 2:
-
Login to Magento 2 admin panel
-
Go to Stores > Settings > Configuration
-
Under Sales, select PDF Print-outs
-
Expand the Invoice sectionto Add Order ID in Invoice PDF in Magento 2
-
Set Yes in Display Order ID in Header to enable order ID in invoice PDF.
-
Click Save Config
That’s it.
The admin can also add order ID in other sales documents like shipment and credit memo.
Once done, the invoice PDF displays the order id as shown here:
If you choose to not add order ID in the sales document, the invoice looks like this:
Moreover, the store owner can use Magento 2 Custom Order Number extension for customizing order numbers by prefixes, suffixes, letters, counter, or any random numbers to match your business needs.
If you have queries, feel free to ask in the Comment section below.
I would like to solve your problem.
Don’t forget to share this post with Magento Community via social media.
Thank you.
Shivbhadrasinh Gohil
Shivbhadrasinh is the Co-founder & Chief Marketing Officer at Meetanshi. He leads the marketing team and is the person behind the marketing & branding success of the company. Being a seasoned digital marketer, he has been consulting online businesses for growth since 2010 and has helped 100+ clients with digital marketing success.
He loves sharing tips and insights about the latest digital marketing trends aimed at helping online business owners.
2 Comments
how can i remove invoice id from pdf
Hello Sagar,
Comment the below line to satisfy mentioned requirement:
$this->insertDocumentNumber($page, __('Invoice # ') . $invoice->getIncrementId());
file path vendor\magento\module-sales\Model\Order\Pdf\Invoice.php
If you want to override this file,then follow the below blog:
https://meetanshi.com/blog/override-magento-2-invoice-pdf/
Thank You