Forums / General Questions / Changing order of text in email messages

Changing order of text in email messages

Locked

Views: 1,890

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
5 Oct 2006, 5:41 PM
#1
dirk_ski_boss avatar

dirk_ski_boss

New Zenner

Join Date:
Oct 2006
Posts:
2
Plugin Contributions:
0

Changing order of text in email messages

Hi, I would like to change the order in which text is presented in admin/includes/languages/english/orders.php

So far I have this:

*Order Number: 10

Detailed Record For Museum Member Only:
http://cmags.dankedu.com/index.php?main_page=account_history_info&order_id=10

Date You Booked the Pass: Thursday 05 October, 2006

Please issue our corporate pass "a" to Dirk Ski Boss on November 10.

Thank you.

Dirk Ski Boss, Board Excecutive, Museum and Geoscience Centre

Additional Message to Member: Your booking has been updated to the following
status:
New status: Delivered

Please reply to this email if you have any questions.
*I would like to change it into:
*
Please issue our corporate pass "a" to Dirk Ski Boss on November 10.

Thank you.

Dirk Ski Boss, Board Excecutive, Museum and Geoscience Centre

Order Number: 10
Date You Booked the Pass: Thursday 05 October, 2006

Detailed Record For Museum Member Only:
http://cmags.dankedu.com/index.php?main_page=account_history_info&order_id=10

Additional Message to Member: Your booking has been updated to the following
status:
New status: Delivered

Please reply to this email if you have any questions.
*
How would I go about this?
Also, how can I drop > *http://cmags.dankedu.com/index.php?main_page=account_history_info&order_id=10 * and > Date You Booked the Pass: Thursday 05 October, 2006 entirely?

Thank you for the help.

12 Oct 2006, 4:55 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: Changing order of text in email messages

You'll need to roll up your sleeves, dust off your PHP books, and edit the /includes/classes/order.php file. In v1.3.5, the section begins around line 878:```
//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);

//comments area
if ($this->info['comments']) {
  $email_order .= zen_db_output($this->info['comments']) . "\n\n";
  $html_msg['ORDER_COMMENTS'] = zen_db_output($this->info['comments']);
} else {
  $html_msg['ORDER_COMMENTS'] = '';
}

//products area
$email_order .= EMAIL_TEXT_PRODUCTS . "\n" .
EMAIL_SEPARATOR . "\n" .
$this->products_ordered .
EMAIL_SEPARATOR . "\n";
$html_msg['PRODUCTS_TITLE'] = EMAIL_TEXT_PRODUCTS;
$html_msg['PRODUCTS_DETAIL']='<table class="product-details" border="0" width="100%" cellspacing="0" cellpadding="2">' . $this->products_ordered_html . '</table>';

//order totals area
$html_ot .= '<td class="order-totals-text" align="right" width="100%">' . ' ' . '</td><td class="order-totals-num" align="right" nowrap="nowrap">' . '---------' .'</td></tr><tr>';
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";
  $html_ot .= '<td class="order-totals-text" align="right" width="100%">' . $order_totals[$i]['title'] . '</td><td class="order-totals-num" align="right" nowrap="nowrap">' .($order_totals[$i]['text']) .'</td></tr><tr>';
}
$html_msg['ORDER_TOTALS'] = '<table border="0" width="100%" cellspacing="0" cellpadding="2">' . $html_ot . '</table>';

//addresses area: Delivery
$html_msg['HEADING_ADDRESS_INFORMATION']= HEADING_ADDRESS_INFORMATION;
$html_msg['ADDRESS_DELIVERY_TITLE']     = EMAIL_TEXT_DELIVERY_ADDRESS;
$html_msg['ADDRESS_DELIVERY_DETAIL']    = ($this->content_type != 'virtual') ? zen_address_label($_SESSION['customer_id'], $_SESSION['sendto'], true, '', "<br />") : 'n/a';
$html_msg['SHIPPING_METHOD_TITLE']      = HEADING_SHIPPING_METHOD;
$html_msg['SHIPPING_METHOD_DETAIL']     = (zen_not_null($this->info['shipping_method'])) ? $this->info['shipping_method'] : 'n/a';

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";
}

//addresses area: Billing
$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 />");

if (is_object($GLOBALS[$_SESSION['payment']])) {
  $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" .
  EMAIL_SEPARATOR . "\n";
  $payment_class = $_SESSION['payment'];
  $email_order .= $GLOBALS[$payment_class]->title . "\n\n";
  $email_order .= (isset($this->info['cc_type']) && $this->info['cc_type'] != '') ? $this->info['cc_type'] . "\n\n" : '';
  $email_order .= ($GLOBALS[$payment_class]->email_footer) ? $GLOBALS[$payment_class]->email_footer . "\n\n" : '';
} else {
  $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" .
  EMAIL_SEPARATOR . "\n";
  $email_order .= PAYMENT_METHOD_GV . "\n\n";
}
$html_msg['PAYMENT_METHOD_TITLE']  = EMAIL_TEXT_PAYMENT_METHOD;
$html_msg['PAYMENT_METHOD_DETAIL'] = (is_object($GLOBALS[$_SESSION['payment']]) ? $GLOBALS[$payment_class]->title : PAYMENT_METHOD_GV );
$html_msg['PAYMENT_METHOD_FOOTER'] = (is_object($GLOBALS[$_SESSION['payment']]) ? $GLOBALS[$payment_class]->email_footer : $this->info['cc_type'] );

// include disclaimer
$email_order .= "\n-----\n" . sprintf(EMAIL_DISCLAIMER, STORE_OWNER_EMAIL_ADDRESS) . "\n\n";
// include copyright
$email_order .= "\n-----\n" . EMAIL_FOOTER_COPYRIGHT . "\n\n";

.
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.

19 Oct 2006, 3:11 PM
#3
dirk_ski_boss avatar

dirk_ski_boss

New Zenner

Join Date:
Oct 2006
Posts:
2
Plugin Contributions:
0

Re: Changing order of text in email messages

Thank you so much. I will have some fun today getting it done. It always amazes me how helpfull the open source community can be and how much fun it is for me to problem solve and work on projects. Thanks again.

Dirk

p.s. I recently switched to Ubuntu and cant believe how nice it works.