[VQMod] Royal Mail & UKMail Package Tracking
28 posts
• Page 1 of 2 • 1, 2
[VQMod] Royal Mail & UKMail Package Tracking
**Updated version at the bottom of this post**
This is a VQMod based on the original code by Gerrit that was discussed here: http://forum.opencart.com/viewtopic.php?t=24619
I edited the way it is displayed in the Back End, changed it from TNT to Uk Mail and added the ability for it to track a second mail company (Royal Mail)
This mod will add the ability to enter a Royal Mail or Uk Mail tracking number on the order processing screen.
It will then save a clickable link in the order history that will take you directly to the corresponding website of the carrier company and if you select "notify customer" it will also send the customer the tracking link in the order update E-mail.
As part of the update, it will now save a clickable link in the customers order history as well so it doesn't matter if they delete the e-mail etc.
Screenshots:


Full credits go to Gerrit, he did all the hard work and I just modified it to suit my needs.
EDIT 18th Feb 2011:
The most recent version is attached to this post
Cheers
Gaz
This is a VQMod based on the original code by Gerrit that was discussed here: http://forum.opencart.com/viewtopic.php?t=24619
I edited the way it is displayed in the Back End, changed it from TNT to Uk Mail and added the ability for it to track a second mail company (Royal Mail)
This mod will add the ability to enter a Royal Mail or Uk Mail tracking number on the order processing screen.
It will then save a clickable link in the order history that will take you directly to the corresponding website of the carrier company and if you select "notify customer" it will also send the customer the tracking link in the order update E-mail.
As part of the update, it will now save a clickable link in the customers order history as well so it doesn't matter if they delete the e-mail etc.
Screenshots:


Full credits go to Gerrit, he did all the hard work and I just modified it to suit my needs.
EDIT 18th Feb 2011:
The most recent version is attached to this post
Cheers
Gaz
- Attachments
-
Royal_Mail_And_UkMail_Track_and_Trace_autodb.xml- Version 1.1.0
- (18.49 KiB) Downloaded 286 times
Last edited by dry_flood on Fri Feb 18, 2011 8:07 pm, edited 2 times in total.
- dry_flood
- Posts: 31
- Joined: Mon Dec 13, 2010 8:33 pm
Re: [VQMod] Royal Mail & UKMail Package Tracking
Hey Gaz, this is great, exactly what I've been looking for. The admin side of things is all working, but I do have a question relating to the email that is sent out when 'notify' is selected (ie. order update).
I'm using a customer order_update.tpl template from the extensions directory (Notify Customer Email Template). So, I need to add some code to the template in order to have the trackcodes show ( only if, they are entered in admin).
This is what the code for the "comments" looks like in the template:
So I'm assuming that I need to duplicate this, but change $comment to something like $trackcode (but that's not it because I tried it already).
I did try looking in the xml filed and the other thread, but couldn't find the code that I might be able to copy/paste to make it work.
Thanks.
I'm using a customer order_update.tpl template from the extensions directory (Notify Customer Email Template). So, I need to add some code to the template in order to have the trackcodes show ( only if, they are entered in admin).
This is what the code for the "comments" looks like in the template:
- Code: Select all
<?php if ($comment){ ?>
<tr>
<td align="left" style="background-color: #069; color: #FFF; font-size: 12px; font-weight: bold; padding: 0.5em 1em;"><?php echo $text_comment; ?></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td align="left"><?php echo $comment; ?></td>
</tr>
<?php } ?>
So I'm assuming that I need to duplicate this, but change $comment to something like $trackcode (but that's not it because I tried it already).
I did try looking in the xml filed and the other thread, but couldn't find the code that I might be able to copy/paste to make it work.
Thanks.
-

philbydevil - Posts: 828
- Joined: Thu Dec 02, 2010 9:20 pm
- Location: Sunshine Coast, Australia
Re: [VQMod] Royal Mail & UKMail Package Tracking
philbydevil wrote:Hey Gaz, this is great, exactly what I've been looking for. The admin side of things is all working, but I do have a question relating to the email that is sent out when 'notify' is selected (ie. order update).
I'm using a customer order_update.tpl template from the extensions directory (Notify Customer Email Template). So, I need to add some code to the template in order to have the trackcodes show ( only if, they are entered in admin).
This is what the code for the "comments" looks like in the template:
- Code: Select all
<?php if ($comment){ ?>
<tr>
<td align="left" style="background-color: #069; color: #FFF; font-size: 12px; font-weight: bold; padding: 0.5em 1em;"><?php echo $text_comment; ?></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td align="left"><?php echo $comment; ?></td>
</tr>
<?php } ?>
So I'm assuming that I need to duplicate this, but change $comment to something like $trackcode (but that's not it because I tried it already).
I did try looking in the xml filed and the other thread, but couldn't find the code that I might be able to copy/paste to make it work.
Thanks.
PM Incoming
Cheers
Gaz
- dry_flood
- Posts: 31
- Joined: Mon Dec 13, 2010 8:33 pm
Re: [VQMod] Royal Mail & UKMail Package Tracking
Big thanks to Gaz for making this vQmod, and also for all of the personal support integrating it with "Notify Customer Email Template".
Cheers!
Cheers!

-

philbydevil - Posts: 828
- Joined: Thu Dec 02, 2010 9:20 pm
- Location: Sunshine Coast, Australia
Re: [VQMod] Royal Mail & UKMail Package Tracking
New version released. See first post.
Cheers
Gaz
Cheers
Gaz
- dry_flood
- Posts: 31
- Joined: Mon Dec 13, 2010 8:33 pm
Re: [VQMod] Royal Mail & UKMail Package Tracking
For some reason, the layout of the "Online Tracking" table in Order History wasn't agreeing with my template (two column). It was either putting the table in the wrong position, or messing up my footer (changing it from a fixed with to the width of the window).
So, I changed the last part of Gaz's vQmod to this:
You may need to change the search parameter from <table width="536"> to something else. Just look in your invoice.tpl file for code that looks like this:
This is what it should end up looking like:
Thanks again to Gaz, Gerrit, Q and anyone else who has helped make this dream come true

So, I changed the last part of Gaz's vQmod to this:
- Code: Select all
<file name="catalog/view/theme/YOURTHEME/template/account/invoice.tpl">
<operation>
<search position="replace"><![CDATA[
<table width="536">
]]></search>
<add><![CDATA[
<table width="100%">
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[
<th align="left"><?php echo $column_comment; ?></th>
]]></search>
<add><![CDATA[
<th align="left" width="60%"><?php echo $column_comment; ?></th>
<th align="left"><?php echo $column_tracking; ?></th>
]]></add>
</operation>
<operation>
<search position="after"><![CDATA[
<td valign="top"><?php echo $history['comment']; ?></td>
]]></search>
<add><![CDATA[
<?php if ($history['trackcode']) { ?>
<td valign="top"><a href='<?php echo 'http://www.business-post.com/scripts/wsisa.dll/ws_quickpod.html?lc_SearchValue='.$history['trackcode']; ?>' target="_blank"><b onmouseover="this.style.color='red'" onmouseout="this.style.color=''">Uk Mail Parcel Tracking<br>#<?php echo $history['trackcode']; ?></b></a></td>
<?php } ?>
<?php if ($history['trackcode2']) { ?>
<td valign="top"><a href='<?php echo 'http://www.royalmail.com/portal/rm/track?trackNumber='.$history['trackcode2']; ?>' target="_blank"><b onmouseover="this.style.color='red'" onmouseout="this.style.color=''">Royal Mail Parcel Tracking<br>#<?php echo $history['trackcode2']; ?></b></a></td>
<?php } ?>
]]></add>
</operation>
</file>
You may need to change the search parameter from <table width="536"> to something else. Just look in your invoice.tpl file for code that looks like this:
- Code: Select all
<?php if ($comment) { ?>
<b style="margin-bottom: 2px; display: block;"><?php echo $text_comment; ?></b>
<div class="content"><?php echo $comment; ?></div>
<?php } ?>
<?php if ($historys) { ?>
<b style="margin-bottom: 2px; display: block;"><?php echo $text_order_history; ?></b>
<div class="content">
<table width="536">
<tr>
<th align="left"><?php echo $column_date_added; ?></th>
<th align="left"><?php echo $column_status; ?></th>
<th align="left"><?php echo $column_comment; ?></th>
</tr>
<?php foreach ($historys as $history) { ?>
<tr>
<td valign="top"><?php echo $history['date_added']; ?></td>
<td valign="top"><?php echo $history['status']; ?></td>
<td valign="top"><?php echo $history['comment']; ?></td>
</tr>
<?php } ?>
</table>
</div>
<?php } ?>
<div class="buttons">
This is what it should end up looking like:
Thanks again to Gaz, Gerrit, Q and anyone else who has helped make this dream come true
-

philbydevil - Posts: 828
- Joined: Thu Dec 02, 2010 9:20 pm
- Location: Sunshine Coast, Australia
Re: [VQMod] Royal Mail & UKMail Package Tracking
Qphoria wrote:I've updated it to add an automatic database field installer
Could this be modified to universal use? I really need a tracking entry field to be placed in the history file. When a parcel is shipped, the track number is added as a link in the history for the order and the custemer is informed. Custemer could lookup the link in orderhistory from the frontend as well.
Try to do some modification to suit the local shippingservice, but can't make it work.
Any ideas?
- dinmc
- Posts: 42
- Joined: Tue Mar 22, 2011 9:01 am
Re: [VQMod] Royal Mail & UKMail Package Tracking
First of all, thanks for supplying this and making it work, it looks great and will save so much time. It's a really good feature!
I'm having a bit of trouble and the online tracking section isn't appearing under the order history like it does in the screenshot. It is present on the email but not when I log in to my account and try to track from there (which our customers will do).
Can anybody help please?
I'm having a bit of trouble and the online tracking section isn't appearing under the order history like it does in the screenshot. It is present on the email but not when I log in to my account and try to track from there (which our customers will do).
Can anybody help please?
Get it here Google Analytics Expert - E-Commerce Tracking including Product Options, Goal & Funnel Reporting, Event Tracking, Search Tracking, Multi-Store compatibility & EU Cookie Law compliance. Works with Shoppica too!
Free Mods:
Remove Wishlist | Remember text in search box
Other Extensions:
Remove product counts, Opencart speedup & Improve page load time | All Extensions
-

spitos - Posts: 258
- Joined: Mon May 23, 2011 10:19 am
- Location: UK
Re: [VQMod] Royal Mail & UKMail Package Tracking
Everything seems to be working fine except for when you view order history from account.
I receive this message at the top of the page:
Notice: Undefined index: trackcode in /site-path/vqmod/vqcache/vqcache_catalog_model_account_order.php on line 87Notice: Undefined index: trackcode2 in /site-path/vqmod/vqcache/vqcache_catalog_model_account_order.php on line 88
Hope this helps!
I receive this message at the top of the page:
Notice: Undefined index: trackcode in /site-path/vqmod/vqcache/vqcache_catalog_model_account_order.php on line 87Notice: Undefined index: trackcode2 in /site-path/vqmod/vqcache/vqcache_catalog_model_account_order.php on line 88
Hope this helps!
Get it here Google Analytics Expert - E-Commerce Tracking including Product Options, Goal & Funnel Reporting, Event Tracking, Search Tracking, Multi-Store compatibility & EU Cookie Law compliance. Works with Shoppica too!
Free Mods:
Remove Wishlist | Remember text in search box
Other Extensions:
Remove product counts, Opencart speedup & Improve page load time | All Extensions
-

spitos - Posts: 258
- Joined: Mon May 23, 2011 10:19 am
- Location: UK
Re: [VQMod] Royal Mail & UKMail Package Tracking
Can anyone help with this please? I'm desperate to get this to work!
The problem is the code which is around line 389 in 'Royal_Mail_And_UkMail_Track_and_Trace_autodb.xml'.
Keeping the code like above shows no tracking info. If I change this part, it changes the output but I can't figure it out.
I have made a small modification whilst trying to fix the problem above (unsuccessfully), I've altered it so the Tracking number is also displayed on the 'Order Details' page in admin > orders (if one has been entered).
Find:
Insert this on the next line:
The only small issue with this is that when the tracking number is entered on the 'Order History' page, you need to refresh the 'Order Details' page so that the updated tracking details appear. If anyone can make this refresh immediately somehow, so that when you go back to order details it has already been updated that would be great!
Hope this comes in handy for someone for now.
The problem is the code which is around line 389 in 'Royal_Mail_And_UkMail_Track_and_Trace_autodb.xml'.
- Code: Select all
<operation>
<search position="after"><![CDATA[
'status' => $result['status'],
]]></search>
<add><![CDATA[
'trackcode' => $result['trackcode'],
'trackcode2' => $result['trackcode2'],
]]></add>
</operation>
Keeping the code like above shows no tracking info. If I change this part, it changes the output but I can't figure it out.
I have made a small modification whilst trying to fix the problem above (unsuccessfully), I've altered it so the Tracking number is also displayed on the 'Order Details' page in admin > orders (if one has been entered).
Find:
- Code: Select all
<file name="admin/view/template/sale/order_form.tpl">
Insert this on the next line:
- Code: Select all
<operation>
<search position="after" offset="1"><![CDATA[
<td id="order_status"><?php echo $order_status; ?></td>
]]></search>
<add><![CDATA[
<!--///////////// Tracking in Order Details ///////////// -->
<?php $i=0;$length=count($histories)-1;foreach ($histories as $history) { ?>
<?php if($i == $length && $history['ukmail_track'] ){ ?>
<tr>
<td><?php echo $entry_track_trace; ?></td>
<td><a href='<?php echo $history['trackcode']; ?>' target="_blank"><b onmouseover="this.style.color='red'" onmouseout="this.style.color=''"><?php echo $history['ukmail_track']; ?></b></a> </td>
</tr>
<?php } ?>
<?php if($i == $length && $history['royalmail_track'] ){ ?>
<tr>
<td><?php echo $entry_track_trace2; ?></td>
<td><a href='<?php echo $history['trackcode2']; ?>' target="_blank"><b onmouseover="this.style.color='red'" onmouseout="this.style.color=''"><?php echo $history['royalmail_track']; ?></b></a> </td>
</tr>
<?php } ?>
<?php $i++; } ?>
<!--///////////// Tracking in Order Details ///////////// -->
]]></add>
</operation>
The only small issue with this is that when the tracking number is entered on the 'Order History' page, you need to refresh the 'Order Details' page so that the updated tracking details appear. If anyone can make this refresh immediately somehow, so that when you go back to order details it has already been updated that would be great!
Hope this comes in handy for someone for now.
Get it here Google Analytics Expert - E-Commerce Tracking including Product Options, Goal & Funnel Reporting, Event Tracking, Search Tracking, Multi-Store compatibility & EU Cookie Law compliance. Works with Shoppica too!
Free Mods:
Remove Wishlist | Remember text in search box
Other Extensions:
Remove product counts, Opencart speedup & Improve page load time | All Extensions
-

spitos - Posts: 258
- Joined: Mon May 23, 2011 10:19 am
- Location: UK
Re: [VQMod] Royal Mail & UKMail Package Tracking
is this 1.5.* ready?
- DannyMacD
- Posts: 471
- Joined: Thu Jun 25, 2009 10:39 pm
Re: [VQMod] Royal Mail & UKMail Package Tracking
anyone tested with latest 1.5.0.5?
many thanks.
many thanks.
- DannyMacD
- Posts: 471
- Joined: Thu Jun 25, 2009 10:39 pm
Re: [VQMod] Royal Mail & UKMail Package Tracking
Hi
This wont work on 1.5 without modification. As I am using 1.4.9.5 and have limited time, I will not upgrade the script until I finally migrate my live site to 1.5
Cheers
Gareth
This wont work on 1.5 without modification. As I am using 1.4.9.5 and have limited time, I will not upgrade the script until I finally migrate my live site to 1.5
Cheers
Gareth
- dry_flood
- Posts: 31
- Joined: Mon Dec 13, 2010 8:33 pm
Re: [VQMod] Royal Mail & UKMail Package Tracking
Just found this and was very happy until I saw its not available for 1.5.x.x
Gutted now
Would anyone be able to have a go at updating this if of course dry_flood doesn't mind?
Gutted now
Would anyone be able to have a go at updating this if of course dry_flood doesn't mind?
- Klimskady
- Posts: 160
- Joined: Mon Jun 06, 2011 11:57 pm
Re: [VQMod] Royal Mail & UKMail Package Tracking
has anyone managed to get this to work with 1.5.* ?
- DannyMacD
- Posts: 471
- Joined: Thu Jun 25, 2009 10:39 pm
Re: [VQMod] Royal Mail & UKMail Package Tracking
DannyMacD wrote:has anyone managed to get this to work with 1.5.* ?
I don't think so. Like I said before, I am very busy at the moment and have not even installed a test version of 1.5 to tinker with.
I am going on holiday shortly but will try and make some time to convert this over to 1.5 when I get back.
Cheers
Gareth
- dry_flood
- Posts: 31
- Joined: Mon Dec 13, 2010 8:33 pm
[VQMod] Royal Mail & UKMail Package Tracking
I believe Daniel is expanding Royal Mail in the next OC release.
Happy Coding!
Simon
------
Commercial Mods:
Google Merchant / Base XML Feed + Bing Shopping + Sitemaps - Automatic Friendly SEO URLs
Full List of UKSB Extensions and Mods
vQmod Generator - Develop & Test OpenCart on your Local Windows machine
Click here if I have helped you and you would like to make a donation
Simon
------
Commercial Mods:
Google Merchant / Base XML Feed + Bing Shopping + Sitemaps - Automatic Friendly SEO URLs
Full List of UKSB Extensions and Mods
vQmod Generator - Develop & Test OpenCart on your Local Windows machine
Click here if I have helped you and you would like to make a donation
-

uksitebuilder - Posts: 5602
- Joined: Thu Jun 09, 2011 3:37 pm
- Location: United Kindgom
Re: [VQMod] Royal Mail & UKMail Package Tracking
philbydevil wrote:Big thanks to Gaz for making this vQmod, and also for all of the personal support integrating it with "Notify Customer Email Template".Cheers!
wow this is a really very much nice dud..

- jimmyholand88
- Posts: 1
- Joined: Mon Nov 14, 2011 10:50 am
Re: [VQMod] Royal Mail & UKMail Package Tracking
I know that Daniel is planning to expand the royal mail functionality but has anyone managed to get this working for them with 1.5.1.3?
I have no problem paying for an extension but to buy something and then have the very thing be released later for free as part of the core files would be painful
I have no problem paying for an extension but to buy something and then have the very thing be released later for free as part of the core files would be painful

- Klimskady
- Posts: 160
- Joined: Mon Jun 06, 2011 11:57 pm
Re: [VQMod] Royal Mail & UKMail Package Tracking
I've updated this mod for v1.5.1.3 and am in the middle of testing now.
Wedding Invitations and Stationery by Love2print
Commercial Mods
Product Colours on Category Page
Cardsave Direct Gateway
Clear Cache
Promotional Watermarks on Images
Multiple Category / Product Templates ** Popular **
Log Failed Login Attempts
Display Eligible Coupons with Products
Twitter Feeds
Have I helped you out or saved you some time? Please donate
Commercial Mods
Product Colours on Category Page
Cardsave Direct Gateway
Clear Cache
Promotional Watermarks on Images
Multiple Category / Product Templates ** Popular **
Log Failed Login Attempts
Display Eligible Coupons with Products
Twitter Feeds
Have I helped you out or saved you some time? Please donate
- spikeachu
- Posts: 173
- Joined: Thu Mar 11, 2010 10:31 pm
28 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 7 guests


cmd-f, cmd-c, cmd-v, cmd-z + vQmod.










