Zen Cart Logo
Forums / General Questions / Add phone to email confirmation---move up

Add phone to email confirmation---move up

Views: 1,299

Results 1 to 15 of 15
7 May 2013, 2:39 PM
#1
timhersh avatar

timhersh

Zen Follower

Join Date:
Aug 2008
Posts:
274
Plugin Contributions:
0

Add phone to email confirmation---move up

Hello,

I have searched and tried to figure this out myself but not having any luck.

I am using zen cart 1.39H
https://www.ordersharkhide.com/shop/index.php?main_page=no_account

On the order confirmation it does put the customers phone number but it is placing that phone number at the very bottom of the confirmation email. Somehow I need to get a copy of that phone number placed at the top of the confirmation email, under the customers address

anyone have any idea how to do this?

Also I have a custom field I added to the registration information (when they enter their billing info) how do I get that on the confirmation email also? In the same spot ideally.

thank you

7 May 2013, 5:05 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Add phone to email confirmation---move up

no_account is from some addon that you must have installed

Instead of asking in general questions which is for default code issues

Ask in the support thread for the addon that you have installed

7 May 2013, 5:53 PM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Add phone to email confirmation---move up

@kobra, this question isn't related to the plugin. It's an inquiry about how to change the functionality of the generated emails, which is built-in functionality.

@timhersh, you can alter the code in the /includes/classes/order.php file, in the send-order-email function near the bottom of the file.

8 May 2013, 1:46 PM
#4
timhersh avatar

timhersh

Zen Follower

Join Date:
Aug 2008
Posts:
274
Plugin Contributions:
0

Re: Add phone to email confirmation---move up

Thank you very much Dr.Byte

So I opened that file up and see this

zen_mail('', SEND_EXTRA_ORDER_EMAILS_TO, SEND_EXTRA_NEW_ORDERS_EMAILS_TO_SUBJECT . ' ' . EMAIL_TEXT_SUBJECT . EMAIL_ORDER_NUMBER_SUBJECT . $zf_insert_id,
$email_order . $extra_info['TEXT'], STORE_NAME, EMAIL_FROM, $html_msg, 'checkout_extra', $this->attachArray);

I tried adding 'customers_telephone to the list but it didn't work. It looks like I have to change the actual message itself. I see all kinds of arrays but not sure what code to put where.

Ideally I would like the phone number to show up in the Delivery Address area

any idea how to edit that? I'm thinking it might be in this section but not sure what to put

 $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" .
    EMAIL_SEPARATOR . "\n" .
    zen_address_label($_SESSION['customer_id'], $_SESSION['billto'], 0, '', "\n") . "\n\n";
    $html_msg['ADDRESS_BILLING_TITLE']   = EMAIL_TEXT_BILLING_ADDRESS;
    $html_msg['ADDRESS_BILLING_DETAIL']  = zen_address_label($_SESSION['customer_id'], $_SESSION['billto'], true, '', "<br />");
8 May 2013, 4:44 PM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Add phone to email confirmation---move up

Is this for text-only emails, or for HTML-formatted emails?
You said you want to move things around. Why? What problem are you trying to solve?

8 May 2013, 7:35 PM
#6
timhersh avatar

timhersh

Zen Follower

Join Date:
Aug 2008
Posts:
274
Plugin Contributions:
0

Re: Add phone to email confirmation---move up

Thanks for the reply. It is for TEXT emails.

The client wants to only print one sheet. The issue is the current order confirmation takes up two pages. Only thing I really need to do is get the phone number to show up in the 'address' section. if I can get that to happen I'm home free

thanks

8 May 2013, 10:02 PM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Add phone to email confirmation---move up

Lemme guess ... the client only uses emails for order fulfillment, and probably doesn't ever update the order information online, and thus the customer can never actually self-serve to find out the status of their order.

8 May 2013, 10:04 PM
#8
timhersh avatar

timhersh

Zen Follower

Join Date:
Aug 2008
Posts:
274
Plugin Contributions:
0

Re: Add phone to email confirmation---move up

Thanks, not sure. I know he gets a lot of orders each day and prints out a sheet to give to his production manager. Page 2 only has that admin stuff and all he wants off of it is the phone number. Is it possible? thanks

8 May 2013, 10:08 PM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Add phone to email confirmation---move up

It would also be easier to help if they were using a current version of Zen Cart. Digging back into old versions of code is complicated. And when you make edit to core files, such as this request will do, you make it harder to upgrade in the future.

Anyway, add the phone number below the shipping address like this:```
if ($this->content_type != 'virtual') {
$email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" .
EMAIL_SEPARATOR . "\n" .
zen_address_label($_SESSION['customer_id'], $_SESSION['sendto'], 0, '', "\n") . "\n";
[B] $email_order .= $this->customer['telephone'] . "\n";[/B]
}

9 May 2013, 1:17 PM
#10
timhersh avatar

timhersh

Zen Follower

Join Date:
Aug 2008
Posts:
274
Plugin Contributions:
0

Re: Add phone to email confirmation---move up

perfect, thank you very much.

I imagine I can do the same thing for the extra field

20 May 2013, 8:51 PM
#11
timhersh avatar

timhersh

Zen Follower

Join Date:
Aug 2008
Posts:
274
Plugin Contributions:
0

Re: Add phone to email confirmation---move up

This worked great. One more request, the clients wants to be able to include the fax number in the same location.

I tried adding it to the end of the last code you had me add to get the phone added but no luck

 if ($this->content_type != 'virtual') {
      $email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" .
      EMAIL_SEPARATOR . "\n" .
      zen_address_label($_SESSION['customer_id'], $_SESSION['sendto'], 0, '', "\n") . "\n";$email_order .= $this->customer['telephone'] . "\n";$email_order .= $this->customer['fax'] . "\n";
21 May 2013, 8:54 PM
#12
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Add phone to email confirmation---move up

Ya, you'll have to pull that one from the database manually. It's not part of the normal order object.

22 May 2013, 9:45 PM
#13
timhersh avatar

timhersh

Zen Follower

Join Date:
Aug 2008
Posts:
274
Plugin Contributions:
0

Re: Add phone to email confirmation---move up

Thank you, any chance you can tell me what to put. Sorry I'm not good with SQL at all. I'm using the standard 'fax' field and I can tell that it is labeled as "f

23 May 2013, 4:42 AM
#14
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Add phone to email confirmation---move up

$fax_sql = "select customers_fax from " . TABLE_CUSTOMERS . " where customers_id = " . (int)$_SESSION['customers_id'];
$result = $db->Execute($fax_sql);
$fax_number = $result->fields['customers_fax'];

Then use $fax_number.

11 Jun 2013, 9:26 PM
#15
timhersh avatar

timhersh

Zen Follower

Join Date:
Aug 2008
Posts:
274
Plugin Contributions:
0

Re: Add phone to email confirmation---move up

thank you