Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Any interest in a contrib utilizing Quantum View Data?


Dez

Recommended Posts

I have a client who ships from a warehouse using UPS. The client has an account with access to Quantum View Manager. Right now, the warehouse gets order confirmation emails, fulfills the order and ships it using my client's UPS account. Her office manager receives shipment notification emails with the tracking number for each order, and has to enter them by hand into osC. This is very time consuming. The capabilities of the warehouse are limited, and I can't give them any kind of access to our database.

 

After a meeting with my client's UPS IT rep, we decided that the best solution was to use the files that Quantum View makes available for Outbound Data. I took a look at Quantum View Data Online Tools (they give you XML data to work with), and decided that writing a script to handle the XML files and bring the data into the osC database would be too time consuming for this client's needs. Why?

 

- I've read that UPS says that development of this kind of thing can take approximately 200 hours. I haven't found anything but some php libraries that cost $60 and can't be installed by anyone but an intermmediate php developer).

- You have to have an SSL connection to connect to the UPS servers and get the Quantum data. Not everyone has this.

- You (the developer) have to sign up twice just to receive a developer's key and xml/html access key.

 

So, here's the steps that I'm taking to achieve a time-saving option for this client:

 

1. Edit Order Confirmation emails to include the customer's email address. When the warehouse processes shipments, they input the order number into the Reference Number field, and send a shipment notification email to the customer. That saves the office manager from having to notify the customer of shipment through osC.

 

2. Set the client up with UPS Quantum View Autoload (Windows application that downloads the Quantum View data files to your computer). I'll have the office manager download the files in CSV format.

 

2. The office manager can then log into osC, upload the file, and the contents will be dumped into the database. I've installed the Shipping Status contrib, and will be utilizing its fields in the database to dump the data into. The data will be matched up to the customer's order number (which was also used as a reference number for shipments), so the tracking data will show up under the admin area and customer account history without any manual typing by the office manager.

 

I'm still trying to figure out Quantum View works, and I know that your account rep has to enable everything for you (like Admin/User accounts, subscriptions to types of data services).

 

Is anyone interested in something like this?

Link to comment
Share on other sites

What I've done is query UPS with the order number as a reference number and the customers UPS account number, then I've parsed UPS's return source code to get status and tracking number, it works very well.

 

I've made an order prefix so that orders have letters before the numbers, for instance "CS1283".

 

I think I posted the code somewhere in the forums once, but if you're interested I code post it again.

 

You could use the XML bells and whistles, but I simply couldn't be bothered to look into it, as this was MUCH easier :P

Insert clever remark here

Link to comment
Share on other sites

That sounds good, but what my customer really wants is to have the data dumped into the osC database and updating the order status automatically. If you could post the code that you're talking about, it may be helpful to me, or someone else who stumbles upon this thread. In the meantime, I'll see if I can find it.

Link to comment
Share on other sites

Here's the link to the thread with the code you mentioned. Reposting it here for reference, if you don't mind.

 

I do have a developer account(which by the way, if you view the source HTML from the page the customer gets is there in clear text along with your shipper number, how's that for security), but what I needed was not for the customer to have to type in their tracking number and click "trace", no I wanted the information to be there on their order history. And as all the information needed by UPS is right there in the page source in one little input field, I made a function to catch that. Now the code is not cleaned up, and I have yet to put it anywhere but on the admin side, as I'm currently awaiting some documentation on the input field from UPS, but here it is, for all you people who want it:

 

// ICD CHANGE ***************
//Add UPS tracking

function tep_ups_tracking_by_reference($ref_number){
// RL CODE:
$ups_shipper_account = 'YOUR UPS ACCOUNT';


$site = file_get_contents('http://wwwapps.ups.com/WebTracking/processRefSummary?HTMLVersion=5.0&AgreeToTermsAndConditions=yes&TypeOfInquiryNumber=R&InquiryNumber=' . $ref_number . '&SenderShipperNumber=' . $ups_shipper_account, r);
if (!eregi("Unable to track shipment", $site)) {

$tracking_string = ' VALUE="TrackDetailInfo,';
$ups_tracking = substr(strstr($site, $tracking_string),24,18);
$ups_tracking_description = '<a href="http://wwwapps.ups.com/WebTracking/processInputRequest?HTMLVersion=5.0&AgreeToTermsAndConditions=yes&TypeOfInquiryNumber=T&InquiryNumber=' . $ups_tracking . '" target="_blank">' . $ups_tracking . '</a>';
$ups_status_array= array(
'I' => 'In transit',
'D' => 'Delivered',
'X' => 'Special circumstances apply',
'P' => 'Ready for Shipping',
'M' => 'Manifest pickup'
);


$status_string = $ups_shipper_account . ',,,' . $ups_shipper_account . ',,,21b4,,,,,';
$ups_status = substr(strstr($site, $status_string),27,1);
$ups_status_description = $ups_status_array[$ups_status];

//If you need to test the string:
//$full_tracking_string_array = split('">', strstr($site, $tracking_string));
//$full_tracking_string = substr($full_tracking_string_array[0],24);

//$ups_tracking_string = 'T: ' . $ups_tracking . ' | S: ' . $ups_status . ' | O: ' . $ref_number . ' <br> Tracker: ' . $full_tracking_string;

//return $ups_tracking_string;
return printf(TEXT_UPS_TRACKING_INFORMATION, $ups_tracking_description, $ups_status_description);
} else {
return false;
}
}
// ICD CHANGE*******************

 

In language file

 

 define('TEXT_UPS_TRACKING_INFORMATION', '<b>Tracking Number:</b> %s <b>Status:</b> %s');

Link to comment
Share on other sites

Well, I've modified it a little bit, this version isn't cleaned from my test code though:

 

//Add UPS tracking

function tep_ups_tracking_by_reference($ref_number){
// RL CODE:	
$ups_html_license = 'YOUR LICENSE';
$ups_shipper_account = 'YOUR UPS ACCOUNT';
define('TEXT_UPS_TRACKING_INFORMATION', '<b>Tracking Number:</b> %s <b>Status:</b> %s');


//$site = file_get_contents('http://wwwapps.ups.com/WebTracking/OnlineTool?InquiryNumber=' . $ref_number . '&submit=Track+this+package&UPS_HTML_License=' . $ups_html_license . '&UPS_HTML_Version=3.0&TypeOfInquiryNumber=R&SenderShipperNumber=' . $ups_shipper_account . '&nonUPS_body=&nonUPS_title=Cortex+Package+Tracking&nonUPS_header=&nonUPS_footer=', r);
$site = file_get_contents('http://wwwapps.ups.com/WebTracking/processRefSummary?HTMLVersion=5.0&AgreeToTermsAndConditions=yes&TypeOfInquiryNumber=R&InquiryNumber=' . $ref_number . '&SenderShipperNumber=' . $ups_shipper_account, r);
	if (!eregi("Unable to track shipment", $site)) {

		$tracking_string = '<INPUT TYPE="HIDDEN" NAME="line1" VALUE="TrackDetailInfo,';

		$ups_tracking = substr(strstr($site, $tracking_string),strlen($tracking_string),18);
		$full_tracking_string = substr(strstr($site, $tracking_string),strlen($tracking_string),300);
		$ups_tracking_description = '<a href="http://wwwapps.ups.com/WebTracking/processInputRequest?HTMLVersion=5.0&AgreeToTermsAndConditions=yes&TypeOfInquiryNumber=T&InquiryNumber=' . $ups_tracking . '" target="_blank">' . $ups_tracking . '</a>';
		$ups_status_array= array(
														'I' => 'In transit',
														'D' => 'Delivered',
														'X' => 'Special circumstances apply',
														'P' => 'Ready for Shipping',
														'M' => 'Manifest pickup',
														'XX' => 'Unable to detect, please click for details'
												);


		//$status_string = $ups_shipper_account . ',,,' . $ups_shipper_account . ',,,21b4,,,,,';
		$status_string = '\,\,,,';
		$ups_status = substr(strstr($full_tracking_string, $status_string),6,1);
		$ups_status_description = $ups_status_array[$ups_status];

//			$full_tracking_string_array = split('">', strstr($site, $tracking_string));
//			$full_tracking_string = substr($full_tracking_string_array[0],strlen($tracking_string));

		$ups_tracking_string = 'T: ' . $ups_tracking . ' | S: ' . $ups_status . ' | O: ' . $ref_number . ' <br> Tracker: ' . $full_tracking_string;

			//return $ups_tracking_string . ' SSS: ' . $ups_status;
			return printf(TEXT_UPS_TRACKING_INFORMATION, $ups_tracking_description, $ups_status_description);
	} else {
		return false;
	}
}

Insert clever remark here

Link to comment
Share on other sites

Well, I've modified it a little bit, this version isn't cleaned from my test code though:

 

//Add UPS tracking

function tep_ups_tracking_by_reference($ref_number){
// RL CODE:	
$ups_html_license = 'YOUR LICENSE';
$ups_shipper_account = 'YOUR UPS ACCOUNT';
define('TEXT_UPS_TRACKING_INFORMATION', '<b>Tracking Number:</b> %s <b>Status:</b> %s');


//$site = file_get_contents('http://wwwapps.ups.com/WebTracking/OnlineTool?InquiryNumber=' . $ref_number . '&submit=Track+this+package&UPS_HTML_License=' . $ups_html_license . '&UPS_HTML_Version=3.0&TypeOfInquiryNumber=R&SenderShipperNumber=' . $ups_shipper_account . '&nonUPS_body=&nonUPS_title=Cortex+Package+Tracking&nonUPS_header=&nonUPS_footer=', r);
$site = file_get_contents('http://wwwapps.ups.com/WebTracking/processRefSummary?HTMLVersion=5.0&AgreeToTermsAndConditions=yes&TypeOfInquiryNumber=R&InquiryNumber=' . $ref_number . '&SenderShipperNumber=' . $ups_shipper_account, r);
	if (!eregi("Unable to track shipment", $site)) {

		$tracking_string = '<INPUT TYPE="HIDDEN" NAME="line1" VALUE="TrackDetailInfo,';

		$ups_tracking = substr(strstr($site, $tracking_string),strlen($tracking_string),18);
		$full_tracking_string = substr(strstr($site, $tracking_string),strlen($tracking_string),300);
		$ups_tracking_description = '<a href="http://wwwapps.ups.com/WebTracking/processInputRequest?HTMLVersion=5.0&AgreeToTermsAndConditions=yes&TypeOfInquiryNumber=T&InquiryNumber=' . $ups_tracking . '" target="_blank">' . $ups_tracking . '</a>';
		$ups_status_array= array(
														'I' => 'In transit',
														'D' => 'Delivered',
														'X' => 'Special circumstances apply',
														'P' => 'Ready for Shipping',
														'M' => 'Manifest pickup',
														'XX' => 'Unable to detect, please click for details'
												);


		//$status_string = $ups_shipper_account . ',,,' . $ups_shipper_account . ',,,21b4,,,,,';
		$status_string = '\,\,,,';
		$ups_status = substr(strstr($full_tracking_string, $status_string),6,1);
		$ups_status_description = $ups_status_array[$ups_status];

//			$full_tracking_string_array = split('">', strstr($site, $tracking_string));
//			$full_tracking_string = substr($full_tracking_string_array[0],strlen($tracking_string));

		$ups_tracking_string = 'T: ' . $ups_tracking . ' | S: ' . $ups_status . ' | O: ' . $ref_number . ' <br> Tracker: ' . $full_tracking_string;

			//return $ups_tracking_string . ' SSS: ' . $ups_status;
			return printf(TEXT_UPS_TRACKING_INFORMATION, $ups_tracking_description, $ups_status_description);
	} else {
		return false;
	}
}

 

Where does this code go?

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

into functions/general.php and ref number is the order number(so remember to put that as the ref number of your packages!), simply use the function on the order history page :)
And then what happens?

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

And then what happens?

 

Well, I've used the function into the account history info with a "if shipping equals UPS" thing:

 

upsosc0mc.jpg

 

echo tep_ups_tracking_by_reference($HTTP_GET_VARS['order_id']);

 

The link of the tracking number takes them to UPS tracking page for the package, where they can see more details.

 

I will be working on a XML version of this at some point, but I'm just too busy atm.

Edited by RL2000

Insert clever remark here

Link to comment
Share on other sites

  • 2 months later...

Well, I spent hours working on this and finally had a working solution, and the client it was for decided to hold off on using it for a while. I'll probably package it up as a means for people to be able to load a bunch of tracking numbers into their database and change the order status without doing it transaction by transaction.

Link to comment
Share on other sites

  • 2 months later...

After looking al of this over I am very interested in this as an add on for my site. I am, however, a novice so I was wondering if someone could give me a bit more handholding and information as far as what file all this code goes into and if there is a specific place int he file, etc.

 

Be gentle, I am just learning!!

 

Thank you very much!!

Link to comment
Share on other sites

I would love to see this working on my site. Very nice!

Well, I've used the function into the account history info with a "if shipping equals UPS" thing:

 

upsosc0mc.jpg

 

echo tep_ups_tracking_by_reference($HTTP_GET_VARS['order_id']);

 

The link of the tracking number takes them to UPS tracking page for the package, where they can see more details.

 

I will be working on a XML version of this at some point, but I'm just too busy atm.

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