Opencart 3 Detailed Admin Order Notification Email
Default Opencart 3 admin order email contain minimum information about new order, there is no customer name, address, phone, email... I dont know why is detailed order email for admin - default function in Opencart 2 removed from Opencart 3.
Send customer order copy to admin email in Opencart 3 is pretty easy. You just need to edit 2 files: catalog/controller/mail/order.php and catalog/view/theme/yourtheme/template/mail/order_alert.twig
Backup your website first!
1. Somewhere about 276 line, after
$mail->setTo($order_info['email']);
...some code....
$mail->send();
and before "}" So it look like this:
$mail->setTo($order_info['email']);
...some code....
$mail->send();
//Detailed order email admin >>>
$mail->setTo($this->config->get('config_email'));
$mail->setFrom($from);
$mail->setSender(html_entity_decode($order_info['store_name'], ENT_QUOTES, 'UTF-8'));
$mail->setSubject(html_entity_decode(sprintf($language->get('text_subject'), $order_info['store_name'], $order_info['order_id']), ENT_QUOTES, 'UTF-8'));
$mail->setHtml($this->load->view('mail/order_alert', $data));
$mail->send();
//<<< Detailed order email admin
}
2. Second, you need to copy all content from file
catalog/view/theme/yourtheme/template/mail/order_add.twig
to the file
catalog/view/theme/yourtheme/template/mail/order_alert.twig
After that, if you want, you can replace {{ text_greeting }} with text like "New order" or something
and {{ text_footer }} in order_alert.twig
Now when new order is placed, admin will got 2 email, one is old without details and second is detailed email like email for customer. You can uncheck new order alert in System > Settings > Stores under Mail tab
Send customer order copy to admin email in Opencart 3 is pretty easy. You just need to edit 2 files: catalog/controller/mail/order.php and catalog/view/theme/yourtheme/template/mail/order_alert.twig
Backup your website first!
1. Somewhere about 276 line, after
$mail->setTo($order_info['email']);
...some code....
$mail->send();
and before "}" So it look like this:
$mail->setTo($order_info['email']);
...some code....
$mail->send();
//Detailed order email admin >>>
$mail->setTo($this->config->get('config_email'));
$mail->setFrom($from);
$mail->setSender(html_entity_decode($order_info['store_name'], ENT_QUOTES, 'UTF-8'));
$mail->setSubject(html_entity_decode(sprintf($language->get('text_subject'), $order_info['store_name'], $order_info['order_id']), ENT_QUOTES, 'UTF-8'));
$mail->setHtml($this->load->view('mail/order_alert', $data));
$mail->send();
//<<< Detailed order email admin
}
2. Second, you need to copy all content from file
catalog/view/theme/yourtheme/template/mail/order_add.twig
to the file
catalog/view/theme/yourtheme/template/mail/order_alert.twig
After that, if you want, you can replace {{ text_greeting }} with text like "New order" or something
and {{ text_footer }} in order_alert.twig
Now when new order is placed, admin will got 2 email, one is old without details and second is detailed email like email for customer. You can uncheck new order alert in System > Settings > Stores under Mail tab
Kod mene ovo ne radi, isprobao sam sve moguće varijante, pa ne ide. Koristim OC verziju 3.0.2.0
ОдговориИзбриши