Hi!
I'm using Merlin's purchase order module, and I have it working fine, except that I would like a newline in the email output, so that you see
Payment Method
Purchase Order
with the following information:
Account name: TESTING
Account number: TESTING
PO Number: TESTING
I've edited includes/classes/order.php thus:
Code:
$html_msg['PAYMENT_METHOD_FOOTER'] =
(is_object($GLOBALS[$_SESSION['payment']]) ?
sprintf($GLOBALS[$payment_class]->email_footer, $this->info['account_name'],
"\n\n", $this->info['account_number'], "\n\n", $this->info['po_number']) : '');
However, this results in email output like this:
Payment Method
Purchase Order
with the following information: Account name: TESTING Account number: PO Number: TESTING
Before the message boards were archived, I receive these replies:
From Dr. Byte:
shouldn't those be . instead of , in that code for your \n\n additions?
I tried
Code:
$html_msg['PAYMENT_METHOD_FOOTER'] =
(is_object($GLOBALS[$_SESSION['payment']]) ?
sprintf($GLOBALS[$payment_class]->email_footer, $this->info['account_name'] .
"\n\n" . $this->info['account_number'] . "\n\n" . $this->info['po_number']) :
'');
but that produced a PHP error about too few arguments. My reference for PHP says that sprintf does use commas to separate elements of the string, not periods. What is the correct syntax for putting a newline into an sprintf statement? I see there is a PHP nl2br() function. Perhaps I need to insert
Code:
<? echo nl2br($payment_class); ?>
? But I don't believe that these purchase order fields are coded as part of $payment_class, that is why the sprintf function has to be spelled out for each field.
Perhaps a PHP programmer would kindly show me the correct format.
I also got this reply from Richard Fink:
It would be easier if you modify the text template/define called PAYMENT_METHOD_FOOTER.
Just add the line breaks there. If you don't know where it is located, search with the developeres toolkit.
The only place I found where PAYMENT_METHOD_FOOTER is defined is in order.php. Because purchase order is an add-on payment module with extra fields, there doesn't seem to be a way to create a default configuration for it other than adding a line to force the print, as I am trying to do. If I leave out the sprintf statement for account_name, account_number, and po_number it just doesn't get printed in the email.
---Diana
Bookmarks