How to send the order details to the shop owner in opencart



Opencart tutorial on how to send the purchase details to the shop owners

The shop owner will get the new purchase notification by email, and by default, the email is only containing the summary and missing without the purchase details such as buyer’s home and or delivery address details.

There is not something wrong with this details but it require ask to login to the backend of the online store and then get the purchase details we need it.

This is sometimes is annoying if we do not have really have much time. Wouldn’t it be nicer if we get all the purchase details in the shop owner email, right?

This Opencart tutorial is for you if you have to modify a little bit of your opencart based online store.

This will work on Opencart 1.4x and 1.5x

    1. Open the order.php located on /catalog/model/checkout/order.php
    2. FIND (~LINES 475 – 488) (Be sure its under the “// Admin Alert Mail” line)
    $mail = new Mail();
    $mail->protocol = $this->config->get('config_mail_protocol');
    $mail->parameter = $this->config->get('config_mail_parameter');
    $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_info['store_name']);
    $mail->setSubject($subject);
    $mail->setText($text);
    $mail->send();
  1. And replace with the following codes:
    // HTML
    $template->data['text_greeting'] = $language->get('text_new_received') . "\n\n";
    $template->data['invoice_no'] = '';
    $template->data['text_invoice_no'] = '';
    if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/mail/order.tpl')) {
       $html = $template->fetch($this->config->get('config_template') . '/template/mail/order.tpl');
    } else {
       $html = $template->fetch('default/template/mail/order.tpl');
    }
    $subject = sprintf($language->get('text_new_subject'), html_entity_decode($this->config->get('config_name'), ENT_QUOTES, 'UTF-8'), $order_id . ' (' . $order_total . ')');
    $mail->setSubject($subject);
    $mail->setTo($this->config->get('config_email'));
    $mail->setHtml($html);
    $mail->send();

With this opencart tips and tricks, the email notification that comes to the shop owner will be exactly the same as what the buyer have.

Please make sure to do the backup before applying those trick, just in case thing go wrong!

Hire me for your online business solution

Smart Bali Website

I'm a lucky husband and happy father with a cute daughter who work at home as frelance webmaster, I love to build amazing websites and help client succeed. Weather you have small, medium even large project, I am always interested to work with you.

Contact me today and let's boost your online business