Можно сделать удобнее.
Формирование и отсылка писем происходит в файле catalog/model/checkout/order.php
Тексты частей писем находятся в папке catalog/language/russian/mail -- из содержащихся там фраз формируются письма.
Author: Ruslan Brest <rb@labtodo.com>
Date: Fri Feb 24 11:54:40 2012 +0200
[+] better admin alert email on new order
diff --git a/upload/catalog/language/russian/mail/order.php b/upload/catalog/language/russian/mail/order.php
index f42838d..8bb86a5 100644
--- a/upload/catalog/language/russian/mail/order.php
+++ b/upload/catalog/language/russian/mail/order.php
@@ -2,7 +2,7 @@
// Text
$_['text_new_subject'] = '%s - заказ %s';
$_['text_new_greeting'] = 'Благодарим за интерес к товарам %s. Ваш заказ получен и поступит в обработку после подтверждения оплаты.';
-$_['text_new_received'] = 'Вы получили заказ.';
+$_['text_new_received'] = 'Вы получили заказ';
$_['text_new_link'] = 'Для просмотра Вашего заказа перейдите по ссылке:';
$_['text_new_order_detail'] = 'Детализация заказа';
$_['text_new_instruction'] = 'Инструкции';
diff --git a/upload/catalog/model/checkout/order.php b/upload/catalog/model/checkout/order.php
index 6a187c2..360ea4d 100644
--- a/upload/catalog/model/checkout/order.php
+++ b/upload/catalog/model/checkout/order.php
@@ -440,14 +440,24 @@ class ModelCheckoutOrder extends Model {
$subject = sprintf($language->get('text_new_subject'), html_entity_decode($this->config->get('config_name'), ENT_QUOTES, 'UTF-8'), $order_id);
// Text
- $text = $language->get('text_new_received') . "\n\n";
- $text .= $language->get('text_new_order_id') . ' ' . $order_id . "\n";
- $text .= $language->get('text_new_date_added') . ' ' . date($language->get('date_format_short'), strtotime($order_info['date_added'])) . "\n";
- $text .= $language->get('text_new_order_status') . ' ' . $order_status . "\n\n";
+ $text = $language->get('text_new_received') . ' #'.$order_id . ' ('.date($language->get('date_format_short'), strtotime($order_info['date_added'])).')' . "\n";
+ // $text .= $language->get('text_new_order_id') . ' ' . $order_id . "\n";
+ // $text .= $language->get('text_new_date_added') . ' ' . date($language->get('date_format_short'), strtotime($order_info['date_added'])) . "\n";
+ $text .= $language->get('text_new_order_status') . ' ' . strip_tags($order_status) . "\n\n";
+
+ if( !empty($order_info['payment_method']) ) $text .= 'payment method: ' . $order_info['payment_method'] . "\n";
+ // $text .= 'shipping method: ' . $order_info['shipping_method'] . "\n";
+ if( !empty($order_info['email']) ) $text .= 'email: ' . $order_info['email'] . "\n";
+ if( !empty($order_info['telephone']) ) $text .= 'telephone: ' . $order_info['telephone'] . ", ";
+ $text .= 'IP: http://geoiptool.com/en/?IP=' . $order_info['ip'] . "\n\n";
+
$text .= $language->get('text_new_products') . "\n";
foreach ($order_product_query->rows as $result) {
- $text .= $result['quantity'] . 'x ' . $result['name'] . ' (' . $result['model'] . ') ' . html_entity_decode($this->currency->format($result['total'], $order_info['currency_code'], $order_info['currency_value']), ENT_NOQUOTES, 'UTF-8') . "\n";
+ $text .= ' ';
+ $text .= html_entity_decode($this->currency->format($result['total'], $order_info['currency_code'], $order_info['currency_value']), ENT_NOQUOTES, 'UTF-8');
+ $text .= ' = ';
+ $text .= $result['quantity'] . ' x ' . $result['name'] . ' (' . $result['model'] . ")\n";
$order_option_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_option WHERE order_id = '" . (int)$order_id . "' AND order_product_id = '" . $result['order_product_id'] . "'");
@@ -457,10 +467,10 @@ class ModelCheckoutOrder extends Model {
}
$text .= "\n";
-
$text .= $language->get('text_new_order_total') . "\n";
foreach ($order_total_query->rows as $result) {
+ $text .= ' ';
$text .= $result['title'] . ' ' . html_entity_decode($result['text'], ENT_NOQUOTES, 'UTF-8') . "\n";
}
Источник