Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Phone number and email in notification


svobodicz

Recommended Posts

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

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

  • 1 month later...

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...