Post by dry_flood » Sat Feb 12, 2011 9: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

Version 1.1.0

Last edited by dry_flood on Sat Feb 19, 2011 4:07 am, edited 2 times in total.

New member

Posts

Joined
Tue Dec 14, 2010 4:33 am

Post by philbydevil » Thu Feb 17, 2011 6:41 pm

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 heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by dry_flood » Fri Feb 18, 2011 2:28 am

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

New member

Posts

Joined
Tue Dec 14, 2010 4:33 am

Post by philbydevil » Fri Feb 18, 2011 10: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 heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by dry_flood » Sat Feb 19, 2011 4:46 am

New version released. See first post.

Cheers
Gaz

New member

Posts

Joined
Tue Dec 14, 2010 4:33 am

Post by philbydevil » Sat Feb 19, 2011 6:53 pm

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 7849 times

Thanks again to Gaz, Gerrit, Q and anyone else who has helped make this dream come true :clown: :crazy: :clown:

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by dinmc » Thu Mar 31, 2011 11: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?

New member

Posts

Joined
Tue Mar 22, 2011 5:01 pm

Post by spitos » Wed May 25, 2011 5:38 am

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
Google Analytics Expert - Advanced e-commerce tracking, Product & options reporting, transaction/conversion reporting, Google Adwords conversion & profit reporting, goal & funnel reporting, event tracking, site search tracking, multi-store compatibility, EU Cookie Law compliance and works with any theme or checkout! Easy vqmod install. Get it here


User avatar
Active Member

Posts

Joined
Mon May 23, 2011 6:19 pm
Location - UK

Post by spitos » Wed May 25, 2011 9: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
Google Analytics Expert - Advanced e-commerce tracking, Product & options reporting, transaction/conversion reporting, Google Adwords conversion & profit reporting, goal & funnel reporting, event tracking, site search tracking, multi-store compatibility, EU Cookie Law compliance and works with any theme or checkout! Easy vqmod install. Get it here


User avatar
Active Member

Posts

Joined
Mon May 23, 2011 6:19 pm
Location - UK

Post by spitos » Fri May 27, 2011 5:23 pm

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
Google Analytics Expert - Advanced e-commerce tracking, Product & options reporting, transaction/conversion reporting, Google Adwords conversion & profit reporting, goal & funnel reporting, event tracking, site search tracking, multi-store compatibility, EU Cookie Law compliance and works with any theme or checkout! Easy vqmod install. Get it here


User avatar
Active Member

Posts

Joined
Mon May 23, 2011 6:19 pm
Location - UK

Post by DannyMacD » Tue Jul 05, 2011 7:59 am

is this 1.5.* ready?

Active Member

Posts

Joined
Fri Jun 26, 2009 6:39 am

Post by DannyMacD » Mon Jul 11, 2011 6:12 pm

anyone tested with latest 1.5.0.5?

many thanks.

Active Member

Posts

Joined
Fri Jun 26, 2009 6:39 am

Post by dry_flood » Mon Jul 11, 2011 8: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

New member

Posts

Joined
Tue Dec 14, 2010 4:33 am

Post by Klimskady » Wed Aug 03, 2011 12:18 am

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?

Active Member

Posts

Joined
Tue Jun 07, 2011 7:57 am

Post by DannyMacD » Mon Aug 29, 2011 1:18 am

has anyone managed to get this to work with 1.5.* ?

Active Member

Posts

Joined
Fri Jun 26, 2009 6:39 am

Post by dry_flood » Wed Aug 31, 2011 5:35 am

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

New member

Posts

Joined
Tue Dec 14, 2010 4:33 am

Post by uksitebuilder » Wed Aug 31, 2011 6:05 am

I believe Daniel is expanding Royal Mail in the next OC release.

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by jimmyholand88 » Mon Nov 14, 2011 6:52 pm

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

Royal Rodale


Newbie

Posts

Joined
Mon Nov 14, 2011 6:50 pm

Post by Klimskady » Sun Jan 08, 2012 11: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

Active Member

Posts

Joined
Tue Jun 07, 2011 7:57 am

Active Member

Posts

Joined
Fri Mar 12, 2010 6:31 am
Who is online

Users browsing this forum: No registered users and 57 guests