Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

problem inserting customer fax number into order confirmation email


mohawk

Recommended Posts

I am having a problem with adding the customer fax number into the order confirmation email

 

I can insert the customers telephone number into the email no problem by adding the line

 

tep_db_output($order->customer['telephone']) to the checkout_process.php file in the catalog directory

 

but when I enter fax, the information doesnt show up.......

 

any help or insight into this will be greatly appricated

 

Thanks

 

sean

Link to comment
Share on other sites

first you should have a field called customers_fax in customer table (most probably this is already there)

 

in checkout_process.php, below $payment_modules->before_process();

 

look for $sql_data_array = array('customers_id' => $customer_id,

 

in there below customer_telephone add

 'customers_fax' => $order->customer['fax'],

 

open catalog/includes/classes/order.php.. look for $order_id = tep_db_prepare_input($order_id); $order_query = tep_db_query(

 

add

 customers_fax,

after customers_telephone

 

look for $this->customer = array('id' same page.. add

'fax' => $order['customers_fax'],

below telephone

 

look for $customer_address_query = tep_db_query( add

c.customers_fax,

after telephone

 

look for $this->customer = array('firstname' => $customer_address['customers_firstname'], add

 'fax' => $customer_address['customers_fax'],

after telephone

 

to make this appear in admin/order.php

 

make changes in admin/order.php

 

add this above include(DIR_WS_CLASSES . 'order.php');

 

// Look up things in orders
 $the_extra_query= tep_db_query("select * from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
 $the_extra= tep_db_fetch_array($the_extra_query);
 $the_customers_id= $the_extra['customers_id'];
// Look up things in customers
 $the_extra_query= tep_db_query("select * from " . TABLE_CUSTOMERS . " where customers_id = '" . $the_customers_id . "'");
 $the_extra= tep_db_fetch_array($the_extra_query);
 $the_customers_fax= $the_extra['customers_fax'];

 

add this where you need to show the fax no.

 

	 <tr>
			<td class="main"><b><?php echo 'FAX #:'; ?></b></td>
			<td class="main"><?php echo $the_customers_fax; ?></td>
		  </tr>

l8ter

Link to comment
Share on other sites

Another way:

 

Add this code to /catalog/checkout_process.php

 

	  $fax_query = tep_db_query("select customers_fax  from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
  $fax = tep_db_fetch_array($fax_query);

Then where you want to use the fax number do it similar to this:

 

  echo $fax['customers_fax'];

Note to the previous poster:

 

I'm not trying to "one up" you here.

:blush:

 

I started piddling with the code to do this, and when I get ready to post it I find someone else has already replied!

 

So, i thought I'd just post my code anyway since I spent the time to work on it.

;)

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

No need that I can see to make any other changes. All the OP wants to do is add it to the email not to the order that gets stored in the DB.

 

I tested this code and it worked (in another PHP file).

 

Although simply adding the fax number to the query already in the code (like you've suggested) would be better.

 

Trouble is I can't test that!

:lol:

 

And I'm not sure I could even do it successfully.

:blush:

 

I'm not very MYSQL literate.

:o

 

That's why I took the approach I did.

:)

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...