Totally Zenned
- Join Date:
- Apr 2007
- Location:
- Dayton, Ohio
- Posts:
- 682
- Plugin Contributions:
- 0
Adding extra fields to admin copy of order confirmation email, and orders area.
I have added an add-on module that allows me to add custom fields to the customer during signup. I really need these fields sent to the Admin order confirmation e-mail if possible. And once past this step perhaps I can also have these data fields show up on the shipping address of the orders area.
First my greatest need is to have the extra data fields added to my order confirmation e-mails. I have read this post: but for some reason I am just not getting it. My extra fields are labeled as: extrafield, extrafield2, extrafield3
I am assuming I need to add definitions to the: includes/classes/order.php. I would like the: extrafield2 and extrafield3 to show up right under the persons name, and the extrafield to show up on top of the shipping address. I would also like to have the label and the answer (i.e. etrafield2 would be: Chapter Letters, and their answer might look like: AN. It would be nice to show question and answer together).
So this is what I have added to my order.php file:
Line #936
Original Code:
// lets start with the email confirmation
// make an array to store the html version
$html_msg=array();
//intro area
$email_order = EMAIL_TEXT_HEADER . EMAIL_TEXT_FROM . STORE_NAME . "\n\n" .
$this->customer['firstname'] . ' ' . $this->customer['lastname'] . "\n\n" .
EMAIL_THANKS_FOR_SHOPPING . "\n" . EMAIL_DETAILS_FOLLOW . "\n" .
EMAIL_SEPARATOR . "\n"
Modified Code:
// lets start with the email confirmation
// make an array to store the html version
$html_msg=array();
//intro area
$email_order = EMAIL_TEXT_HEADER . EMAIL_TEXT_FROM . STORE_NAME . "\n\n" .
$this->customer['firstname'] . ' ' . $this->customer['lastname'] . "\n\n" .
$this->customer['extrafield2']. "\n\n" .
$this->customer['extrafield3']. "\n\n" .
EMAIL_THANKS_FOR_SHOPPING . "\n" . EMAIL_DETAILS_FOLLOW . "\n" .
EMAIL_SEPARATOR . "\n"
For the billing address area where I would like the lone extrafield to show I have this (Around line #987):
Original Code:
//addresses area: Delivery
$html_msg['HEADING_ADDRESS_INFORMATION']= HEADING_ADDRESS_INFORMATION;
$html_msg['ADDRESS_DELIVERY_TITLE'] = EMAIL_TEXT_DELIVERY_ADDRESS;
Modified Code:
//addresses area: Delivery
$this->customer['extrafield']. "\n\n" .
$html_msg['HEADING_ADDRESS_INFORMATION']= HEADING_ADDRESS_INFORMATION;
$html_msg['ADDRESS_DELIVERY_TITLE'] = EMAIL_TEXT_DELIVERY_ADDRESS;
During testing the first example with extrafield2 and extrafield3 displayed blank results (there were blank spaces where the data would show) and the second example just did not show at all (no spaces nothing).
Obviously for a PHP coder would see the issue, but I just do not know PHP hence my poor writing skills above. Anyone?