Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Tracking Module


chris23

Recommended Posts

Only thing missing is if you click on the tracking number in the admin panel or in the costumer's account history, Clickng on the tracking (aboveYour tracking ID - click ID for full status) doesn't give any result. Do you have a hint?

 

Hi,

 

Do you get this problem for both types of Swiss Post tracking ID?

 

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

  • Replies 296
  • Created
  • Last Reply

Top Posters In This Topic

Hi,

 

Do you get this problem for both types of Swiss Post tracking ID?

 

Cheers

 

Chris

 

Hello Chris

 

With the 18 digits only number (standard version of the swisspost modul) there is no problem everything is diplayed correctly. With your mod ((aboveYour tracking ID - click ID for full status)) doesn't work. Here to trackng number to check yourself, as i noticed that national and international shippings are displayed differently on courrier website

I sent you a PM with 2 sample tracking numbers

 

Greetings

and thanks in advance

Link to comment
Share on other sites

i noticed that national and international shippings are displayed differently on courrier website

I sent you a PM with 2 sample tracking numbers

 

That will be the reason for your problem - the swisspost script tidies the returned html in a specific way. Any deviation in the returned html will break this.

 

What needs to be done is to apply a different cleaning function depending on the format of tracking id supplied.

 

I'll have a look at the IDs you've PMd and will post something here when I've had a look.

 

Kind regards,

 

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

Ok I found my problem, it is order edit contribution which are not updating the general status, it appeared to be updated, but it wasn't when checking the database.

I have another problem, the link on the track code doesn't work, using your module RM or mine LP. it shows java script:void(0); (using RM or LP module) -> My javascript is active.

 

Regards,

 

Hey chris ;)

 

Could you tell me why I got this problem ?

 

Regards,

 

Julien

Link to comment
Share on other sites

  • 2 weeks later...

Hi all,

My royal mail track and trace 1.3 has stopped contacting royal mail, it just displays contacting courier, then close. It was working fine until about 10 days ago, I havent changed anything in the code or settings.

 

any ideas please ?

 

Ken

Link to comment
Share on other sites

Hi all,

My royal mail track and trace 1.3 has stopped contacting royal mail, it just displays contacting courier, then close. It was working fine until about 10 days ago, I havent changed anything in the code or settings.

 

any ideas please ?

 

Ken

 

Looks like Royal Mail have changed their returned HTML!

 

EDIT rm_tracking.php

 

FIND:

 

$EndGrab = '<div class="FlexiList">';

 

REPLACE with

 

$EndGrab = '<div class="FlexiList default">';

 

Let's hope they leave things alone ...

 

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

Looks like Royal Mail have changed their returned HTML!

 

EDIT rm_tracking.php

 

FIND:

 

$EndGrab = '<div class="FlexiList">';

 

REPLACE with

 

$EndGrab = '<div class="FlexiList default">';

 

Let's hope they leave things alone ...

 

HTH

 

Chris

 

Bingo !

 

thanks Chris

Link to comment
Share on other sites

The 'default' change didn't fix it for me ... instead I had to change the line as follows ...

 

$EndGrab = '<div class="FlexiList null">';

 

I have checked this with International Signed For and Special Delivery ... POD was also working with this change.

 

HTH

 

Tony

Link to comment
Share on other sites

Mod is great just 1 small problem on royal mail, the box looks like

 

"Your item with reference DW761316714GB was delivered from our GALASHIELS Delivery Office on 20/03/08 .

 

Thank you for using this service.

 

The electronic Proof of Delivery may not be available for this item yet. Please allow up to 72 hours after delivery before checking"

 

Any ideas how to get rid of the Â?

 

Andy

Link to comment
Share on other sites

guess what ? mines stopped working today but
$EndGrab = '<div class="FlexiList null">';

fixed it just fine,

 

 

I'm going to have to modify the RM code to accept either "FlexiList null" or "FlexiList default" as both get returned, depending on the type of tracking ID. Helpful RM!

 

I'll post something when it's done

 

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

The electronic Proof of Delivery may not be available for this item yet. Please allow up to 72 hours after delivery before checking"

 

Any ideas how to get rid of the Â?

 

Andy

 

The Royal Mail script tries to fix this issue - it's caused by RMs UTF encoding clashing with osC's ISO encoding. Your server doesn't have multibyte support so your html can't be converted. Try this

 

EDIT rm_tracking.php

 

FIND:

 

if(function_exists(mb_convert_encoding)){
	echo mb_convert_encoding($content, "UTF-8", "ISO-8859-1");
} else {
   echo $content;
}

 

REPLACE WITH

 

	// the following functions will prevent 'UTF garbled' returned data. We try to use iconv (may be missing on Win32) or mb_convert_encoding (may not be compiled in to PHP)

if(function_exists(mb_convert_encoding)){
	echo mb_convert_encoding($content, "UTF-8", "ISO-8859-1");
} elseif(function_exists(iconv)){
	echo iconv("UTF-8", "ISO-8859-1", $content);
} else {
	echo $content;
}

 

If your server doesn't have the iconv library installed (it should), then I'm afraid you're out of luck.

 

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

New rm_tracking.php uploaded to contrib area:

 

Royal Mail have recently changed the returned HTML depending on tracking number type.

The enclosed rm_tracking.php will cater for the currently KNOWN return types.

If you find that certain services e.g international are failing, PLEASE report this on the forum; I don't have access to all the available types of ID!!

 

Just upload the new rm_tracking.php, overwriting your existing version.

 

Please let me know if your RM module ceases to function - RM seem to be messing with their tracking page and I'm not convinced they've finished. Nothing can be done in advance of this and is the main drawback of any screen scrape.

 

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

Have the Royal Mail changed their methos again, Site was working with tracking refs yesterday, today no good, Can you let us know how to address this?

 

Nice work sorting it out before

 

FOD

You can kill the King, but you can't kill the King Riddim...

Link to comment
Share on other sites

@FOD

@ihatedeskjets

 

Are you guys still having issues? My existing tracking numbers are working fine (so was wondering if there was a RM networking issue around the time you had a problem.)

 

It would help if you could post or PM tracking IDs that are failing so I can see the returned HTML

 

Are they doing it on purpose I wonder ?

 

Interesting question. The paranoid in me says `probably` but thinking about it more rationally, RM would really need to be studying their server logs closely.

The cURL script sends a dummy Firefox user agent string so provided your website (or server if on shared hosting) isn't hitting RMs site at some insane rate, I can't see them picking up anything suspicious in their logs..

 

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

@FOD

@ihatedeskjets

 

Are you guys still having issues? My existing tracking numbers are working fine (so was wondering if there was a RM networking issue around the time you had a problem.)

 

It would help if you could post or PM tracking IDs that are failing so I can see the returned HTML

Interesting question. The paranoid in me says `probably` but thinking about it more rationally, RM would really need to be studying their server logs closely.

The cURL script sends a dummy Firefox user agent string so provided your website (or server if on shared hosting) isn't hitting RMs site at some insane rate, I can't see them picking up anything suspicious in their logs..

 

Chris

 

Your right, I just checked and its ok now, i did wonder as the query timed out too fast before, now theres the usual approx 2 second delay and its getting the info ok again.

 

thanks Chris

 

Ken

Link to comment
Share on other sites

Your right, I just checked and its ok now, i did wonder as the query timed out too fast before, now theres the usual approx 2 second delay and its getting the info ok again.

 

thanks Chris

 

Ken

 

Royal Mail website was down last week - simply providing phone numbers to contact Royal Mail departments while maintenance is carried out.

Link to comment
Share on other sites

@FOD

@ihatedeskjets

 

Are you guys still having issues? My existing tracking numbers are working fine (so was wondering if there was a RM networking issue around the time you had a problem.)

 

It would help if you could post or PM tracking IDs that are failing so I can see the returned HTML

Interesting question. The paranoid in me says `probably` but thinking about it more rationally, RM would really need to be studying their server logs closely.

The cURL script sends a dummy Firefox user agent string so provided your website (or server if on shared hosting) isn't hitting RMs site at some insane rate, I can't see them picking up anything suspicious in their logs..

 

Chris

 

 

Yeah woring again my end thanks for the update!!

You can kill the King, but you can't kill the King Riddim...

Link to comment
Share on other sites

Hi Chris

 

Some International Signed for codes are working while some are not. There is no personal information contained within ISF Dispatch status reports so I have just posted them within the forum.

 

RI958800287GB is not working (as I type this anyway) while

RI958800239GB is working.

 

The first order is currently giving a status on RM Website of

Your item, posted on 01/04/08 with reference RI958800287GB has been passed to the overseas postal service for delivery in ITALY.

 

while the second is giving a delivered status of:

Your item, posted on 30/03/08 with reference RI958800239GB was delivered in EIRE on 02/04/08.

 

Thank you for using this service.

 

Tony

Link to comment
Share on other sites

RI958800287GB is not working (as I type this anyway) while

RI958800239GB is working.

 

Hi Tony,

 

$%£"! Royal Mail!

 

The first one isn't working as there is a bad alt tag in the HTML alt='it's on its way' - note the single quote within single quotes. This is causing strip_tags to choke.

 

The second one works as it's been delivered and doesn't have the offending alt tag.

 

To fix this, edit rm_tracking.php

 

AFTER

 

// Grab delivery status information and POD data.
$text = preg_match('/<div class="track-right-box">(.*)<div class="FlexiList( default| null)">/i', $grab_data, $content);

 

ADD:

 

	$content[1] = addslashes($content[1]);

 

This tidies up the HTML sufficiently for strip_tags to clean the rest. I get the feeling I'm going to be chasing my tail with RM ....

 

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

That will be the reason for your problem - the swisspost script tidies the returned html in a specific way. Any deviation in the returned html will break this.

 

What needs to be done is to apply a different cleaning function depending on the format of tracking id supplied.

 

I'll have a look at the IDs you've PMd and will post something here when I've had a look.

 

Kind regards,

 

Chris

 

 

Hello Chris. Did you find a solution for this bug? Thanks in advance

Link to comment
Share on other sites

  • 4 weeks later...

Hi,

Firstly, this is a great contribution, and really adds to the usefulness of our shop.

 

I've been using the RM module for some time, without any problems, and have just added the Business Post (due to the fact that RM are getting worse at delivering stuff every day!), and have found a couple of small problems:

1) My tracking numbers are 14 digits long (which I sorted out)

2) The module works fine for items that are delivered and in transit, but doesn't return any information for parcels in 'other' states (i.e. not booked into BP's server). from my experience with the RM module, this is because the site is returning info that is not understood. However, I can't figure out what!

Try: 30542020000087 for an example.

 

Suggestions etc. welcomed!

 

Also, a suggestion for a mod. (which I will probably make to my version) use a constant for the account info, (i.e. the 1st 7 numbers of the (in my case) 14 digits) and then allow the remaining characters to be typed, padding to 7 with zeros, which, when added to the end of the A/C number will make 14 digits.

Link to comment
Share on other sites

  • 1 month later...

Well I've spent all day going though the sample code on this contrib and after checking out the couriers websites for tracking, it became too scarey, nothing seemd to work for me.

 

So as I've now given up trying to make a module for DHL and EMS couriers, has anyone else alreadsy completed and prepared to share info?

Link to comment
Share on other sites

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