LinuxUK
   Home About us Design services Get in Touch Testimonails Create and account / Log in
Categories
 Premium Sites

 Security checks

 Power OSC

 Free Sites

 Support Club

 Tips and Tricks

 How to guides osC

 My Contributions

Best Buys
RC site
RC site
£100.00
LiveZilla Live Help
Add the Order Number to the Confirmation Subject line
Product stats Product Stats
Products name Product Name: Add the Order Number to the Confirmation Subject line
Products info Product description

I was asked by a customer to add the Order number to the email confirmation subject line.
This information is already present so it was a simple case of a bit of code change to make this happen.

The file we want to work on is the catalog / checkout_process.php file
Open it and find on line 284

  tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 the top line makes up the email that is sent to the customer, the second is sent to the store owner.
The part we are interested is the EMAIL_TEXT_SUBJECT this is the part we are going to change.
The EMAIL_TEXT_SUBJECT is defined in the file catalog / includes / languages <any> / checkout_process.php, it says.
define('EMAIL_TEXT_SUBJECT', 'Order Process'); this is the Order Process you see for an order.

 What we want to do is to add to this the order number, this is already defined in the file as a variable, $insert_id so all we have to do is to enter in into the line like so....

  tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT . $insert_id , $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

now when you get an order email it will say  Order Process2400 which is OK but not really what you want. So you can do the following, this is my way there are a few other ways you can go also, but mine is the correct method.

Add a space, or better still add "order number" before the actual number..... make the following change to the file, catalog / includes / languages <any> / checkout_process.php

define ('EMAIL_TEXT_ORDER_NUMBER', ' Order Number ');  If your store is multi language then add this define to each of the checkout_process.php files under the language folders.

and change the line of code to

  tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT . EMAIL_TEXT_ORDER_NUMBER .  $insert_id , $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 Now the out put will look like, Order Process Order number 284

We can also go on to add the Customers name to the subject line also, to do this you need to do the above and add

define ('EMAIL_TEXT_CUSTOMER_NAME', ' Customers Name '); 

and change the code to ........ 

tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT . EMAIL_TEXT_CUSTOMER_NAME . $order->customer['name'].  EMAIL_TEXT_ORDER_NUMBER .  $insert_id , $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
You may find that you need to add a space between the output Custoemr name and order number, to do this add     .'  ' . so it now looks like.

tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT . EMAIL_TEXT_CUSTOMER_NAME .  $order->customer['name'] .  ' ' .  EMAIL_TEXT_ORDER_NUMBER .  $insert_id , $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

Its as easy as that!

The line we changed above goes to the customer only, the line that send an email to you the store own is found on line 288 and looks like this

  if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
    tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
  }

The change is exactly the same for this line.

Reviews

Add the Order Number to the Confirmation Subject line - Bookmark with Delicious Add the Order Number to the Confirmation Subject line - Bookmark with Digg Add the Order Number to the Confirmation Subject line - Bookmark with Yahoo, My webb Add the Order Number to the Confirmation Subject line - Bookmark with Spurl Add the Order Number to the Confirmation Subject line - Bookmark with Furl Add the Order Number to the Confirmation Subject line - Bookmark with Ask Add the Order Number to the Confirmation Subject line - Bookmark with Sqidoo Add the Order Number to the Confirmation Subject line - Bookmark with Simply Add the Order Number to the Confirmation Subject line - Bookmark with Reddit Add the Order Number to the Confirmation Subject line - Bookmark with Magnolia Add the Order Number to the Confirmation Subject line - Bookmark with Facebook Add the Order Number to the Confirmation Subject line - Bookmark with Google