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

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>

No comments:

Post a Comment