Onion - the missing ingredient for Sage Line 50 / Sage Instant accounts packs in Excel

Onion - the missing ingredient for Sage Line 50 / Sage Instant accounts packs in Excel
Full audit trails to underlying transactions from P&Ls, Balance Sheets, graphs, PivotTables, and departmental TBs in a stand-alone Excel file. Aged Debtors and Aged Creditor files too. Free 30 day trials. Download today at www.onionrs.co.uk

Friday 9 May 2014

OpenCart order notification doesn't identify the customer - Part 1

I've been frustrated that the email I get from my OpenCart site when a customer places an order doesn't identify who the customer is.  Even if it is only to satisfy curiosity, I find myself often going to the site to look up the customer who placed the order.

This is how the default email I receive begins:

You have received an order.

Order ID: 14862
Date Added: 04/05/2014

Order Status: Complete

Not very helpful.

I decided I'd find out where this comes from and see if I could do anything about it.

The text on the first line comes from the file ./catalog/language/english/mail/order.php. The relevant line in the file is $_['text_new_received'] = 'You have received an order.';

I changed 'You have received an order.' to 'You have received an order from '

A search of other files for 'text_new_received' brings up file ./catalog/model/checkout/order.php which contains the line $text = $language->get('text_new_received') . "\n\n";

Looking through the rest of the file I identified that the item $order_info['email'] contained the email address of the customer. I changed the line in ./catalog/model/checkout/order.php to:

$text = $language->get('text_new_received') . $order_info['email'] . "\n\n";

After upload to the site the email I receive now starts with:

You have received an order from customer@domain.com

Order ID: 14862
Date Added: 04/05/2014

Order Status: Complete

Job done!

P.S. see the Part 2 posting for a much better way to implement OpenCart changes using vQmod

No comments:

Post a Comment