Zen Cart Logo
Forums / General Questions / Email Order Confirmation has 2 missing definition variables for Phone/Email

Email Order Confirmation has 2 missing definition variables for Phone/Email

Views: 1,026

Results 1 to 11 of 11
17 Jul 2023, 7:13 PM
#1
idaho_eagle avatar

idaho_eagle

New Zenner

Join Date:
Jul 2023
Location:
Idaho
Posts:
7
Plugin Contributions:
0

Email Order Confirmation has 2 missing definition variables for Phone/Email

I noticed that email confirmations are showing the following 2 variables:
Attachment 20335

Delivery Address
$EMAIL_TEXT_TELEPHONE and $EMAIL_CUSTOMER_PHONE

I've checked throughout the codebase and I can't seem to find where to modify those variables? I've inserted define('EMAIL_TEXT_TELEPHONE', 'Telephone: '); into line 38 of email_extras.php with no successful outcome to the confirmation email. Any ideas?

  • Idaho Eagle
17 Jul 2023, 8:43 PM
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,086
Plugin Contributions:
56

Re: Email Order Confirmation has 2 missing definition variables for Phone/Email

Welcome to the community!

What version of Zen Cart is being used? Those html-email values are provided by /includes/classes/order.php when it's creating the order-confirmation email.

It sounds like (??) you've got a template-override version of the language file, e.g. /includes/languages/english/YOUR_TEMPLATE/email_extras.php, that doesn't include that language constant.

17 Jul 2023, 10:28 PM
#3
idaho_eagle avatar

idaho_eagle

New Zenner

Join Date:
Jul 2023
Location:
Idaho
Posts:
7
Plugin Contributions:
0

Re: Email Order Confirmation has 2 missing definition variables for Phone/Email

lat9:

Welcome to the community!

What version of Zen Cart is being used? Those html-email values are provided by /includes/classes/order.php when it's creating the order-confirmation email.

It sounds like (??) you've got a template-override version of the language file, e.g. /includes/languages/english/YOUR_TEMPLATE/email_extras.php, that doesn't include that language constant.

The version we are using is v1.5.7c. When I navigate to the path: /includes/languages/english .... I don't see a template-override version, unless I am missing something? Here is what I see:
Attachment 20337

17 Jul 2023, 11:58 PM
#4
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,086
Plugin Contributions:
56

Re: Email Order Confirmation has 2 missing definition variables for Phone/Email

The /includes/classes/order.php from zc157c does include those fields in the email, present in the send_order_email method:

  function send_order_email($zf_insert_id = null, $zf_mode = FALSE) {
    global $currencies, $order_totals;

    if ($zf_insert_id === null) $zf_insert_id = $this->orderId;

    $this->notify('NOTIFY_ORDER_SEND_EMAIL_INITIALIZE', array(), $zf_insert_id, $order_totals, $zf_mode);
    if (!defined('ORDER_EMAIL_DATE_FORMAT')) define('ORDER_EMAIL_DATE_FORMAT', 'M-d-Y h:iA');

    $this->send_low_stock_emails = TRUE;
    $this->notify('NOTIFY_ORDER_SEND_LOW_STOCK_EMAILS');
    if ($this->send_low_stock_emails && $this->email_low_stock != ''  && SEND_LOWSTOCK_EMAIL=='1') {
      $email_low_stock = SEND_EXTRA_LOW_STOCK_EMAIL_TITLE . "\n\n" . $this->email_low_stock;
      zen_mail('', SEND_EXTRA_LOW_STOCK_EMAILS_TO, EMAIL_TEXT_SUBJECT_LOWSTOCK, $email_low_stock, STORE_OWNER, EMAIL_FROM, array('EMAIL_MESSAGE_HTML' => nl2br($email_low_stock)),'low_stock');
    }

    // lets start with the email confirmation
    // make an array to store the html version
    $html_msg=array();

    //intro area
    $email_order = EMAIL_TEXT_HEADER . EMAIL_TEXT_FROM . STORE_NAME . "\n\n" .
    $this->customer['firstname'] . ' ' . $this->customer['lastname'] . "\n\n" .
    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";

    $html_msg['EMAIL_TEXT_HEADER']     = EMAIL_TEXT_HEADER;
    $html_msg['EMAIL_TEXT_FROM']       = EMAIL_TEXT_FROM;
    $html_msg['INTRO_STORE_NAME']      = STORE_NAME;
    $html_msg['EMAIL_THANKS_FOR_SHOPPING'] = EMAIL_THANKS_FOR_SHOPPING;
    $html_msg['EMAIL_DETAILS_FOLLOW']  = EMAIL_DETAILS_FOLLOW;
    $html_msg['INTRO_ORDER_NUM_TITLE'] = EMAIL_TEXT_ORDER_NUMBER;
    $html_msg['INTRO_ORDER_NUMBER']    = $zf_insert_id;
    $html_msg['INTRO_DATE_TITLE']      = EMAIL_TEXT_DATE_ORDERED;
    $html_msg['INTRO_DATE_ORDERED']    = strftime(DATE_FORMAT_LONG);
    $html_msg['INTRO_URL_TEXT']        = EMAIL_TEXT_INVOICE_URL_CLICK;
    $html_msg['INTRO_URL_VALUE']       = zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $zf_insert_id, 'SSL', false);
    [B]$html_msg['EMAIL_CUSTOMER_PHONE']  = $this->customer['telephone'];[/B]
    $html_msg['EMAIL_ORDER_DATE']      = date(ORDER_EMAIL_DATE_FORMAT);
    [B]$html_msg['EMAIL_TEXT_TELEPHONE']  = EMAIL_TEXT_TELEPHONE;[/B]

    $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);

I'm guessing that your issue has something to do with that "Quick Checkout" plugin that you've got installed; it most likely hasn't been updated to recognize that those fields are present (they've been there since Zen Cart 1.5.5f).

If you're set on using that problematic plugin, your quickest path to success is simply to update your store's version of /email/email_template_checkout.html, changing this section:

      <tr>
        <td class="address">$ADDRESS_DELIVERY_DETAIL<br>
        $EMAIL_TEXT_TELEPHONE $EMAIL_CUSTOMER_PHONE</td>
      </tr>

to read

      <tr>
        <td class="address">$ADDRESS_DELIVERY_DETAIL</td>
      </tr>

... essentially, removing those email variables that the "Quick Checkout" doesn't 'know from'.

18 Jul 2023, 6:28 PM
#5
idaho_eagle avatar

idaho_eagle

New Zenner

Join Date:
Jul 2023
Location:
Idaho
Posts:
7
Plugin Contributions:
0

Re: Email Order Confirmation has 2 missing definition variables for Phone/Email

Odd. My order.php file does not include those fields?
Attachment 20338

18 Jul 2023, 6:55 PM
#6
idaho_eagle avatar

idaho_eagle

New Zenner

Join Date:
Jul 2023
Location:
Idaho
Posts:
7
Plugin Contributions:
0

Re: Email Order Confirmation has 2 missing definition variables for Phone/Email

Also, the only plugin I see installed is this one:

Attachment 20339

18 Jul 2023, 7:21 PM
#7
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,086
Plugin Contributions:
56

Re: Email Order Confirmation has 2 missing definition variables for Phone/Email

Right, that "Quick Checkout" isn't an encapsulated plugin that shows in Modules :: Plugin Manager, it's an older one that requires copying files, updating the database and (most likely) overwriting core Zen Cart files.

You'll see (IIRC) its settings in additions to your site's admin's Configuration menu dropdown. I saw that from the presence of /includes/languages/english/quick_checkout.php.

18 Jul 2023, 8:56 PM
#8
idaho_eagle avatar

idaho_eagle

New Zenner

Join Date:
Jul 2023
Location:
Idaho
Posts:
7
Plugin Contributions:
0

Re: Email Order Confirmation has 2 missing definition variables for Phone/Email

Removing those variables in the email_template_checkout.html file worked to get rid of those variables out of the confirmation email. Thank you. I do see another variable $EMAIL_ORDER_MESSAGE in the same file. I'm sure removing that variable will also remove it from the confirmation email. Saying that, I'm not familiar with the "Quick Checkout" plugin that you say we have installed. I would rather not use that plugin, and wondering if you can help me figure out how to get the customer phone on the email confirmation sent out, as well as the $Email_Order_Message (not sure where to find this message at and what it is supposed to say).

Attachment 20340

18 Jul 2023, 9:51 PM
#9
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,086
Plugin Contributions:
56

Re: Email Order Confirmation has 2 missing definition variables for Phone/Email

As mentioned before, there's most likely some admin **Configuration **settings associated with either Quick Checkout or Fast and Easy Checkout. Disabling those might do the trick.

19 Jul 2023, 12:30 PM
#10
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,792
Plugin Contributions:
14

Re: Email Order Confirmation has 2 missing definition variables for Phone/Email

This is one of the times when Mod List is helpful. Installing it will show you where these items are lurking both in the files and the database. It's especially helpful with FEC. It will show you the configuration keys that need to be gone from the configuration table.

19 Jul 2023, 3:55 PM
#11
idaho_eagle avatar

idaho_eagle

New Zenner

Join Date:
Jul 2023
Location:
Idaho
Posts:
7
Plugin Contributions:
0

Re: Email Order Confirmation has 2 missing definition variables for Phone/Email

Thank you for that information, dbltoe! I will look into that now.

Eagle