Site maintenance: Sun 15 Nov, from 12:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / General Questions / Add company name to order confirmation email

Add company name to order confirmation email

Started by ryder on 14 Aug 2016, 10:34 PM · Views: 891

Results 1 to 6 of 6
14 Aug 2016, 10:34 PM
#1
ryder avatar

ryder

New Zenner

Join Date:
Aug 2016
Location:
Tennessee
Posts:
4
Plugin Contributions:
0

Add company name to order confirmation email

I did look around and if I missed this question being already asked I apologize.

What I need to do is to have the word Company appear in the customer's order confirmation email so that it will show for example.

Company: Ford

Does anyone know how or where I can do that?

Thanks

14 Aug 2016, 11:39 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Add company name to order confirmation email

/includes/classes/order.php around line 1003 you'll see: ```
$invoiceInfo=EMAIL_TEXT_INVOICE_URL . ' ' . zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $zf_insert_id, 'SSL', false) . "\n\n"; $htmlInvoiceURL=EMAIL_TEXT_INVOICE_URL_CLICK;
$htmlInvoiceValue=zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $zf_insert_id, 'SSL', false);
$email_order = EMAIL_TEXT_HEADER . EMAIL_TEXT_FROM . STORE_NAME . "\n\n" .
[B] $this->customer['firstname'] . ' ' . $this->customer['lastname'] . "\n\n" .[/B]
EMAIL_THANKS_FOR_SHOPPING . "\n" . EMAIL_DETAILS_FOLLOW . "\n" .
EMAIL_SEPARATOR . "\n" .
EMAIL_TEXT_ORDER_NUMBER . ' ' . $zf_insert_id . "\n" .
EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n" .
EMAIL_TEXT_INVOICE_URL . ' ' . zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $zf_insert_id, 'SSL', false) . "\n\n";

To add the company name associated with the current customer, use $this->customer['company']

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

15 Aug 2016, 1:43 AM
#3
ryder avatar

ryder

New Zenner

Join Date:
Aug 2016
Location:
Tennessee
Posts:
4
Plugin Contributions:
0

Re: Add company name to order confirmation email

Thanks Dr. Byte

I will give that a try and let you know how it goes. I really appreciate the help.

16 Aug 2016, 12:19 PM
#4
ryder avatar

ryder

New Zenner

Join Date:
Aug 2016
Location:
Tennessee
Posts:
4
Plugin Contributions:
0

Re: Add company name to order confirmation email

That was exactly line 1003 thanks. That does give me a field in the address book that I can use which I do need and works great except the word company still does not show up in the email.
Ryder

16 Aug 2016, 4:10 PM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Add company name to order confirmation email

Ryder:

That was exactly line 1003 thanks. That does give me a field in the address book that I can use which I do need and works great except the word company still does not show up in the email.
Ryder
You can add the word "Company" into the email in the same way.

. 'Company: ' . 

(Where the "." is used to combine strings together (don't use two . in a row without another string/variable between them though), and "'Company'" is the extra string to be added.)

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

17 Aug 2016, 12:13 AM
#6
ryder avatar

ryder

New Zenner

Join Date:
Aug 2016
Location:
Tennessee
Posts:
4
Plugin Contributions:
0

Re: Add company name to order confirmation email

I see it and understand. Give me some time, I have been working on this one thing for a week before I asked for help, so I need a little break. I will let you know how it goes, I think that is going to work. You have no idea how much I appreciate the help. I would have never thought to do that, thank you.

Ryder