Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Tracking Module


chris23

Recommended Posts

Hi Chris,

This is a great contribution - thank you for your effort and your support on this board.

 

I have a wee undocumented feature - as noted by ogg2k:

 

Enter a tracking number without making any other change on your orders page, click update, and you get "Warning: Nothing to change. The order was not updated.".

 

I realise that testing in this case doesn't equal reality and we'd be changing the status while entering the tracking number so all would be well. But I thought that you may be a clever enough bunny to iron that out sometime between eating / sleeping / real job.

 

Also - to solve the error

"Warning: Cannot modify header information - headers already sent"

in catalogue\includes\languages\english\tracking_module.php

 

you need to trim the white space before <?php and after ?> in that file.

 

Thanks again,

 

Paul

Link to comment
Share on other sites

  • Replies 296
  • Created
  • Last Reply

Top Posters In This Topic

when I enter a tracking number and set the status to dispatched I get a blank page with this error

 

 

QUOTE

Warning: Cannot modify header information - headers already sent by (output started at Y:\yourdomain.com\catalogue\includes\languages\english\tracking_module.php:61) in Y:\yourdomain.com\catalogue\admin\includes\functions\general.php on line 22

 

 

cheers

Brian

 

Thanks Paul

Removed two carriage returns from very bottom of includes/english/tracking_module.php and all works fine. What a great contribution, thanks you Chris.

 

Brian

Link to comment
Share on other sites

Hi Chris,

This is a great contribution - thank you for your effort and your support on this board.

 

I have a wee undocumented feature - as noted by ogg2k:

 

Enter a tracking number without making any other change on your orders page, click update, and you get "Warning: Nothing to change. The order was not updated.".

 

I realise that testing in this case doesn't equal reality and we'd be changing the status while entering the tracking number so all would be well. But I thought that you may be a clever enough bunny to iron that out sometime between eating / sleeping / real job.

 

Also - to solve the error

"Warning: Cannot modify header information - headers already sent"

in catalogue\includes\languages\english\tracking_module.php

 

you need to trim the white space before <?php and after ?> in that file.

 

Thanks again,

 

Paul

 

Thanks Paul,

 

Well spotted about the stray whitespace. Could have sworn I'd got rid of it all :-" Common problem.

 

As to the "Warning: Nothing to change", as Bill Gates would say, this is a feature not a bug ... When thinking about the design, I decided that a tracking number

would be entered at the time a status was changed from Pending -> Delivered. If you enter a tracking ID without changing the status, the update is not allowed. This also helps prevent multiple submissions.

 

So to add tracking, you can either type a message in the comments or change the status.

 

If users are unhappy with this logic, it could be changed.

 

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

Hi Chris,

 

Tracking module is working well, No problem in Royal mail tracking.

But In city link Module Help Note stated:

 

"

Add Initial Citylink Tracking Data (if applicable to this order)

 

Please enter your 8 digit tracking ID for this order. Do not use spaces. The format is two letters, followed by 6 digits, eg AB123456

"

But When we are dispatching order through City Link Tracking Id provided by City link is some thing like this

VGZ12345

Means three letters followed by 5 digits.

When I enter this Data in Tracking field it comes up with this error

"The Initial Citylink ID you have supplied is not valid. Please check and try again. The required format is 2 letters, 6 digits eg AB123456. Do not use spaces."

 

Hi Zee,

 

OK Guys, I'll need your help here. I don't use Citylink and was given a bunch of valid tracking IDs. They are the format two letters, 6 digits ie AB123456. This is what the citylink module will validate.

 

Question is, what other formats are valid? If Zee has three letters and 5 digits, why is this a different format.

 

I can easily rectify this if someone can educate me!

 

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

As to the "Warning: Nothing to change", as Bill Gates would say, this is a feature not a bug ... When thinking about the design, I decided that a tracking number

would be entered at the time a status was changed from Pending -> Delivered. If you enter a tracking ID without changing the status, the update is not allowed. This also helps prevent multiple submissions.

 

So to add tracking, you can either type a message in the comments or change the status.

 

I still have the problem of the tracking number not being saved even if I change from Pending -> Delivered. Change is processed and email is sent but the tracking number is not saved.

 

i have a lot of contributions install so i think there must be a conflict some where.

 

Any ideas??

 

Rob

Link to comment
Share on other sites

I still have the problem of the tracking number not being saved even if I change from Pending -> Delivered. Change is processed and email is sent but the tracking number is not saved.

 

i have a lot of contributions install so i think there must be a conflict some where.

 

Any ideas??

 

Rob

 

Robert,

Does the tracking id appear in the email?

When the order is processed the tracking id is added to the email, then inserted in the db.

If the tracking id is in the email, please check your admin/orders.php for:

 

 tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments, tracking_id) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments)  . "', '" . tep_db_input($tracking->insert_tracking_id()) . "')");

 

If the e-mail has tracking data missing, let me know.

 

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 Chris

re the citylink contribution, we use them and our consignments are AIL prefix I don't know the number of digits but can find out in the morning when back in office.

 

On the parcelforce contribution the letters/numbers combination will only let you track UK domestic movements, international consignment numbers are a different combination, bear in mind international covers UK>Ireland deliveries

 

cheers

Brian

Link to comment
Share on other sites

On the parcelforce contribution the letters/numbers combination will only let you track UK domestic movements, international consignment numbers are a different combination, bear in mind international covers UK>Ireland deliveries

 

Thanks Brian,

If it's not an imposition, can you get the format for Parcelforce for me too. I'll update Citylink and Parcelforce at the same time

TIA

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 chris here is the info you need

 

Parcelforce

UK Domestic: two letters and seven digits

International deliveries: two letters, nine digits and two letters. example EE123456789GB

(GB) might be common denominator on all consignments

 

City Link

UK + N. Ireland only deliveries: Three letters and five digits

(Thats for us in Northern Ireland I do not know about the rest of UK)

 

hope this helps

Brian

Link to comment
Share on other sites

OK chris here is the info you need

 

Parcelforce

UK Domestic: two letters and seven digits

International deliveries: two letters, nine digits and two letters. example EE123456789GB

(GB) might be common denominator on all consignments

 

Thanks very much Brian.

 

Looks like Parcelforce International is exactly the same as Royal Mail domestic!

 

City Link

UK + N. Ireland only deliveries: Three letters and five digits

(Thats for us in Northern Ireland I do not know about the rest of UK)

 

I think there must be more to it than this - try VM805054. This is a UK Citylink and it works (was actually a parcel received by me)

 

I'm wondering if Citylink are still supporting legacy Target Express codes?

 

I suppose I could just get 3+5 and 2+6 to validate but it's a bit hit and miss :'(

 

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

Robert,

Does the tracking id appear in the email?

When the order is processed the tracking id is added to the email, then inserted in the db.

If the tracking id is in the email, please check your admin/orders.php for:

 

 tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments, tracking_id) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments)  . "', '" . tep_db_input($tracking->insert_tracking_id()) . "')");

 

If the e-mail has tracking data missing, let me know.

 

Chris

 

 

Hi

 

No there is no tracking data in the email, I have also looked in the DB and there in no tracking data there ether.

Rob

 

 

Any one Had this problem?

Link to comment
Share on other sites

Hi

 

Got most of this working, allmost ready to relase the Norwegian module for this.

 

I got a problem with the "ajax popup" that connects to the courier.

 

For some reason i can't get this to work in ordrers.php and ds_account_history_info.php

When i click on the tracking link i get this message

"

Unable to find an active Internet connection. Please check your settings.

 

[x] Lukk

"

 

Any idea?

Link to comment
Share on other sites

Unable to find an active Internet connection. Please check your settings.

 

[x] Lukk

 

Hi,

 

You can get odd cURL error messages if your php tracking script is failing for any reason.

 

What you can do is set your tracking script to a basic debug mode, then call it directly. This will highlight any errors with the script.

 

Edit your tracking script eg xx_tracking.php

 

comment out (so you can call th script by its url)

 

 if (!isset($_GET['tracking_id'])) {
	die('Direct call to script. Exiting.');
}

 

Add:

 

 error_reporting(E_ERROR | E_WARNING | E_PARSE);

 

after the opening <?php

 

comment out:

 

$tracking_number = $_GET['tracking_id'];

 

then hardcode in a valid tracking id e.g.

 

$tracking_number = "xyz123456";

 

If you're using one of my existing files as a template, I've discovered that many PHP installations don't have multibyte support compiled in so the Royal Mail script was bombing. If you're using:

 

echo mb_convert_encoding($content, "UTF-8", "ISO-8859-1");

 

it's best to change it to

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

 

To make sure all the required constants are set, you can use the following block to dump them to the browser:

 

echo "<p>Dump tracking constants: <p><p>";

			// get validation regexps
			$configuration_query = tep_db_query("select configuration_key as cfgKey, configuration_value as cfgValue from " . TABLE_CONFIGURATION . " WHERE `configuration_key`='TRACKING_REGEXP_RM'");
			while ($configuration = tep_db_fetch_array($configuration_query)) {
				echo $configuration['cfgKey'] . " : " . $configuration['cfgValue'] . "<p>";
			}
			// get module filenames
			$configuration_query = tep_db_query("select configuration_key as cfgKey, configuration_value as cfgValue from " . TABLE_CONFIGURATION . " WHERE `configuration_key`='TRACKING_FILENAME_RM'");
			while ($configuration = tep_db_fetch_array($configuration_query)) {
			   echo $configuration['cfgKey'] . " : " . $configuration['cfgValue'] . "<p>";
			}

			// get tracking id lengths (for tracking id input "maxlengths")
			$configuration_query = tep_db_query("select configuration_key as cfgKey, configuration_value as cfgValue from " . TABLE_CONFIGURATION . " WHERE `configuration_key`='TRACKING_ID_LENGTH_RM'");
			while ($configuration = tep_db_fetch_array($configuration_query)) {
				echo $configuration['cfgKey'] . " : " . $configuration['cfgValue'] . "<p>";
			}

			// get module versions
			$configuration_query = tep_db_query("select configuration_key as cfgKey, configuration_value as cfgValue from " . TABLE_CONFIGURATION . " WHERE `configuration_key`='TRACKING_MODULE_VERSION_RM'");
			while ($configuration = tep_db_fetch_array($configuration_query)) {
			   echo $configuration['cfgKey'] . " : " . $configuration['cfgValue'] . "<p>";
			}

			// get tracking get urls
			$configuration_query = tep_db_query("select configuration_key as cfgKey, configuration_value as cfgValue from " . TABLE_CONFIGURATION . " WHERE `configuration_key`='TRACKING_GET_URL_RM'");
			while ($configuration = tep_db_fetch_array($configuration_query)) {
			   echo $configuration['cfgKey'] . " : " . $configuration['cfgValue'] . "<p>";
			}

 

If all constants are set and no errors are being generated, I'm not sure what else could be going wrong. If you're still stuck, PM me for my email address so you can send a copy of your xx_tracking.php script.

 

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

Any one Had this problem?

 

Hi Robert,

Can you check over your code changes on admin/orders.php and make sure it matches the install instructions.

If you're still having problems, I can send you a debugging script to upload. I can then make sure all required constants / variables are being set and passed properly. PM me for a copy.

Rgds

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 the "Warning: Nothing to change", as Bill Gates would say, this is a feature not a bug ... When thinking about the design, I decided that a tracking number

would be entered at the time a status was changed from Pending -> Delivered. If you enter a tracking ID without changing the status, the update is not allowed. This also helps prevent multiple submissions.

 

Yup - quite right - and now having used it for real a few times - it's perfectly logical and better that way.

 

Top Banana Chris.

 

Cheers,

 

Paul

Link to comment
Share on other sites

  • 2 weeks later...
Hi Robert,

Can you check over your code changes on admin/orders.php and make sure it matches the install instructions.

If you're still having problems, I can send you a debugging script to upload. I can then make sure all required constants / variables are being set and passed properly. PM me for a copy.

Rgds

Chris

 

I have check my orders.php with the install instruction and all is right. I have also replaced my orders.php with the one in the pack and it still wont work.

 

I have install the tracking module on a fresh copy of osc in my server and all work right, so i think there is a conflit with another mod i have install, but i cant find where.

 

Does anyone have this problem or know where the problem might be.

 

Thanks

 

Rob

Link to comment
Share on other sites

I have check my orders.php with the install instruction and all is right. I have also replaced my orders.php with the one in the pack and it still wont work.

 

I have install the tracking module on a fresh copy of osc in my server and all work right, so i think there is a conflit with another mod i have install, but i cant find where.

 

Does anyone have this problem or know where the problem might be.

 

Thanks

 

Rob

 

Rob,

 

Apologies. I've been slammed this week with work deadlines and have forgotten to send you a debug script. Please check your PMs

 

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

DO you hae idea if you will work in UPS module here or i must install other contrib for my ups shipping order thank you

 

Hi,

I'm hoping not to write any more modules! This was the idea behind providing this code. I'm hoping other users will jump in and write their own modules for their couriers.

I really don't have the time to write for all the couriers out there.

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

There's a new version of Royal Mail Track & Trace uploaded to the contrib area.

Royal Mail have recently changed their web site redirects, breaking the existing module.

Follow the "Upgrading" instructions if you've an exisitng version installed.

This fix should only take a minute to apply.

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

There's a new version of Royal Mail Track & Trace uploaded to the contrib area.

Royal Mail have recently changed their web site redirects, breaking the existing module.

Follow the "Upgrading" instructions if you've an exisitng version installed.

This fix should only take a minute to apply.

Cheers

Chris

 

 

Doesn't work for me, I'm getting Error calling tracking script. Please try later message for all orders delivered. If they aren't delived yet I get the correct maessage from Royal Mail i.. Recorded Signed For™ items are only tracked after the item has been delivered. Depending on whether the item was sent first or second class, this may be a few days after posting. Please try again later.

 

Information on your item is not yet available online.

 

 

Also install name of file different was rm_track_trace.php now rm_tracking.php, When you remove and install from modules uses old file name: rm_track_trace.php shouldn't it be the later?

 

Was working beautifully before Royal Mail changed their system, Even entering codes on their site now can cause errors...

 

Any suggestions as to why I'm getting this error?

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

Link to comment
Share on other sites

Also install name of file different was rm_track_trace.php now rm_tracking.php, When you remove and install from modules uses old file name: rm_track_trace.php shouldn't it be the later?

 

Was working beautifully before Royal Mail changed their system, Even entering codes on their site now can cause errors...

 

Any suggestions as to why I'm getting this error?

 

Hi,

 

To clarify the naming issue. The rm_track_trace.php was used by the original stand alone Royal Mail Track & Trace. When I wrote the tracking module and changed to this "plugin" system, I changed the filename to rm_tracking.php (one reason to avoid me confusing the two versions)

 

If you've now upgraded to this tracking module version, then you should no longer have a copy of rm_track_trace.php.

 

I haven't provided a fix to the old rm_track_trace.php as I'm hoping to get everyone to switch (I appreciate this is a big one-off job) so only one mod needs maintaining.

 

If you're still using the old standalone version, you can incorporate the recent fix - compare the source code. The fix has an extra call to curl to accommodate Royal Mails extra redirect.

 

If I've misunderstood your problem, please get back to me.

 

Regards,

 

Chris

Edited by chris23

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

 

can someone please help me.

 

I have installed the tracking module and then the city link tracking option.

 

Please can you tell me why i get the following errors.

 

Warning: constant() [function.constant]: Couldn't find constant EMAIL_NOTIFICATION_ in /home/incarmar/public_html/includes/classes/tracking_module.php on line 186

Warning: Cannot modify header information - headers already sent by (output started at /home/incarmar/public_html/includes/languages/english/tracking_module.php:43) in /home/incarmar/public_html/admin/includes/functions/general.php on line 22

 

Regards

Pete

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