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
Showing posts with label OpenCart. Show all posts
Showing posts with label OpenCart. Show all posts

Wednesday, 24 December 2014

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

After the Part 1 post I realised that direct edits to the OpenCart source files were going to be problematic at upgrade time. I'd lose all my previous edits when the upgraded files were copied over the edited ones. I'd seen references to vQmod but had never fully understood what it was or how it worked. A little investigation revealed that it was an elegant solution to making modificatons to the site that would not be lost on upgrade. I decided to adopt vQmod as my method of preference for adjustments to my OpenCart site.

I installed vQmod to the root directory of my site in accordance with the simple instructions. I already knew the information I needed to get the job done (see the Part 1 post). The file is identified in blue below. The line in that file which is to be replaced is coloured red below. The replacement I want for that line is coloured green below. The rest of the code is as per the guidance on the vQmod site.

The only thing I wasn't clear on from the guidance was where to save the file I put the code below into. I decided to call the file add-email-to-order-notification.xml and I uploaded it to the vqmod/xml directory on my site. It seemed like a reasonable guess. It worked

I'd come to understand that vQmod doesn't change any files. It duplicates them in the VQmod cache which are served (if they exist) instead of the core files and any necessary changes are applied from the XML markup in VQmod
I went back to look at order.php to confirm. It still contains the line I'm replacing with the vQmod. So, when order.php gets replaced in my next upgrade, my site should continue to provide me with the customer's email. In effect, the vQmod self-documents my previous editing changes and executes them on the fly.

<?xml version="1.0" encoding="UTF-8"?>
<modification>
<id>Add customer email address to new order notification</id>
<version>1.0</version>
<vqmver>2.5.1</vqmver>
<author>Onion Reporting Software Ltd</author>
<file name="catalog/model/checkout/order.php">
<operation info="
Add customer email address to new order notification">
<search position="replace"><![CDATA[
$text = $language->get('text_new_received') . "\n\n";
]]></search>
<add><![CDATA[
$text = 'You have received an order from customer ' . $order_info['email'] . "\n\n";
]]></add>
</operation>
</file>
</modification>

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

Wednesday, 9 October 2013

Opencart Company and VAT registration numbers added to invoice

The default invoice in Opencart 1.5.5.1does not record the company name, registered address, registered number and place of registration nor the VAT registration number.

A "quick and dirty" fix for this is to hard code the information into the file admin/view/template/sale/order_invoice.tpl as follows: 


immediately before the last </div> line in the file (four lines from the bottom) insert a line reading

<small><?php echo "[xxx]"; ?></small>

where [xxx] is the company and VAT related disclosures you wish to have on the bottom of your invoices.


It may not be pretty but it costs nothing and it works.


Monday, 15 July 2013

Changing the font of OpenCart mail communications

Opencart has a "newsletter" email facility to communicate with customers. I recently used it for the first time and discovered that, whilst in drafting mode the font of the email text had looked something like Arial (acceptable to me), the text of the email was Times New Roman (I just can't like this font).

There then ensued a search for how to control the default font type of the outgoing email html.  I don't want to have to hand code the source HTML for every communication. 

I eventually found how to do it and share it here in the hopes that it will save someone else the long and frustrating search I had to locate something I would have hoped would be easily found online. Not so!


  1. Locate the file admin/controller/sale/contact.php.
  2. Go to line 230 in that file. The line reads: $message .= '  <body>' . html_entity_decode($this->request->post['message'], ENT_QUOTES, 'UTF-8') . '</body>' . "\n";
  3. Change the text: '<body>' to '<body style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000;">' .
  4. Save the file

The full line should read: $message .= '  <body style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000;">' . html_entity_decode($this->request->post['message'], ENT_QUOTES, 'UTF-8') . '</body>' . "\n";

Your communications should now be in the font of your choice by default.