Adding Customer ID# to Packaging Slip PDF

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Hace 13 años
Hi guys, I've been trying to add a simple Customer # into our packaging slip PDF (which we've annexed into back-office paperwork for processing into our asset system), this would be really handy as then we could take the slip and correlate the nopcommerce generated customer ID with our in-house system customer number. I edited PDFhelper.cs and placed the following underneath the order ID# code:


Paragraph p1 = section.AddParagraph(String.Format("{0} #{1}", localizationManager.GetLocaleResourceString("PdfPackagingSlip.Order"), order.OrderId));
                Paragraph p11 = section.AddParagraph(String.Format("Customer #: ", order.CustomerId));


When I open up the PDF from the administration panel, all I get is Customer #: and no number, which I'm guessing is because either there's no customer # column in the database for Orders, or I'm just not referring to it correctly?

Any help would be much appreciated and +repped. Thanks in advance!
Hace 13 años
In the line you added, the format item {0} is missing.

Change your code from:
Paragraph p11 = section.AddParagraph(String.Format("Customer #: ", order.CustomerId));

to the following (change underlined):
Paragraph p11 = section.AddParagraph(String.Format("Customer #: {0}", order.CustomerId));

You will need to recompile to see the change.

.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.