Community Forums

[VQMod] Royal Mail & UKMail Package Tracking

Put any free vQmod scripts here.
vQmod details

[VQMod] Royal Mail & UKMail Package Tracking

Postby dry_flood » Sat Feb 12, 2011 1:23 am

**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:
Image

Image

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 282 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

Postby philbydevil » Thu Feb 17, 2011 10:41 am

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>&nbsp;</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.
I Image cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1
User avatar
philbydevil
 
Posts: 828
Joined: Thu Dec 02, 2010 9:20 pm
Location: Sunshine Coast, Australia

Re: [VQMod] Royal Mail & UKMail Package Tracking

Postby dry_flood » Thu Feb 17, 2011 6:28 pm

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>&nbsp;</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

Postby philbydevil » Fri Feb 18, 2011 2:20 am

Big thanks to Gaz for making this vQmod, and also for all of the personal support integrating it with "Notify Customer Email Template".

Cheers! :good:
I Image cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1
User avatar
philbydevil
 
Posts: 828
Joined: Thu Dec 02, 2010 9:20 pm
Location: Sunshine Coast, Australia

Re: [VQMod] Royal Mail & UKMail Package Tracking

Postby dry_flood » Fri Feb 18, 2011 8:46 pm

New version released. See first post.

Cheers
Gaz
dry_flood
 
Posts: 31
Joined: Mon Dec 13, 2010 8:33 pm

Re: [VQMod] Royal Mail & UKMail Package Tracking

Postby philbydevil » Sat Feb 19, 2011 10:53 am

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:
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:
Picture-9.jpg
Picture-9.jpg (35.37 KiB) Viewed 3015 times


Thanks again to Gaz, Gerrit, Q and anyone else who has helped make this dream come true :clown: :crazy: :clown:
I Image cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1
User avatar
philbydevil
 
Posts: 828
Joined: Thu Dec 02, 2010 9:20 pm
Location: Sunshine Coast, Australia

Re: [VQMod] Royal Mail & UKMail Package Tracking

Postby dinmc » Thu Mar 31, 2011 3:43 am

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

Postby spitos » Tue May 24, 2011 9:38 pm

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?
Image 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
User avatar
spitos
 
Posts: 258
Joined: Mon May 23, 2011 10:19 am
Location: UK

Re: [VQMod] Royal Mail & UKMail Package Tracking

Postby spitos » Wed May 25, 2011 1:50 pm

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!
Image 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
User avatar
spitos
 
Posts: 258
Joined: Mon May 23, 2011 10:19 am
Location: UK

Re: [VQMod] Royal Mail & UKMail Package Tracking

Postby spitos » Fri May 27, 2011 9:23 am

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'.
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>&nbsp;&nbsp;</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>&nbsp;&nbsp;</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.
Image 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
User avatar
spitos
 
Posts: 258
Joined: Mon May 23, 2011 10:19 am
Location: UK

Re: [VQMod] Royal Mail & UKMail Package Tracking

Postby DannyMacD » Mon Jul 04, 2011 11:59 pm

is this 1.5.* ready?
DannyMacD
 
Posts: 471
Joined: Thu Jun 25, 2009 10:39 pm

Re: [VQMod] Royal Mail & UKMail Package Tracking

Postby DannyMacD » Mon Jul 11, 2011 10:12 am

anyone tested with latest 1.5.0.5?

many thanks.
DannyMacD
 
Posts: 471
Joined: Thu Jun 25, 2009 10:39 pm

Re: [VQMod] Royal Mail & UKMail Package Tracking

Postby dry_flood » Mon Jul 11, 2011 12:53 pm

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
dry_flood
 
Posts: 31
Joined: Mon Dec 13, 2010 8:33 pm

Re: [VQMod] Royal Mail & UKMail Package Tracking

Postby Klimskady » Tue Aug 02, 2011 4:18 pm

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?
Klimskady
 
Posts: 160
Joined: Mon Jun 06, 2011 11:57 pm

Re: [VQMod] Royal Mail & UKMail Package Tracking

Postby DannyMacD » Sun Aug 28, 2011 5:18 pm

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

Postby dry_flood » Tue Aug 30, 2011 9:35 pm

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

Postby uksitebuilder » Tue Aug 30, 2011 10:05 pm

I believe Daniel is expanding Royal Mail in the next OC release.
User avatar
uksitebuilder
 
Posts: 5602
Joined: Thu Jun 09, 2011 3:37 pm
Location: United Kindgom

Re: [VQMod] Royal Mail & UKMail Package Tracking

Postby jimmyholand88 » Mon Nov 14, 2011 10:52 am

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! :good:

wow this is a really very much nice dud.. O0
jimmyholand88
 
Posts: 1
Joined: Mon Nov 14, 2011 10:50 am

Re: [VQMod] Royal Mail & UKMail Package Tracking

Postby Klimskady » Sun Jan 08, 2012 3:19 am

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 ;D
Klimskady
 
Posts: 160
Joined: Mon Jun 06, 2011 11:57 pm

Re: [VQMod] Royal Mail & UKMail Package Tracking

Postby spikeachu » Sat Feb 18, 2012 11:07 pm

I've updated this mod for v1.5.1.3 and am in the middle of testing now.
spikeachu
 
Posts: 173
Joined: Thu Mar 11, 2010 10:31 pm

Next

Return to vQmods

Who is online

Users browsing this forum: No registered users and 5 guests

Hosted by Arvixe Web Hosting