we have a nice clean pdf invoice but i want to use the smart new 'display order note to customer' function in admin so that if an order note is to be displayed to the customer then that order note will also be published to the pdf
i guess the logic would be - if order note exists and order note display to customer = true then print to pdf
Below is what you will need to add to PDFHelper.cs in order to get Customer Viewable notes to show up on your PDF Invoice. It generates the table exactly the same as Products does and loops through the OrderNotes class only displaying those notes viewable to the customer.
PDFHelper.cs > Methods > PrintOrderToPdf
On my PDF I have the code below inserted directly above 'PdfDocumentRenderer' so it shows up at the bottom of the document below order total, but you should be able to put it wherever you want in the pdf.
for (int i = 0; i < order.OrderNotes.Count; i++) { if (order.OrderNotes[i].DisplayToCustomer == true) { sec.AddParagraph(HtmlHelper.ConvertHtmlToPlainText(OrderManager.FormatOrderNoteText(order.OrderNotes[i].Note)).ToString()); sec.AddParagraph(); sec.AddParagraph(); } }
for (int i = 0; i < order.OrderNotes.Count; i++) { if (order.OrderNotes[i].DisplayToCustomer == true) { sec.AddParagraph(HtmlHelper.ConvertHtmlToPlainText(OrderManager.FormatOrderNoteText(order.OrderNotes[i].Note)).ToString()); sec.AddParagraph(); sec.AddParagraph(); } }
Thanks
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Vous avez encore des questions ou avez besoin d'aide?