Jump to content
Sign in to follow this  
heliosquare

[Contribution] UPS XML Tracking

Recommended Posts

Hello Steve:

Sorry I wasn't describle my response well ~~ . I mean Yes, I do have tracking.php in the content under file /catalog/ below is my tracking.php attach which under catalog/ Please check thank you so much again sorry for that I didn't describle correctly ~.

 

<?php
require('includes/application_top.php');
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_TRACKING);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<meta name="author" content="">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (getenv('HTTPS') == 'on' ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<table border="0" width="770" cellspacing="0" cellpadding="3">
<tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top">
       <table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
    </table>
     </td>
      <td width="100%" valign="top">
       <table border="0" width="100%" cellspacing="0" cellpadding="0">
       <tr>
         <td width="100%">
                   <table border="0" width="100%" cellspacing="0" cellpadding="0">
             <tr>
               <td class="prodCatHeading"><?php echo HEADING_TITLE; ?></td>
               <td align="right"> </td>
             </tr>
          </table>
                  </td>
       </tr>
       <tr>
         <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
       </tr>
       <tr>
         <td>
                      <table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td class="main">
                                  <form method="post" action="<?php echo $PHP_SELF; ?>">
                                  <table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td align="left" class="main" width="65"><?php echo tep_image(DIR_WS_IMAGES . 'ups_logo.gif'); ?></td>
                                          <td><img src="images/pixel_trans.gif" width="5" height="5"></td>
                                          <td align="left" valign="top" class="main"><b>Enter your UPS tracking number below</b><br><br>
                                          <input type="hidden" name="action" value="track">
                                    <input type="text" name="tracknum" value="<?php echo $tracknum; ?>" maxlength="100" size="20"> 
                                    <input type="submit" name="button" value="Track!"></td>
             </tr>
                                  </table>
         </form>
                              </td>
                          </tr>
                          <tr>
                  <td>
                     <?php include(DIR_WS_CLASSES . FILENAME_TRACKING); ?>
                     </td>
                 </tr>
                      </table>
                  </td>
              </tr>
          </table>
      </td>
  </tr>
</table>
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Share this post


Link to post
Share on other sites
OK I have ran into a problem for some reason.  I used heliosquare's webpage as an example.  I went to his tracking page here:

 

http://www.frigidfluidco.com/tracking.php

 

Then entered this number 1z7285771210030731

 

No information was returned.  But when I go here

 

http://www.hightechthings.com/tracking.php

 

And enter the same number 1z7285771210030731 I get the error that was described here earlier.

 

I have all the latest updates.  Does anyone know why this is happening?  Do I need to go back to a previous file in the contribution section?  Any help with this will be appreciated.

 

Thanks

OK I don't know if this is a similar problem But when i enter my client's tracking numbers for her customers, the page just refreshes and the popup page for the customer is blank except for the background from the stylsheet. When i use the tracking code from an earlier post 1ZY16W740390558569 i get results. I don't get it. What's really wierd is everything was fine until I moved them from one server to another. How would that affect anything? The site in question is O'Brien's Canine Supplies. Help me out here!!!

Share this post


Link to post
Share on other sites
OK I don't know if this is a similar problem But when i enter my client's tracking numbers for her customers, the page just refreshes and the popup page for the customer is blank except for the background from the stylsheet. When i use the tracking code from an earlier post 1ZY16W740390558569 i get results. I don't get it. What's really wierd is everything was fine until I moved them from one server to another. How would that affect anything? The site in question is O'Brien's Canine Supplies. Help me out here!!!

I'm sooo embarrassed. I don't even remember what I changed in the install talked about above. Yeah my client uses worldship so i'm having the same problem as above. I will read the rest of the posts above and see if you quoted an answer to my problem. I will also try putting a fresh install on.

Share this post


Link to post
Share on other sites
I'm sooo embarrassed. I don't even remember what I changed in the install talked about above. Yeah my client uses worldship so i'm having the same problem as above. I will read the rest of the posts above and see if you quoted an answer to my problem. I will also try putting a fresh install on.

WOW.......adding the ob gzip function completely fixed everything......try that phillip as hellosquare said above. add ob_start(); after the first <?php in catalog/tracking.php and ob_end_flush(); before the last ?> also don't forget to do the same for catalog/popup_tracker.php so customers can see all tracking codes in popups. I have no idea why the damn gzip module has everything in the world to do with this problem. HMmmmmmm.

Share this post


Link to post
Share on other sites
WOW.......adding the ob gzip function completely fixed everything......try that phillip as hellosquare said above. add ob_start(); after the first <?php in catalog/tracking.php and ob_end_flush(); before the last ?> also don't forget to do the same for catalog/popup_tracker.php so customers can see all tracking codes in popups. I have no idea why the damn gzip module has everything in the world to do with this problem. HMmmmmmm.

just to clarify, the ob_start() function has nothing to do with gzip. Any output destined for the screen that is generated by code in between ob_start() and ob_end_flush() will be buffered so that further processing can be done (if necessary) before the output goes to the screen. In the context of this contrib. the output buffering was only necessary for the postOutput() function which is being commented out anyway. The postOutput() function was a work-around for multi-package shipments that originated outside the US. However, I couldn't get any errors to display when this function was being used. I've pretty much given up on it since I'm in the US.

 

The short version of the above is that all references to ob_xxx could probably be taken out of the code and it will still work as intended (as long as your tracking codes originate in the US).


Do you ship UPS?

Give your customers order tracking without leaving your site. Track multi-package shipments. XML, cURL

 

Download the contribution here:

UPS Tracking

Share this post


Link to post
Share on other sites

I don't see where I would add the ob_start() function and ob_end_flush() in the catalog/popup_tracker.php could you please show an example of where it goes. BTW thank you for the contribute it's works fine only took a couple of hours to install.

Share this post


Link to post
Share on other sites

just add them to the very top of the file and the very bottom of the file respectively...

 

<?php
/*
?$Id: popup_tracker.php,v 1.0 200/05/18 12:18:40 $

?osCommerce, Open Source E-Commerce Solutions
?http://www.oscommerce.com

?Copyright (c) 2002 osCommerce

?Released under the GNU General Public License
*/
?ob_start();
?require('includes/application_top.php');

?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<title>UPS Tracking</title>
<base href="<?php echo (getenv('HTTPS') == 'on' ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<script language="javascript"><!--
var i=0;
function resize() {
?if (navigator.appName == 'Netscape') i=40;
}
//--></script>
</head>
<body>
<center>
<table border="0" width="625" cellpadding="3" cellspacing="0">
<tr>
?<td align="left" width="100%" class="main">
<?php require('includes/classes/tracking.php'); ?>
?</td>
</tr>
</table>
</center>
</body>
</html>
<?php ob_end_flush(); ?>

Edited by heliosquare

Do you ship UPS?

Give your customers order tracking without leaving your site. Track multi-package shipments. XML, cURL

 

Download the contribution here:

UPS Tracking

Share this post


Link to post
Share on other sites

First off, I would like to start off by saying great contribution. I have been looking to integrate UPS tracking into my website for a while now. Unfortunately, I cannot get the "track" button or the link to show up on account_history.php or account_history_info.php. Also, After I edited the files for this contribution, the shipping address and payment method are blank in account_history_info.php. The headers will show up, but no information for these two fields. However, I don't get any error messages from the contribution. Does anyone know what is wrong? Could it be due to the use of STS? Since my website is still in test mode, you can buy something with COD to see the account_history_info page. My website is http://www.miragefashions.com. Someone please help!!!

Share this post


Link to post
Share on other sites

well my first guess would be that you messed something up during the editing. The edits to account_history.php and account_history_info.php are quite minimal and neither require changing any code...they just require you add code. Double-check your code...post some here if need be...


Do you ship UPS?

Give your customers order tracking without leaving your site. Track multi-package shipments. XML, cURL

 

Download the contribution here:

UPS Tracking

Share this post


Link to post
Share on other sites

I installed this contribution and after a few mishaps it works flawless. I was wondering if anyone knew a way to export the tracking numbers from UPS Worldship into the db ups_num_tack column? instead of manually adding the tracking in admin section. I tried but it just made new rows in the orders table. :angry:

Share this post


Link to post
Share on other sites
I installed this contribution and after a few mishaps it works flawless.  I was wondering if anyone knew a way to export the tracking numbers from UPS Worldship into the db ups_num_tack column? instead of manually adding the tracking in admin section.  I tried but it just made new rows in the orders table.  :angry:

Hmmm, we use worldship too but I haven't tried this. What was your method when you tried?


Do you ship UPS?

Give your customers order tracking without leaving your site. Track multi-package shipments. XML, cURL

 

Download the contribution here:

UPS Tracking

Share this post


Link to post
Share on other sites
Hmmm, we use worldship too but I haven't tried this.  What was your method when you tried?

 

I just made a export map and took the tracking number from "shipment" and mapped it to the ups_um_track column. But it just made new rows, I assume if I find a way to specifiy which order number the tracking number goes with it will put it i the right row. But I really don't know what i am doing :(

Share this post


Link to post
Share on other sites
I just made a export map and took the tracking number from "shipment" and mapped it to the ups_um_track column.  But it just made new rows, I assume if I find a way to specifiy which order number the tracking number goes with it will put it i the right row.  But I really don't know what i am doing  :(

 

I'm assuming you are using MS Access and the mysql-odbc driver to connect to the msyql database? Getting Access to update a mysql table is impossible I think. I developed an online bill-pay section for my company that uses Access to pull the data from our accounting software and then export it to mysql via the odbc driver. During the export I have to delete the table being updated and then repopulate it with new data. I don't think an actual update is possible.

 

I would suggest that you export from WorldShip to a .csv file and then update the orders table with it. It would require a very simple script to do so. The only way I can think of to associate the right order/tracking number pair is to use the osc-generated order number as your reference number in worldship. Then you could export just those 2 fields to a .csv file...


Do you ship UPS?

Give your customers order tracking without leaving your site. Track multi-package shipments. XML, cURL

 

Download the contribution here:

UPS Tracking

Share this post


Link to post
Share on other sites
I would suggest that you export from WorldShip to a .csv file and then update the orders table with it.  It would require a very simple script to do so.  The only way I can think of to associate the right order/tracking number pair is to use the osc-generated order number as your reference number in worldship.  Then you could export just those 2 fields to a .csv file...

 

This is what I was thinking too, I'm not really sure how to go about it in the right way tho . I've reached the end of my knowledge, haha.

Share this post


Link to post
Share on other sites

Quick question about the shipping delay.

 

I would like to set the delay to 1 (day) only between select hours. So say you ordered a prodcut between Midnight and 1:00p.m. it would ship that day (with a zero delay) but if you ordered it from 1:01p.m. to 11:59p.m. the 1 day delay would set in.....

 

Any ideas?

Share this post


Link to post
Share on other sites
Quick question about the shipping delay.

 

I would like to set the delay to 1 (day) only between select hours.  So say you ordered a prodcut between Midnight and 1:00p.m. it would ship that day (with a zero delay) but if you ordered it from 1:01p.m. to 11:59p.m. the 1 day delay would set in.....

 

Any ideas?

You sure you are on the right thread? I have no idea what you are talking about...


Do you ship UPS?

Give your customers order tracking without leaving your site. Track multi-package shipments. XML, cURL

 

Download the contribution here:

UPS Tracking

Share this post


Link to post
Share on other sites

I believe I got it to work. I had a friend code something up. What I do now is export from worldship the tracking number and the customer id (which is the oscommerce order number) to a .csv file. Then my friend coded a php file and a html file so I go to the html address in admin then browse to the .csv file then ulpoad it and it inserts the tracking numbers to the corresponding order numbers into the db. I ran a few quick tests tonight and it seems to be working great.

Share this post


Link to post
Share on other sites

OK Folks,

 

I was able to get this installed, and partially working. One thing I found, is I am not sure what should have been edited in xmldocuments.php so it was not changed.

 

I am able to add tracking numbers in admin, and when logged in as a customer click on "track" to get the popup with the tracking info, which works, but if I click track order from the info box I get the blank area for tracking.php

 

When originally installed I had not yet placed my UPS info into the correct fields, and partially saw the page. But after correcting the info... just a blank on tracking.php

 

Any suggestions where to start? AND/OR what changes should have been made to xmldocuments.php ?

 

Thanks in Advance!


Steve K AKA - Knipper -

Share this post


Link to post
Share on other sites

OK... I try adding ob_start(); and ob_end_flush(); to the file in /classes/tracking.php but when I do, it places the UPS tracking box at the very top of the page, above everything else. The actual tracking does nothing when I try to track a package from there. If I move the ob_start(); to a different area on the page (such as just before the table starts) it does not show up anywhere.

 

OK... thats it for now... looking forward to any input!

 

OK Folks,

 

I was able to get this installed, and partially working.  One thing I found, is I am not sure what should have been edited in xmldocuments.php so it was not changed.

 

I am able to add tracking numbers in admin, and when logged in as a customer click on "track" to get the popup with the tracking info, which works,  but if I click track order from the info box I get the blank area for tracking.php

 

When originally installed I had not yet placed my UPS info into the correct fields, and partially saw the page.  But after correcting the info... just a blank on tracking.php

 

Any suggestions where to start?  AND/OR what changes should have been made to xmldocuments.php ?

 

Thanks in Advance!


Steve K AKA - Knipper -

Share this post


Link to post
Share on other sites

OK Folks...

 

I got it going. After spending several hours going through every post in this thread, and then changing the pages multiple times, and even doing a complete restore and starting over... the tracking page would never show up.

 

I am having to assume it was due to html in the /catalog/tracking.php page not being happy with STS. What I ended up doing was taking another osCommerce page, deleting the main body content, and then placing the code from the original tracking.php contibution into my new page. WAAALLLAAAAA!! It worked. I renamed my page tracking.php and everything is good.

 

So just a recap in case anyone else has this issue, I had no problems with installation, the admin part, or the popup part... and tracking actually worked. But, if I clicked the link in the info box to "track package" the page would come up blank. I tried several variations of the "ob_start()" methods described in the thread previously, but none of these worked. I could make the logo, and page load if I "broke" the php code on the page... but it did not show the header or left/right columns.

 

I knew it wasn't a Curl issue, because I wasn't even getting that far... the page just would not load. ( it looked like as previosly described a blank in the "middle" of the page where the content should have been)

 

To fix, I placed the catalog/tracking.php code included in the contibution into another page which was working with my STS enabled store, and the page now displays properly. Tracking works, and all is good!

 

See Ya! :thumbsup:

 

OK... I try adding ob_start(); and ob_end_flush(); to the file in /classes/tracking.php but when I do, it places the UPS tracking box at the very top of the page, above everything else. The actual tracking does nothing when I try to track a package from there.  If I move the ob_start(); to a different area on the page (such as just before the table starts) it does not show up anywhere.

 

OK... thats it for now... looking forward to any input!


Steve K AKA - Knipper -

Share this post


Link to post
Share on other sites
I believe I got it to work. I had a friend code something up.  What I do now is export from worldship the tracking number and the customer id (which is the oscommerce order number) to a .csv file. Then my friend coded a php file and a html file so I go to the html address in admin then browse to the .csv file then ulpoad it and it inserts the tracking numbers to the corresponding order numbers into the db.  I ran a few quick tests tonight and it seems to be working great.

 

Can you share this information? That would be AWESOME ;-)

 

-Tai

Share this post


Link to post
Share on other sites

I am using the search engine safe url's and did the fix on page 5 in this thread.

It works when I am on account_history.php, but when I am on acount_history_info.php and click on the tracking number, a window pops up with account_history.php in it. How can that be?

 

Here is my account_history_info.php tracking code:

 

// begin UPS XML Tracking
 if ($order->info['ups_track_num'] == NULL) {
?>
     <tr>
    	 <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '1'); ?></td>
     </tr>
<?php
 } else {
?>
     <tr>
    	 <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td class="main"><b><?php echo HEADING_TRACKING; ?></b></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
    	 <td>
      	 <table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
           <tr class="infoBoxContents">
             <td width="100%" valign="top">
                  	 <table border="0" width="100%" cellspacing="0" cellpadding="2">
                           <tr>
                          	 <td class="main"><?php echo UPS_TRACKING_TEXT; ?></td>
                           </tr>
                           <tr>
                   <td class="main"><a href="javascript:popupTrackerWindow('popup_tracker.php?action=track&tracknum=<?php echo $order->info['ups_track_num']; ?>')"><?php echo $order->info['ups_track_num']; ?></a></td>
                 </tr>
            	 </table>
                   </td>
           </tr>
      	 </table>
       </td>
     </tr>
<?php
 }
// end UPS XML Tracking

 

Everything else is working, including the extra mod for tracking within the admin section.

 

Regards

Mike

Share this post


Link to post
Share on other sites

Yes, please do share this code with us if you could - would greatly help many of us here I'm sure!

 

Thanks,

Mike

 

I believe I got it to work. I had a friend code something up.  What I do now is export from worldship the tracking number and the customer id (which is the oscommerce order number) to a .csv file. Then my friend coded a php file and a html file so I go to the html address in admin then browse to the .csv file then ulpoad it and it inserts the tracking numbers to the corresponding order numbers into the db.  I ran a few quick tests tonight and it seems to be working great.

Share this post


Link to post
Share on other sites
I am using the search engine safe url's and did the fix on page 5 in this thread.

It works when I am on account_history.php, but when I am on acount_history_info.php and click on the tracking number, a window pops up with account_history.php in it. How can that be?

 

Here is my account_history_info.php tracking code:

 

// begin UPS XML Tracking
?if ($order->info['ups_track_num'] == NULL) {
?>
? ? ?<tr>
? ? ?	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '1'); ?></td>
? ? ?</tr>
<?php
?} else {
?>
? ? ?<tr>
? ? ?	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
? ? ?</tr>
? ? ?<tr>
? ? ? ?<td class="main"><b><?php echo HEADING_TRACKING; ?></b></td>
? ? ?</tr>
? ? ?<tr>
? ? ? ?<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
? ? ?</tr>
? ? ?<tr>
? ? ?	<td>
? ? ? ?	<table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
? ? ? ? ? ?<tr class="infoBoxContents">
? ? ? ? ? ? ?<td width="100%" valign="top">
? ? ? ? ? ? ? ? ? ?	<table border="0" width="100%" cellspacing="0" cellpadding="2">
? ? ? ? ? ? ? ? ? ? ? ? ? ?<tr>
? ? ? ? ? ? ? ? ? ? ? ? ? ?	<td class="main"><?php echo UPS_TRACKING_TEXT; ?></td>
? ? ? ? ? ? ? ? ? ? ? ? ? ?</tr>
? ? ? ? ? ? ? ? ? ? ? ? ? ?<tr>
? ? ? ? ? ? ? ? ? ?<td class="main"><a href="javascript:popupTrackerWindow('popup_tracker.php?action=track&tracknum=<?php echo $order->info['ups_track_num']; ?>')"><?php echo $order->info['ups_track_num']; ?></a></td>
? ? ? ? ? ? ? ? ?</tr>
? ? ? ? ? ? ?	</table>
? ? ? ? ? ? ? ? ? ?</td>
? ? ? ? ? ?</tr>
? ? ? ?	</table>
? ? ? ?</td>
? ? ?</tr>
<?php
?}
// end UPS XML Tracking

 

Everything else is working, including the extra mod for tracking within the admin section.

 

Regards

Mike

 

did you get this working properly yet? I can't say I have an answer to your issue but you may want to try escaping the single-quotes in the javascript...

 

<a href="javascript:popupTrackerWindow(\'popup_tracker.php?action=track&tracknum=<?php echo $order->info['ups_track_num']; ?>\')">

 

The above is more of a syntax fix and not escaping the quotes wouldn't necessarily cause the behavior you described...worth a shot though. Stranger things have happened...


Do you ship UPS?

Give your customers order tracking without leaving your site. Track multi-package shipments. XML, cURL

 

Download the contribution here:

UPS Tracking

Share this post


Link to post
Share on other sites

here is the error i get after installing, can anybody please help me?

 

My Order History

 

 

 

Fatal error: Class 'order' not found in D:\www\account_history.php on line 102

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×