Editing PDF Invoice and resending order invoice

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 years ago
Hi guys,


I am using Nopcommerce 4.0 and I would like to know how to edit the pdf invoice through admin without having to use a plugin. I would like to add text on the default invoice and now I can only add footer text, but I would like to add text in other places as well.

I would also like to resend the invoice (for customer orders) that allows you to automatically send invoices to customers. I know you can resend invoice using old Nopcommerce versions but I can't find the resend invoice button in Nopcommerce 4.0 unless it has been moved somewhere else. Please help.

Regards
5 years ago
filtershopsa wrote:
Hi guys,


I am using Nopcommerce 4.0 and I would like to know how to edit the pdf invoice through admin without having to use a plugin. I would like to add text on the default invoice and now I can only add footer text, but I would like to add text in other places as well.

Regards


It is not available out of box. you need to customize the code.
5 years ago
Hi Pratik Manek,

I am a novice when it comes to coding, can you please show me where to go and how to edit the code?

Regards
5 years ago
Can you use Visual Studio and have the source code version available to edit ?
How to do it is not so easily detailed in the forum without actually coding it but here is a few pointers

Edit the PDFInvoice in
            
nopCommerce_4.00_Source\Libraries\Nop.Services\Common\PdfService

The routine that sends the email is in
            
nopCommerce_4.00_Source\Libraries\Nop.Services\Orders\OrderProcessingService.cs

see
            //send email notifications
            var orderPlacedStoreOwnerNotificationQueuedEmailId = _workflowMessageService.SendOrderPlacedStoreOwnerNotification(order, _localizationSettings.DefaultAdminLanguageId);
            if (orderPlacedStoreOwnerNotificationQueuedEmailId > 0)
            {
                AddOrderNote(order, $"\"Order placed\" email (to store owner) has been queued. Queued email identifier: {orderPlacedStoreOwnerNotificationQueuedEmailId}.");
            }

I assume you want to add the resend button to the Order Edit page
i.e. add a new button next to PDFInvoice button

See
nopCommerce_4.00_Source\Presentation\Nop.Web\Areas\Admin\Views\Order\Edit.cshtml

If you study how that all works then you can try and link the bits together
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.