svobodicz Posted November 10, 2008 Share Posted November 10, 2008 Hi, I would need to add phone number and email address to email notification. I tried to modify source code, however I am not able to get what I want. Here goes my adjustment. The result looks like I cannot get email and phone number from database. Can anyone help me with it, please, or is it elsewhere solved? Thank you!! ----file checkout_proces.php---- find this: if ($order->content_type != 'virtual') { $email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n"; } and after add: if ($order->content_type != 'virtual') { $email_order .= "\n" . EMAIL_TEXT_TELEPHONE . "\n" . EMAIL_SEPARATOR . "\n" . tep_phone_label($customer_id, $sendto, 0, '', "\n") . "\n"; } if ($order->content_type != 'virtual') { $email_order .= "\n" . EMAIL_TEXT_EMAIL . "\n" . EMAIL_SEPARATOR . "\n" . tep_phone_label($customer_id, $sendto, 0, '', "\n") . "\n"; } ----file includes/functions/general.php---- around line 500 find this function: function tep_address_label($customers_id, $address_id = 1, $html = false, $boln = '', $eoln = "\n") { $address_query = tep_db_query............ and after add: function tep_phone_label($customers_id, $address_id = 1, $html = false, $boln = '', $eoln = "\n") { $email_query = tep_db_query("select customers_telephone from customers where customers_id = '" . (int)$customers_id . "'"); $phone_number = tep_db_fetch_array($email_query); $format_id = tep_get_address_format_id($address['country_id']); return tep_address_format($format_id, $phone_number, $html, $boln, $eoln); } function tep_email_label($customers_id, $address_id = 1, $html = false, $boln = '', $eoln = "\n") { $email_query = tep_db_query("select customers_email_address from customers where customers_id = '" . (int)$customers_id . "'"); $email_address = tep_db_fetch_array($email_query); $format_id = tep_get_address_format_id($address['country_id']); return tep_address_format($format_id, $email_address, $html, $boln, $eoln); } ----file includes/languages/english/general.php---- add these two lines: define('EMAIL_TEXT_TELEPHONE', 'Telefon'); define('EMAIL_TEXT_EMAIL', 'Email'); Link to comment Share on other sites More sharing options...
Guest Posted November 11, 2008 Share Posted November 11, 2008 instead of: function tep_phone_label($customers_id, $address_id = 1, $html = false, $boln = '', $eoln = "\n") { $email_query = tep_db_query("select customers_telephone from customers where customers_id = '" . (int)$customers_id . "'"); $phone_number = tep_db_fetch_array($email_query); $format_id = tep_get_address_format_id($address['country_id']); return tep_address_format($format_id, $phone_number, $html, $boln, $eoln); } try function tep_phone_label($customers_id) { $email_query = tep_db_query("select customers_telephone from customers where customers_id = '" . (int)$customers_id . "'"); $phone_number = tep_db_fetch_array($email_query); return $phone_number['customers_telephone']; } and use: tep_phone_label($customer_id) Link to comment Share on other sites More sharing options...
svobodicz Posted November 11, 2008 Author Share Posted November 11, 2008 It works!! Thank you very much :) Link to comment Share on other sites More sharing options...
cinolas Posted January 10, 2009 Share Posted January 10, 2009 Hello, I don't know php and I also need to add the client's email address and phone number to the email notification but I'm not understanding those two steps instructions. Could someone who knows php merge these two posts into one set of instructions for me please ? :) Like: In this file find this, replace with this, etc.. Essentially it's the "and use: tep_phone_label($customer_id)" part that eludes me, the rest I understand and can follow. Thank you! Link to comment Share on other sites More sharing options...
cinolas Posted January 10, 2009 Share Posted January 10, 2009 Well I think I've figured it out Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.