Ok, I got the new field sent in the email. Here are the steps I took. Feedback is appreciated on if I am leaving anything out or if I am doing something "wrong". Also, I didn't override the order.php class file. I backed up the original and overwrote the file. Can you override this file?
In the Payment Module file I added/edited the following code:
PHP Code:
function process_button() {
$process_button_string = zen_draw_hidden_field('accountNum', $_POST['accountNum']);
return $process_button_string;
}
and
PHP Code:
function before_process() {
global $order;
$order->info['accountNum'] = $_POST['accountNum'];
}
and
PHP Code:
function confirmation() {
$confirmation = array('id' => $this->code,
'module' => $this->title,
'fields' => array(array('title' => MODULE_PAYMENT_ACCOUNTHOLDER_ACCOUNTNUMBER_TITLE,
'field' => ': ' . $_POST['accountNum'])
));
return $confirmation;
}
and
PHP Code:
function selection() {
global $order;
$selection = array('id' => $this->code,
'module' => $this->title,
'fields' => array(array('title' => MODULE_PAYMENT_ACCOUNTHOLDER_ACCOUNTNUMBER_TITLE,
'field' => zen_draw_input_field('accountNum', '', 'id="accountNum"' . $onFocus))
));
return $selection;
}
In the order.php class file I added:
PHP Code:
//addresses area: Billing **** CODE ADDED IN THIS SECTION ****
...
//ADD THE ACCOUNT NUMBER IF IT EXISTS
if ($this->info['accountNum'])
$email_order .= $this->info['accountNum'] . "\n\n";
...
and
PHP Code:
$this->info = array('currency' => $order->fields['currency'],
'currency_value' => $order->fields['currency_value'],
'payment_method' => $order->fields['payment_method'],
'payment_module_code' => $order->fields['payment_module_code'],
'shipping_method' => $order->fields['shipping_method'],
'shipping_module_code' => $order->fields['shipping_module_code'],
'coupon_code' => $order->fields['coupon_code'],
/*added this line */ 'accountNum' => $order->fields['accountNum'],
'cc_type' => $order->fields['cc_type'],
'cc_owner' => $order->fields['cc_owner'],
'cc_number' => $order->fields['cc_number'],
'cc_expires' => $order->fields['cc_expires'],
'date_purchased' => $order->fields['date_purchased'],
'orders_status' => $order_status->fields['orders_status_name'],
'last_modified' => $order->fields['last_modified'],
'total' => $order->fields['order_total'],
'tax' => $order->fields['order_tax'],
'ip_address' => $order->fields['ip_address']
);