Guest Posted November 12, 2005 Share Posted November 12, 2005 Hi all, I was wondering can you add the customers name, and phone number to the order process email? At the moment all we get is this billing address but no email address, phone or name. If anyone knows how to do this I would appreciate it if you let me know. Thanks in advance :D Link to comment Share on other sites More sharing options...
jefs.42 Posted November 12, 2005 Share Posted November 12, 2005 Hi all, I was wondering can you add the customers name, and phone number to the order process email? At the moment all we get is this billing address but no email address, phone or name. If anyone knows how to do this I would appreciate it if you let me know. Thanks in advance :D edit checkout_process.php and use $order->customer['telephone'] and $order->customer['email_address']. There are 3 options for name: $order->customer['firstname] $order->customer['lastname'] $order->billing['firstname] $order->billing['lastname'] $order->delivery['firstname] $order->delivery['lastname'] You can stick these any wherever you like farther down checkout_process.php in the section after: // lets start with the email confirmation Link to comment Share on other sites More sharing options...
Guest Posted November 12, 2005 Share Posted November 12, 2005 Hey thanks for your help. I have tried this out but have not had any luck below is my checkout_process.php document - from "//lets start with the email confirmation" section. // lets start with the email confirmation /****************************************************** * Email Invoice 1.1. * Author Contact: [email protected] ******************************************************/ if (EMAIL_INVOICE == 'true') { require(DIR_WS_MODULES . EMAIL_INVOICE_DIR . FILENAME_EMAIL_INVOICE); } else { /**** End of Email Invoice Mod Snippet ****/ /*========================================*/ $email_order = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n"; if ($order->info['comments']) { $email_order .= tep_db_output($order->info['comments']) . "\n\n"; } $email_order .= EMAIL_TEXT_PRODUCTS . "\n" . EMAIL_SEPARATOR . "\n" . $products_ordered . EMAIL_SEPARATOR . "\n"; for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n"; } 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"; } $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $billto, 0, '', "\n") . "\n\n"; if (is_object($$payment)) { $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . EMAIL_SEPARATOR . "\n"; $payment_class = $$payment; $email_order .= $payment_class->title . "\n\n"; if ($payment_class->email_footer) { $email_order .= $payment_class->email_footer . "\n\n"; } } tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); // send emails to other people if (SEND_EXTRA_ORDER_EMAILS_TO != '') { tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); } /*=======================================================================*/ /**** Email Invoice Mod Snippet ****/ } /**** End of Email Invoice Mod Snippet ****/ /*=======================================================================*/ // load the after_process function from the payment modules $payment_modules->after_process(); $cart->reset(true); // unregister session variables used during checkout tep_session_unregister('sendto'); tep_session_unregister('billto'); tep_session_unregister('shipping'); tep_session_unregister('payment'); tep_session_unregister('comments'); tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL')); require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> Let me know if you need anything else. Link to comment Share on other sites More sharing options...
jefs.42 Posted November 12, 2005 Share Posted November 12, 2005 first look around line 57 for $sql_data_array = array('customer_id' => $customer_id, the following lines show a bunch of customer/billing/delivery info available to you. So say you wanted to add telephone, and email just below the billing address. Find: $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $billto, 0, '', "\n") . "\n\n"; and add this below the tep_address_label line: $email_order .= $order->customer['telephone'] . "\n" . $order->customer['email_address'] . "\n\n"; i made our emails html so mine looks like: $email_order .= "<br>" . $order->customer['email_address'] . "<br>"; and it works fine, only difference being mine using <br> instead of \n is telephone required at signup? if not, $order->customer['telephone'] might be empty. but firstname, lastname, and email definitely are because you can see they are used in the tep_mail function to send the confirmation email. Link to comment Share on other sites More sharing options...
Guest Posted November 13, 2005 Share Posted November 13, 2005 Hey - thanks for that - slight problem which I can't seem to fix. Below is a copy of the email Phill4 Address Road Suburb Tauranga, 3001 New Zealand [email protected] Method ------------------------------------------------------ Cash on Pickup As you can see it hyperlinks the email address an phone number and also the Payment method. How can I make it so that each of them are on a new link? I tried putting a seperator section into the code but did not seem to fix it. Here is the code from order_process.php $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $billto, 0, '', "\n") . "\n\n"; EMAIL_SEPARATOR . "\n" . $email_order .= "<br>" . $order->customer['email_address'] . "<br>"; EMAIL_SEPARATOR . "\n" . $email_order .= $order->customer['telephone'] . "<br>"; if (is_object($$payment)) { $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . EMAIL_SEPARATOR . "\n"; $payment_class = $$payment; $email_order .= $payment_class->title . "\n\n"; if ($payment_class->email_footer) { $email_order .= $payment_class->email_footer . "\n\n"; } } tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); // send emails to other people if (SEND_EXTRA_ORDER_EMAILS_TO != '') { tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); } /*=======================================================================*/ /**** Email Invoice Mod Snippet ****/ Thanks for your help so far. Link to comment Share on other sites More sharing options...
Guest Posted November 14, 2005 Share Posted November 14, 2005 Can anyone help me with this please? Link to comment Share on other sites More sharing options...
jefs.42 Posted November 15, 2005 Share Posted November 15, 2005 you're all good! but ya may need to play with it a bit. How's email set in admin? HTML or not? might need to add another <br> or \n. you got it though. it's just playin' w/ it a bit. had the same problem (still do sometimes) cause at first the client wanted it HTML w/ links and all, then they also wanted email,phone. and yeah get the line breaks right was kinda a pain. trial and error - adjusted something, place an order, checked the email, repeat... if nothing else, just put a \n after all your <br>'s that way it's a line break either way. Link to comment Share on other sites More sharing options...
Skeetergirl Posted January 2, 2006 Share Posted January 2, 2006 you're all good! but ya may need to play with it a bit. How's email set in admin? HTML or not? might need to add another <br> or \n. you got it though. it's just playin' w/ it a bit. had the same problem (still do sometimes) cause at first the client wanted it HTML w/ links and all, then they also wanted email,phone. and yeah get the line breaks right was kinda a pain. trial and error - adjusted something, place an order, checked the email, repeat... if nothing else, just put a \n after all your <br>'s that way it's a line break either way. I've put all this information in and am still not getting any of the extra information. :( Can someone help me please? I'm still getting this: Spanish Town Mardi Gras Online Store ------------------------------------------------------ Order Number: 131 Detailed Invoice: https://XXXXXXXX.com/XXXXXX/catalog/account...hp?order_id=131 Date Ordered: Monday 02 January, 2006 Trying to add an extra email field. Products ------------------------------------------------------ 1 x TEST ITEM () = $0.10 ------------------------------------------------------ Sub-Total: $0.10 Free shipping: $0.00 Total: $0.10 Delivery Address ------------------------------------------------------ Deborah XXXX XXXXXXXXXX Baton Rouge, LA XXXXXX United States Billing Address ------------------------------------------------------ Deborah XXXX XXXXXXXXXX Baton Rouge, LA XXXXX United States Payment Method ------------------------------------------------------ PayPal Link to comment Share on other sites More sharing options...
Skeetergirl Posted January 3, 2006 Share Posted January 3, 2006 Can someone please help with this? I have the mod fancier invoice and packing slip installed and that works fine. I thought since that looks great and has all the information I need I decided that maybe using that and installing the mod Email Invoice 1.1, which uses the fancier invoice would solve the problem but it didn't! I still just get the same! Please someone help. It would be so much better for me to have the email address and phone number to call customers since the biggest item is "tables" that have to be reserved at an event. Thanks in advance! Link to comment Share on other sites More sharing options...
Skeetergirl Posted January 3, 2006 Share Posted January 3, 2006 Could THIS be the cause of my problem? When I check my SQL database I get this warning: Problems with indexes of table `orders_session_info` PRIMARY and INDEX keys should not both be set for column `txn_signature` Problems with indexes of table `paypal` PRIMARY and INDEX keys should not both be set for column `paypal_id` Thanks in advance for any help! Link to comment Share on other sites More sharing options...
ctrc_rover Posted January 6, 2006 Share Posted January 6, 2006 Hey - thanks for that - slight problem which I can't seem to fix. Below is a copy of the emailAs you can see it hyperlinks the email address an phone number and also the Payment method. How can I make it so that each of them are on a new link? I tried putting a seperator section into the code but did not seem to fix it. Here is the code from order_process.php $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $billto, 0, '', "\n") . "\n\n"; EMAIL_SEPARATOR . "\n" . $email_order .= "<br>" . $order->customer['email_address'] . "<br>"; EMAIL_SEPARATOR . "\n" . $email_order .= $order->customer['telephone'] . "<br>"; if (is_object($$payment)) { $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . EMAIL_SEPARATOR . "\n"; $payment_class = $$payment; $email_order .= $payment_class->title . "\n\n"; if ($payment_class->email_footer) { $email_order .= $payment_class->email_footer . "\n\n"; } } tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); // send emails to other people if (SEND_EXTRA_ORDER_EMAILS_TO != '') { tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); } /*=======================================================================*/ /**** Email Invoice Mod Snippet ****/ Thanks for your help so far. Just a suggestion -- and, it will also put the content you added on separate lines: Change "<br>" entries to "\n" or "\n\n", depending if you want a blank line between the added lines. It appears from the output you presented that you are not using HTML in your email. This will be even more important if you are on a windows environment. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.