If you would give me a link to that topic?
Norman in 't Veldt
Moderator OpenCart Forums
_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.
[How to] BTW + Verzend + betaal setup.
Look in catalog/model/cart/order.php.
You'll see the mail send code for the customer and admin. Simply copy the customer email object and change the sendto property to the shop config email and then send both. If you don't w
ant the standard admin email comment out that code.
From memory that's how I did it.
You'll see the mail send code for the customer and admin. Simply copy the customer email object and change the sendto property to the shop config email and then send both. If you don't w
ant the standard admin email comment out that code.
From memory that's how I did it.
www.opencartstore.com
Get OpenCart Templates and OpenCart Modules.
Aha, I see.
Thanks!
Thanks!
Norman in 't Veldt
Moderator OpenCart Forums
_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.
[How to] BTW + Verzend + betaal setup.
imaginetech wrote:Look in catalog/model/cart/order.php.
You'll see the mail send code for the customer and admin. Simply copy the customer email object and change the sendto property to the shop config email and then send both. If you don't w
ant the standard admin email comment out that code.
From memory that's how I did it.
Could you please tell the exact line to modify?
Vers. 1.4.6
it is this line ??
Code: Select all
$mail->setTo($order_query->row['email']);
$mail->setFrom($this->config->get('config_email'));
Im not saying I did it right, or "cleanly" but it works... here is the last bit of the order.php file from mine, and it works for me. Im sure its an ugly hack compared to what it should really look like. 
Its version 1.4.7
Basically, I copied the customer email code, commented out the text admin email code, added in the cust email code and changed the email to in the new admin part. If that makes sense.

Its version 1.4.7
Basically, I copied the customer email code, commented out the text admin email code, added in the cust email code and changed the email to in the new admin part. If that makes sense.
Code: Select all
// Text Mail
$text = sprintf($language->get('text_greeting'), html_entity_decode($order_query->row['store_name'], ENT_QUOTES, 'UTF-8')) . "\n\n";
$text .= $language->get('text_order_id') . ' ' . $order_id . "\n";
$text .= $language->get('text_date_added') . ' ' . date($language->get('date_format_short'), strtotime($order_query->row['date_added'])) . "\n";
$text .= $language->get('text_order_status') . ' ' . $order_status_query->row['name'] . "\n\n";
$text .= $language->get('text_product') . "\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_query->row['currency'], $order_query->row['value']), ENT_NOQUOTES, 'UTF-8') . "\n";
}
$text .= "\n";
$text .= $language->get('text_total') . "\n";
foreach ($order_total_query->rows as $result) {
$text .= $result['title'] . ' ' . html_entity_decode($result['text'], ENT_NOQUOTES, 'UTF-8') . "\n";
}
$text .= "\n";
if ($order_query->row['customer_id']) {
$text .= $language->get('text_invoice') . "\n";
$text .= $order_query->row['store_url'] . 'index.php?route=account/invoice&order_id=' . $order_id . "\n\n";
}
if ($order_download_query->num_rows) {
$text .= $language->get('text_download') . "\n";
$text .= $order_query->row['store_url'] . 'index.php?route=account/download' . "\n\n";
}
if ($comment) {
$text .= $language->get('text_comment') . "\n\n";
$text .= $comment . "\n\n";
}
$text .= $language->get('text_footer');
$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->hostname = $this->config->get('config_smtp_host');
$mail->username = $this->config->get('config_smtp_username');
$mail->password = $this->config->get('config_smtp_password');
$mail->port = $this->config->get('config_smtp_port');
$mail->timeout = $this->config->get('config_smtp_timeout');
$mail->setTo($order_query->row['email']);
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($order_query->row['store_name']);
$mail->setSubject($subject);
$mail->setHtml($html);
$mail->setText(html_entity_decode($text, ENT_QUOTES, 'UTF-8'));
$mail->addAttachment(DIR_IMAGE . $this->config->get('config_logo'));
$mail->send();
// admin email mod
$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->hostname = $this->config->get('config_smtp_host');
$mail->username = $this->config->get('config_smtp_username');
$mail->password = $this->config->get('config_smtp_password');
$mail->port = $this->config->get('config_smtp_port');
$mail->timeout = $this->config->get('config_smtp_timeout');
$mail->setTo($this->config->get('config_email'));
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($order_query->row['store_name']);
$mail->setSubject($subject);
$mail->setHtml($html);
$mail->setText(html_entity_decode($text, ENT_QUOTES, 'UTF-8'));
$mail->addAttachment(DIR_IMAGE . $this->config->get('config_logo'));
$mail->send();
// end email mod
if ($this->config->get('config_alert_mail')) {
$text = $language->get('text_received') . "\n\n";
$text .= $language->get('text_order_id') . ' ' . $order_id . "\n";
$text .= $language->get('text_date_added') . ' ' . date($language->get('date_format_short'), strtotime($order_query->row['date_added'])) . "\n";
$text .= $language->get('text_order_status') . ' ' . $order_status_query->row['name'] . "\n\n";
$text .= $language->get('text_product') . "\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_query->row['currency'], $order_query->row['value']), ENT_NOQUOTES, 'UTF-8') . "\n";
}
$text .= "\n";
$text.= $language->get('text_total') . "\n";
foreach ($order_total_query->rows as $result) {
$text .= $result['title'] . ' ' . html_entity_decode($result['text'], ENT_NOQUOTES, 'UTF-8') . "\n";
}
$text .= "\n";
if ($comment) {
$text .= $language->get('text_comment') . "\n\n";
$text .= $comment . "\n\n";
}
/* $mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->hostname = $this->config->get('config_smtp_host');
$mail->username = $this->config->get('config_smtp_username');
$mail->password = $this->config->get('config_smtp_password');
$mail->port = $this->config->get('config_smtp_port');
$mail->timeout = $this->config->get('config_smtp_timeout');
$mail->setTo($this->config->get('config_email'));
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($order_query->row['store_name']);
$mail->setSubject($subject);
$mail->setText($text);
$mail->send();
*/
}
}
}
public function update($order_id, $order_status_id, $comment = '', $notify = FALSE) {
$order_query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "order` o LEFT JOIN " . DB_PREFIX . "language l ON (o.language_id = l.language_id) WHERE o.order_id = '" . (int)$order_id . "' AND o.order_status_id > '0'");
if ($order_query->num_rows) {
$this->db->query("UPDATE `" . DB_PREFIX . "order` SET order_status_id = '" . (int)$order_status_id . "', date_modified = NOW() WHERE order_id = '" . (int)$order_id . "'");
$this->db->query("INSERT INTO " . DB_PREFIX . "order_history SET order_id = '" . (int)$order_id . "', order_status_id = '" . (int)$order_status_id . "', notify = '" . (int)$notify . "', comment = '" . $this->db->escape($comment) . "', date_added = NOW()");
if ($notify) {
$language = new Language($order_query->row['directory']);
$language->load($order_query->row['filename']);
$language->load('mail/order_update');
$subject = sprintf($language->get('text_subject'), html_entity_decode($order_query->row['store_name'], ENT_QUOTES, 'UTF-8'), $order_id);
$message = $language->get('text_order') . ' ' . $order_id . "\n";
$message .= $language->get('text_date_added') . ' ' . date($language->get('date_format_short'), strtotime($order_query->row['date_added'])) . "\n\n";
$order_status_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_status WHERE order_status_id = '" . (int)$order_status_id . "' AND language_id = '" . (int)$order_query->row['language_id'] . "'");
if ($order_status_query->num_rows) {
$message .= $language->get('text_order_status') . "\n\n";
$message .= $order_status_query->row['name'] . "\n\n";
}
$message .= $language->get('text_invoice') . "\n";
$message .= $order_query->row['store_url'] . 'index.php?route=account/invoice&order_id=' . $order_id . "\n\n";
if ($comment) {
$message .= $language->get('text_comment') . "\n\n";
$message .= $comment . "\n\n";
}
$message .= $language->get('text_footer');
$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->hostname = $this->config->get('config_smtp_host');
$mail->username = $this->config->get('config_smtp_username');
$mail->password = $this->config->get('config_smtp_password');
$mail->port = $this->config->get('config_smtp_port');
$mail->timeout = $this->config->get('config_smtp_timeout');
$mail->setTo($order_query->row['email']);
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($order_query->row['store_name']);
$mail->setSubject($subject);
$mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
$mail->send();
}
}
}
}
?>
You know, I really want to do this, but I'm just not willing to copy code written by a customer and not a developer. Qphoria, would you please look over this code and tell us if it is written correctly?
Never mind. According to another thread, you're adding this feature to 1.4.8.
Never mind. According to another thread, you're adding this feature to 1.4.8.
Who is online
Users browsing this forum: No registered users and 29 guests