Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[conribution] Royal Mail Track And Trace™ - Ajax V1.0


chris23

Recommended Posts

it works great except I get the following

The�electronic�Proof�of�Delivery�may�not�be�available�for�th

is�item�yet.�Please�allow�up�to�72�hours�after�delivery�bef

ore�checking

but its all on one line

 

This has come up on the forum but until you gave me the login to your example, I've not been able to see it myself. I'm going to try your tracking ID in my test environments and see if I can replicate this issue. Don't know if it's you, me or Royal Mail! Will post my results here.

 

Also after clicking on the link (customer side) and then closing the box I am left with a huge space at the top the page unless I refresh it or goto another page, Again is this something I have done wrong?

 

Your div should appear below the order statuses - having looked briefly at your source you have the div after a </td>. Please double check where you placed the <div> code

 

If you wish to see it please goto http://get-wireless.co.uk/dev login is

[email protected]

testtest

and there is an order with a valid RM number

 

I just need to get my emails working properly now, I did a test purchase on my website and updated the order but the emails are not been sent in html format the text is there for link to royalmail but its not clickable and I have my email client (outlook)

 

Not guilty! If you set emails to HTML Mime, the osC mail function doesn't generate hyperlinks - there is a contrib to fix this.

 

Also the link to the customers account doesnt display the full url it starts from the folder where the my shop is IE.

Instead of displaying

 

http://get-wireless.co.uk/dev/account_hist...hp?order_id=159

 

in the email it displays

 

/dev/account_history_info.php?order_id=159

 

Nothing you've added with this contrib should have affected this as all I do is append the tracking id to the end of the message. I can't replicate this. You need to compare your $e-mail = .... block with a vanilla orders.php

 

HTH

 

Chris

Please use forum for support rather than PM - PMs unrelated to my contributions will be ignored.

Google Site Search is your friend

My contributions: Tracking Module | PDF Customer Invoice | Subcategory textboxes

Link to comment
Share on other sites

This has come up on the forum but until you gave me the login to your example, I've not been able to see it myself. I'm going to try your tracking ID in my test environments and see if I can replicate this issue. Don't know if it's you, me or Royal Mail! Will post my results here

 

OK - this is now fixed. It was a character encoding issue, ISO-8859 as specified in osC, versus RM UTF-8

 

Replacement rm_track_trace.php has been uploaded to contrib area.

 

Chris

Please use forum for support rather than PM - PMs unrelated to my contributions will be ignored.

Google Site Search is your friend

My contributions: Tracking Module | PDF Customer Invoice | Subcategory textboxes

Link to comment
Share on other sites

Not guilty! If you set emails to HTML Mime, the osC mail function doesn't generate hyperlinks - there is a contrib to fix this.

 

I know its not this contrib, I have had it for a while now. Just ones of those annoying little niggles I have never got round to fixing. I will take a look at the other contrib you mentioned. Thanks

 

Your div should appear below the order statuses - having looked briefly at your source you have the div after a </td>. Please double check where you placed the <div> code

 

In the instructions it says

AFTER (line 223):

 

?>

</table></td>

</tr>

</table>

 

ADD:

 

<div id="text_box" style="margin: 10px 0 0 0"><noscript>

<div class="messageStackError"><?php echo RM_NO_JS_ALTERNATIVE; ?></div>

</noscript></div>

 

However since my store is heavily modded I dont have that that exact code mine was.

?>
		</table></td>
	  </tr>
	</table></td>
  </tr>

 

I have played about a bit with the code and got the info box at the bottom now as it should be but when I click close there is still a gap. this can be lived with but would be nice to get rid of it. Also the text goes outside the box, This is probably down to my <table> issue but cant seem to fix it.

 

Here is my current code

<?php
 $statuses_query = tep_db_query("select os.orders_status_name, osh.date_added, osh.comments, osh.rm_tracking_id from " . TABLE_ORDERS_STATUS . " os, " . TABLE_ORDERS_STATUS_HISTORY . " osh where osh.orders_id = '" . (int)$HTTP_GET_VARS['order_id'] . "' and osh.orders_status_id = os.orders_status_id and os.language_id = '" . (int)$languages_id . "' order by osh.date_added");
 while ($statuses = tep_db_fetch_array($statuses_query)) {
echo '			  <tr>' . "\n" .
	 '				<td class="main" valign="top" width="70">' . tep_date_short($statuses['date_added']) . '</td>' . "\n" .
	 '				<td class="main" valign="top" width="70">' . $statuses['orders_status_name'] . '</td>' . "\n" .
	 '				<td class="main" valign="top">' . (empty($statuses['comments']) ? ' ' : nl2br(tep_output_string_protected($statuses['comments']))) . '</td>' . "\n" .
	 '				<td class="main" valign="top">' . (empty($statuses['rm_tracking_id']) ? ' ' : '<a title="' . RM_LINK_TITLE . '" href="java script:void(0);" onclick="ajaxFunction(\'text_box\',\'' . $statuses['rm_tracking_id'] . '\');">' . $statuses['rm_tracking_id'] . '</a> ' . RM_LINK_LABEL) . "\n" .
	 '			  </tr>' . "\n";
 }
?>
		</table></td>
	  </tr>
	</table>
<div id="text_box" style="margin: 10px 0 0 0"><noscript>
	<div class="messageStackError"><?php echo RM_NO_JS_ALTERNATIVE; ?></div>
	</noscript></div>		
  </td></tr>
<?php

 

Here is a link to my account_history_info I would be very grateful if you would take a look for me.

http://www.get-wireless.co.uk/files/account_history_info.zip

 

Many thanks for a great contrib

Link to comment
Share on other sites

I have now added the contrib to make the emails in html format.

 

So the url to the order works on the order process email

 

At first it didnt include the rm tracking info so I added

 

 

$email .= $notify_rm; // added rm_track_trace

 

To the catalog/checkout_process.php file and its now there, However its still not clickable.

 

Sorry but my php is very limited.

 

What do I need to do to get the RM link to work?

 

Regards

Shaun

 

Also off topic but with regards to my emails being sent

The order process that is sent when a customer makes a purchase has

Detailed Invoice: http://get-wireless.co.uk/dev/account_hist...hp?order_id=162

Yet the order update email on has

Detailed Invoice: /dev/account_history_info.php?order_id=162

 

Not sure if this will help?

Edited by Get-Wireless 2
Link to comment
Share on other sites

Hi Shaun,

 

Fixing your spacing when closing the <div> is easy, as is the width problem for the text (incidentally, if you go to RM's site, the same text runs outside their div too!!)

 

Edit both stylesheet.css and admin/includes/stylesheet.css

 

You have two entries:

 

.rm_div {
background-color: #f3f3f3;
border: solid 2px #e5e5e5;
padding: 10px;
font-size: 10px;
margin: 10px 0 0 0;
width: 50%;
font-family: Verdana, Arial, sans-serif;
}

 

Change width: 50%;

 

to width: auto;

 

That'll fix the width issue.

 

.hiddenDiv {
visibility: hidden;
}

 

This decides what happens to the div when you click [x] Close. My preference is to hide it (i.e. the div still takes space on the page, hence the gap)

 

If you want to have the div disappear, ie be taken out of the page flow, change visibility: hidden to display: none

 

However, what happens in this instance is any elements below the div will "jump" up the page when the div goes. I personally find this irritating and rather keep the gap.

 

Whatever floats your boat!

 

As to your html email issue. Do you really need them? From experience, they look pretty much the same in the case of osC and in the plain text ones the links work fine (not to mention HTML emails are the devil's work - maybe this is just me showing one of my many prejudices or my age here!)

 

If you really want the HTML route, I'll have a look at the contib and see exactly what it's doing. It may be a specific fix for just the order info link, not all contained links. Ideally a fix to osC's emailer would be a better solution; something for a rainy day ... >_<

 

Your broken link issue:

 

Have you defined:

 

HTTP_CATALOG_SERVER
DIR_WS_CATALOG
HTTPS_CATALOG_SERVER

 

in admin/includes/config.php?

 

It looks like admin/orders.php doesn't have the path info to catalog/account_history_info.php

 

HTH

 

Chris

Please use forum for support rather than PM - PMs unrelated to my contributions will be ignored.

Google Site Search is your friend

My contributions: Tracking Module | PDF Customer Invoice | Subcategory textboxes

Link to comment
Share on other sites

As to your html email issue. Do you really need them? From experience, they look pretty much the same in the case of osC and in the plain text ones the links work fine (not to mention HTML emails are the devil's work - maybe this is just me showing one of my many prejudices or my age here!)

 

If you really want the HTML route, I'll have a look at the contib and see exactly what it's doing. It may be a specific fix for just the order info link, not all contained links. Ideally a fix to osC's emailer would be a better solution; something for a rainy day ... >_<

HTH

 

Chris

 

Hi Chris, thanks for the fixes to style sheet they work great now, Also if you dont mind I would like to try and get the links to work. Might aswell since they are in the email. If its gonna be too much hassle tho it doesnt matter.

 

I will take a look at the other issues I have with my emails and check the files you mentioned.

 

Kind Regards

Shaun

Link to comment
Share on other sites

Hi Shaun,

 

 

Your broken link issue:

 

Have you defined:

 

HTTP_CATALOG_SERVER
DIR_WS_CATALOG
HTTPS_CATALOG_SERVER

 

in admin/includes/config.php?

 

It looks like admin/orders.php doesn't have the path info to catalog/account_history_info.php

 

HTH

 

Chris

 

 

Thanks Chris your a star, my link is displayed properly in the emails sent out now :)

 

I was missing

define('HTTP_CATALOG_SERVER', 'http://www.get-wireless.co.uk');

It was actualy

define('HTTP_CATALOG_SERVER', '');

 

Cheers your a star :D

Link to comment
Share on other sites

  • 3 weeks later...

Hi guys,

 

I've installed the track and trace system to my site and I can successfully add a tracking number in admin but when i goto view it on the order history and try to click on the trace number I get this message at the top of the page:

 

Fatal error: Call to undefined function: curl_init() in

/www/rm_track_trace.php on line 32

 

here's what line 32 looks like:-

 

$ch = curl_init();

curl_setopt($ch, CURLOPT_USERAGENT, $agent);

curl_setopt($ch, CURLOPT_URL, $url);

curl_setopt($ch, CURLOPT_HEADER, true);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

 

Any ideas? other than this its working fine.

 

Also another question...I wish to create a box wish the user can insert the tracking number in (without logging in) and do the trace from there...as seen on ebuyer.com

 

 

Regards,

Daniel

Link to comment
Share on other sites

Fatal error: Call to undefined function: curl_init() in

/www/rm_track_trace.php on line 32

 

Hi Daniel,

 

It looks like your PHP installation doesn't have cURL enabled. This is an absolute prerequisite for this contribution to work. From the readme.txt

 

Before attempting installation, you ** must ** ensure your server has PHP compiled with cURL. Please don't bother installing if your hosting

provider does not provide cURL - IT WILL NOT WORK.

 

If you're not sure whether you have cURL support, from your osCommerce admin panel, click 'Tools' -> 'Server Info' and look for:

 

cURL support enabled

cURL Information libcurl/7.16.0 OpenSSL/0.9.8a zlib/1.2.3

 

or similar.

 

Please check your server info to see whether you have cURL support. If not, can you let me know what type of server you are running on? If it's a local test server, we should be able to enable cURL.

 

If you've installed on a live hosting account, getting cURL enabled is something you'll need to take up with your hosting provider. If you're on a shared server, they may be unwilling to enable cURL as it is a very powerful extension to PHP and can be a security risk if wrongly configured.

 

Also another question...I wish to create a box wish the user can insert the tracking number in (without logging in) and do the trace from there...as seen on ebuyer.com

 

Create an infobox with a form. Use the checking code from admin/orders.php to validate the tracking id and submit the form to rm_track_trace.php using the same query string as orders.php using GET.

 

HTH

 

Chris

Please use forum for support rather than PM - PMs unrelated to my contributions will be ignored.

Google Site Search is your friend

My contributions: Tracking Module | PDF Customer Invoice | Subcategory textboxes

Link to comment
Share on other sites

Hi Daniel,

 

It looks like your PHP installation doesn't have cURL enabled. This is an absolute prerequisite for this contribution to work. From the readme.txt

Please check your server info to see whether you have cURL support. If not, can you let me know what type of server you are running on? If it's a local test server, we should be able to enable cURL.

 

If you've installed on a live hosting account, getting cURL enabled is something you'll need to take up with your hosting provider. If you're on a shared server, they may be unwilling to enable cURL as it is a very powerful extension to PHP and can be a security risk if wrongly configured.

Create an infobox with a form. Use the checking code from admin/orders.php to validate the tracking id and submit the form to rm_track_trace.php using the same query string as orders.php using GET.

 

HTH

 

Chris

 

Hi Chris,

 

Thanks for the quick response...my site is hosted by a provider and I've checked both on my hosted service and within the admin section of oscommerce and couldn't see cURL anywhere, my apologises...I'm pretty new to this.

 

With regards to the info tracking box...again I'm pretty new and wouldn't have a clue how to do this, I'm okay with html and have just started to use php. Is there any further advice you can give me or know of a contribution?

 

Many thanks for all your help, it is much appreciated.

 

Regards,

Daniel

Link to comment
Share on other sites

  • 2 weeks later...

Recently I installed RMTAT v1.1 an 1.1Patch, but after that I am having that error in admin area order screen:

 

 

1054 - Unknown column 'rm_tracking_id' in 'field list'

 

select orders_status_id, date_added, customer_notified, comments, rm_tracking_id from orders_status_history where orders_id = '5' order by date_added

 

[TEP STOP]

 

 

I'm not so into that, so please any help will be advantage for me.

 

ps. SQL file was ran.

Link to comment
Share on other sites

  • 4 weeks later...
hi,

any updates on installing both parcelforce and royalmail together

 

thanks

bn

 

Hi Bryan,

 

I have been looking at this one and off (more off than on lately I must admit)

It's my intention to try and provide a simple framework to allow other couriers tracking to be added at a later stage. This is proving a more lengthy process but I feel

in the long run it'll be a useful add-on

I've got a combined contribution underway, the following is what's done and what's pending

 

Done:

 

Tracking method is automatically detected from the shipping method chosen by the customer, e.g. if you have RM 1st Class Recorded and RM 1st Standard, then you'll only have the ability to add a tracking ID for Recorded. Likewise, the orders processing page will display either PF or RM, not both.

 

Todo:

 

i) Rewrite the AJAX code to call the correct tracking module. Again, I'm going to make this more generic so that eg citylink, interlink etc can be accommodated

ii) Write the installation instructions. It's worth pointing out that there won't be any upgrade instructions from either of the earlier contributions as this is a complete rewrite

 

All being well, there should be a combined contribution done within the next 7-10 days, bugs permitting :-"

 

If anyone has any ideas for what they'd like to see in a combined contribution, now's the time to say ......

 

HTH

 

Chris

Please use forum for support rather than PM - PMs unrelated to my contributions will be ignored.

Google Site Search is your friend

My contributions: Tracking Module | PDF Customer Invoice | Subcategory textboxes

Link to comment
Share on other sites

  • 2 weeks later...

Just a quick update.

Things are progressing on a replacement of the current code.

I've almost completed the module system. It's been a lot of work but seems pretty flexible - I wrote an Initial Citylink module as an exercise and it took about 30 minutes from start to finish and worked straight off (much to my surprise!). I'll be adding the Citylink module to the first release.

You'll be able to use Royal Mail, Parcelforce and Citylink, either singly or in combination.

I now need to document how things work so other couriers can be added.

My 7 - 10 day estimate is slipping, but this is turning into quite a big project .... :'(

Cheers

Chris

Please use forum for support rather than PM - PMs unrelated to my contributions will be ignored.

Google Site Search is your friend

My contributions: Tracking Module | PDF Customer Invoice | Subcategory textboxes

Link to comment
Share on other sites

  • 2 weeks later...

A new contribution has been uploaded:

 

http://addons.oscommerce.com/info/5535

 

This is a complete tracking framework and is replacing both Royal Mail & Parcelforce.

 

It allows for multiple couriers to be used simultaneously.

 

It also provides all the tools needed for other couriers to be easily catered for.

 

A new module for Initial Citylink has also been uploaded.

 

I will continue to support existing users of these earlier versions, but will not be developing them further.

 

There is no upgrade path from either Parcelforce Track & Trace or Royal Mail Track & Trace - the new version is a total rewrite. If you want to use the new version then unfortunately you'll need to uninstall your existing version.

 

Cheers

 

Chris

Please use forum for support rather than PM - PMs unrelated to my contributions will be ignored.

Google Site Search is your friend

My contributions: Tracking Module | PDF Customer Invoice | Subcategory textboxes

Link to comment
Share on other sites

  • 9 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...