Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

USPS Labels not working


aldaffodil

Recommended Posts

I'm working on a new contribution. This old way of doing it wasn't really that good and my client is already complaining that it's not automated enough.

 

I am working with the usps webtools api. For now it is going to be for priority shipping only. Trust me guys, this is much better and I already have it printing labels. It should be done tonight. If anyone here knows php and want s the code as is, post your email or pm me or something. Also, if anyone else wants to work on this with me that'd be great!

Link to comment
Share on other sites

  • Replies 273
  • Created
  • Last Reply

Top Posters In This Topic

I'm working on a new contribution. This old way of doing it wasn't really that good and my client is already complaining that it's not automated enough.

 

I am working with the usps webtools api. For now it is going to be for priority shipping only. Trust me guys, this is much better and I already have it printing labels. It should be done tonight. If anyone here knows php and want s the code as is, post your email or pm me or something. Also, if anyone else wants to work on this with me that'd be great!

 

 

yay! this should be the permanent fix. thanks so much for taking the time to do this. please do post the code.

 

tim

Link to comment
Share on other sites

I'm working on a new contribution. This old way of doing it wasn't really that good and my client is already complaining that it's not automated enough.

 

I am working with the usps webtools api. For now it is going to be for priority shipping only. Trust me guys, this is much better and I already have it printing labels. It should be done tonight. If anyone here knows php and want s the code as is, post your email or pm me or something. Also, if anyone else wants to work on this with me that'd be great!

 

I looked into the new API and I didn't think it was able to actually purchase the postage. Only print the labels and request the tracking number. This is much better than nothing though! Keep it up!

Link to comment
Share on other sites

I looked into the new API and I didn't think it was able to actually purchase the postage. Only print the labels and request the tracking number. This is much better than nothing though! Keep it up!

 

 

The postage is the whole benefit though, I like to just be able to drop these into a mailbox and off they go.

 

Anxiously looking forward to any updates or even a new contribution. Thanks! !

Link to comment
Share on other sites

http://atomicdesigninc.net/temp/usps_label_generator.zip

 

Here it is. I only had time to set this up for Priority for now. It comes with free delivery confirmation like before.

 

The Steps:

 

I kept the file named the same as the old contribution (differentshipping.php) so you can just write over the old one and click on the usps label shipping button like we were doing before. Put the create_usps_label.php file in the same directory.

 

To be able to access the API you must first register at http://www.uspswebtools.com/registration/ . It is free to do so.

 

Read the directions in the first few lines of the differentshipping.php file.

 

IF YOU HAVE ISSUES ON THE TEST SERVER: I was not able to test this on the testing server. Even though it says once you have production access you can still use the test server it did not let me do it. SO, if you are using the test server and it does not work just call the ICCC and have them give you production access. I can assure you it works great on the production server. If you get it to work on the test server please let me know.

 

I know some of you have no idea what I'm talking about, but once you register you will understand what I am talking about.

 

Yes you will have to manually pay the postage for these but like you said, it's better than nothing. And for those that don't need to purchase the postage online, it will prove to be much faster.

 

If anyone modifies this to allow more shipping methods please post the new code. I would do it but it's 12 am and I need a break.

 

I will work on releasing this as a contribution sometime this weekend hopefully.

Edited by Gho5t
Link to comment
Share on other sites

ooh. I didn't realize you can't purchase postage through the API method. This would seem to be the last straw for USPS shipping for me, unless there is some other way to integrate the labels AND postage into osCommerce.

 

Has anyone found a reasonable alternative to Priority Mail? Most of my packages are 1lb or less... $3.85 plus free boxes is hard to beat.

Link to comment
Share on other sites

ooh. I didn't realize you can't purchase postage through the API method. This would seem to be the last straw for USPS shipping for me, unless there is some other way to integrate the labels AND postage into osCommerce.

 

Has anyone found a reasonable alternative to Priority Mail? Most of my packages are 1lb or less... $3.85 plus free boxes is hard to beat.

 

Typical for me, I started looking at the dark-horses (the little guys that are hungry and trying to make a name) first and looked at DHL. They seem to have some sort of web interface/API called ShipIt. I don't know much more than that but it looks like it might be in the ball park. We've been using Priority Mail but don't really need it to go that fast and DHL ground is close in price. And their 2nd day air is pretty good compared to Express.

 

Call it a first blush but it looks like they might be worth further exploration. (When I get a few spare seconds...)

 

Well, back to copy/paste...bleh!

Edited by danberlyoung
Link to comment
Share on other sites

Shoot. Sorry guys if I got your hopes up, I didn't realize you needed it to purchase the postage as well. My client was appalled that he had to go through 3 pages of forms just to print the label and never mentioned being able to pay for it, so I thought this was everyone's issue. Oh well, hopefully somebody can use it.

Link to comment
Share on other sites

Shoot. Sorry guys if I got your hopes up, I didn't realize you needed it to purchase the postage as well. My client was appalled that he had to go through 3 pages of forms just to print the label and never mentioned being able to pay for it, so I thought this was everyone's issue. Oh well, hopefully somebody can use it.

 

No actually I appreciate any work you can do on this. It looks like you can pay for postage too...at least I think so according to this email I got back from USPS.

 

Thank you for contacting us. The link OSCommerce had previously provided is to a page we had provided for users who ccould not previously use the Click N ship site. Since our upgrade that site is no longer available and Click n Ship is able to link to as the cgi page previously used. The web tools site has a link for service providers for API users who would like to create their labels with or without postage from their orders directly.

 

I'm not sure exactly what that means, but if someone can decipher it, all the better.

Link to comment
Share on other sites

Dear USPS Customer,

 

Thank you for contacting us. The USPS Web Tool APIs do not directly charge for postage. You may choose to sign up with a service provider. The service provider link is available at http://www.usps.com/webtools.

 

 

: (

 

What do they mean by service provider?

 

Dear USPS Customer,

 

Thank you for contacting us. The USPS Web Tool APIs do not directly charge for postage. You may choose to sign up with a service provider. The service provider link is available at http://www.usps.com/webtools.

 

 

: (

 

What do they mean by service provider?

Link to comment
Share on other sites

From what I understand, the shipping assistant is just a gui interface to the api.

 

It should be better to interface OSC directly to the api and not interface to an interface to the api.

 

 

 

 

From what I understand, the shipping assistant is just a gui interface to the api.

 

It should be better to interface OSC directly to the api and not interface to an interface to the api.

 

 

Agreed. I looked into it more and see it is simply an interface to their API. Though I have not yet created an osCommerce module, this one is so important I'd like to help take a whack at it. I'll soon be shipping 20-50 packages a day and I NEED THIS THING!

Edited by bubbasplitshot
Link to comment
Share on other sites

: (

 

What do they mean by service provider?

: (

 

What do they mean by service provider?

 

 

Folks. So I've been watching this thread and reread it this morning. Question: is it true or not that we can use the USPS API to tap in for label printing WITH SUPPORT for paid postage?

 

Now that I can put prepaid packages on the back dock of my local postoffice, and possibly get my local carrier to pick up same from my business location FOR FREE there is incredible incentive to get this going.

Link to comment
Share on other sites

Folks. So I've been watching this thread and reread it this morning. Question: is it true or not that we can use the USPS API to tap in for label printing WITH SUPPORT for paid postage?

 

Now that I can put prepaid packages on the back dock of my local postoffice, and possibly get my local carrier to pick up same from my business location FOR FREE there is incredible incentive to get this going.

 

It's my understanding that you can request a sig. conf. serial number and get a label suitable for printing but you *cannot* purchase postage through the API. The only way is through a third party postage supplier. (Stamps.com or the like I believe.)

 

We are actively investigating DHL. They have a nice XML based API that I can pay for shipping with. Their rates (when you factor in the discount we are getting from them based on our volume (100-200/month)) are comparable. I'll post more as I learn it. Oh, there is a shipping cost estimation module for DHL already written so we only need to develop one for printing the labels.

Link to comment
Share on other sites

It's my understanding that you can request a sig. conf. serial number and get a label suitable for printing but you *cannot* purchase postage through the API. The only way is through a third party postage supplier. (Stamps.com or the like I believe.)

 

We are actively investigating DHL. They have a nice XML based API that I can pay for shipping with. Their rates (when you factor in the discount we are getting from them based on our volume (100-200/month)) are comparable. I'll post more as I learn it. Oh, there is a shipping cost estimation module for DHL already written so we only need to develop one for printing the labels.

 

One big downside to DHL or any other carrier is that some people only want (or can only get) USPS shipments and then there's Hawaii and Alaska. I have tried to do away with USPS altogether, but just cannot escape it.

 

I have a version that was posted a while back (on this thread - http://www.oscommerce.com/forums/index.php?sho...&hl=usps+label) that works just fine. All it needs is eMail confirmation added back in & all is great. I've been working on it, but haven't had time to finish it.

 

And BTW: I discovered that USPS does not like caps in the eMail address for some reason. Sounds like the design work went to the lowest bidder & we are payin for it. Thanks for all the contribs...

Tony Mazz

Link to comment
Share on other sites

One big downside to DHL or any other carrier is that some people only want (or can only get) USPS shipments and then there's Hawaii and Alaska. I have tried to do away with USPS altogether, but just cannot escape it.

 

I have a version that was posted a while back (on this thread - http://www.oscommerce.com/forums/index.php?sho...&hl=usps+label) that works just fine. All it needs is eMail confirmation added back in & all is great. I've been working on it, but haven't had time to finish it.

 

And BTW: I discovered that USPS does not like caps in the eMail address for some reason. Sounds like the design work went to the lowest bidder & we are payin for it. Thanks for all the contribs...

 

Are you refering to the API? The major downside to that is that you can not print postage.

Link to comment
Share on other sites

Are you refering to the API? The major downside to that is that you can not print postage.

 

No not API. Here's the code I have so far. I put it together along with some code I got from another thread

 

I have it working except I do not have the email address being passed to the submit part. The check mark is not necessary since the usps script automatically defaults to checked when there's an eMail address in the field.

 

<?php

/*

$Id: diffrentshipping.php,v 1.0 2003/09/04 13:40:33 chris moralesExp $

 

DEVLOPED BY CHRIS MORALES www.goldencrown.biz

 

EDITED BY Tom Wojcik www.xpertcomp.com

 

 

EDITED BY BILLY BRENNER, www.ecommercedesigns.biz

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

 

 

Copyright (c) 2002 osCommerce

 

Released under the GNU General Public License

*/

 

/*

CONFIGURATION NOTE

if your address contains a quotation mark like ' then before it include a "\"

so "O'Sullivan St" Would be entered as O\'Sullivan St)

 

Also, Do not include Periods on abbreviations. Type "St" not "St."

They are not needed, and the USPS website probably doesnt accept them.

 

END CONFIGURATION NOTE

*/

 

//**********************************************************************

//CONFIGURATION AREA

define('STREET', 'PO Box 500'); //Your Street Address

define('STREET2', ''); //Your Apartment Number (if Aplicable)

define('CITY', 'your_city'); //Your City

define('URBANIZATION', ''); //Puerto Rico Only!

define('STATE', 'your_state'); //Your State (Abreviation)

define('ZIP', 'your_zip'); //Your Zip Code

//END CONFIGURATION

//**********************************************************************

 

 

require('includes/application_top.php');

 

//commented following 2 lines out since I don't think they are needed - BAC

// require(DIR_WS_CLASSES . 'currencies.php');

// $currencies = new currencies();

 

$oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);

// not needed? $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . tep_db_input($oID) . "'");

 

include(DIR_WS_CLASSES . 'order.php');

$order = new order($oID);

 

$zone_query = tep_db_query("select zone_code from " . TABLE_ZONES . " where zone_name = '" . $order->delivery['state'] . "'");

$return_zone = tep_db_fetch_array($zone_query);

?>

 

 

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML lang="en">

 

<HEAD>

 

<link rel="stylesheet" href="includes/usps.css" type="text/css">

 

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">

 

<TITLE>USPS - Label Information</TITLE>

<META name="title" content="USPS - Label Information">

<META name='author' content=''>

<META name='description' content='Create A Shipping Label'>

<META name='expiration date' content='01/01/2011'>

<META name='keywords' content='Click-N-Ship, Shipping Labels, Print Shipping Labels, Online Labels, PC Postage, Express Mail, Priority Mail, The United States Postal Service'>

<META name='robots' content='index,follow'>

 

<script SRC="<?php echo DIR_WS_ADMIN ?>images/jscript/logonSessionMaintenance.js"></script>

<script SRC="<?php echo DIR_WS_ADMIN ?>images/jscript/testDropDown.js"></script>

<script SRC="<?php echo DIR_WS_ADMIN ?>images/jscript/testField.js"></script>

<script SRC="<?php echo DIR_WS_ADMIN ?>images/jscript/testRadioButton.js"></script>

<script language="JavaScript">

var formAlreadySubmitted = false;

</script>

 

<script language="JavaScript">

function setCursor (field) {

field.focus();

}

function clearAddress (addrType)

{

theForm = document.forms[0];

if (addrType == "return")

{

theForm.returnFullName.value = "";

theForm.returnCompanyName.value = "";

theForm.returnAddressOne.value = "";

theForm.returnAddressTwo.value = "";

theForm.returnCity.value = "";

theForm.returnState.value = "";

theForm.returnState.selectedIndex = 0;

theForm.returnZipcode.value = "";

}

else if (addrType == "return_here")

{

theForm.returnFullName.value = "<?php echo nl2br(STORE_NAME); ?>";

theForm.returnCompanyName.value = "";

theForm.returnAddressOne.value = "<?php echo STREET; ?>";

theForm.returnAddressTwo.value = "<?php echo STREET2; ?>";

theForm.returnCity.value = "<?php echo CITY; ?>";

theForm.returnState.value = "<?php echo STATE; ?>";

theForm.returnZipcode.value = "<?php echo ZIP; ?>";

}

else if (addrType == "return_cust_return")

{

theForm.returnFullName.value = "<?php echo $order->delivery['name'];?>";

theForm.returnCompanyName.value = "<?php echo $order->delivery['company'];?>";

theForm.returnAddressOne.value = "<?php echo $order->delivery['street_address'];?>";

theForm.returnAddressTwo.value = "<?php echo $order->delivery['suburb'];?>";

theForm.returnCity.value = "<?php echo $order->delivery['city'];?>";

theForm.returnState.value = "<?php echo $return_zone['zone_code'];?>";

theForm.returnZipcode.value = "<?php echo $order->delivery['postcode'];?>";

}

else if (addrType == "delivery")

{

theForm.deliveryFullName.value = "";

theForm.deliveryCompanyName.value = "";

theForm.deliveryAddressOne.value = "";

theForm.deliveryAddressTwo.value = "";

theForm.deliveryCity.value = "";

theForm.deliveryState.value = "";

theForm.deliveryZipcode.value = "";

theForm.delivery_email.value = "";

 

}

else if (addrType == "delivery_here")

{

theForm.deliveryFullName.value = "<?php echo nl2br(STORE_NAME); ?>";

theForm.deliveryCompanyName.value = "";

theForm.deliveryAddressOne.value = "<?php echo STREET; ?>";

theForm.deliveryAddressTwo.value = "<?php echo STREET2; ?>";

theForm.deliveryCity.value = "<?php echo CITY; ?>";

theForm.deliveryState.value = "<?php echo STATE; ?>";

theForm.deliveryZipcode.value = "<?php echo ZIP; ?>";

}

else if (addrType == "delivery_cust_return")

{

theForm.deliveryFullName.value = "<?php echo $order->delivery['name'];?>";

theForm.deliveryCompanyName.value = "<?php echo $order->delivery['company'];?>";

theForm.deliveryAddressOne.value = "<?php echo $order->delivery['street_address'];?>";

theForm.deliveryAddressTwo.value = "<?php echo $order->delivery['suburb'];?>";

theForm.deliveryCity.value = "<?php echo $order->delivery['city'];?>";

theForm.deliveryState.value = "<?php echo $return_zone['zone_code'];?>";

theForm.deliveryZipcode.value = "<?php echo $order->delivery['postcode'];?>";

}

}

 

function checkAPOFPOAddress (theField)

{

found = false;

if (theField.name.indexOf("zipcode") != -1)

{

pattern1 = /09([0-8])/;

pattern2 = /96([2-6])/;

zip = theField.value.trim().substring(0, 3);

if (zip.match(pattern1) || zip.match(pattern2) || zip == "340")

found = true;

}

else if (theField.name.indexOf("city") != -1)

{

city = theField.value.trim().toUpperCase();

if (city == "APO" || city == "FPO")

found = true;

}

if (found)

{

alert("Sorry, online shipping labels cannot be used for APO/FPO addresses. We apologize for any inconvenience.");

theField.focus();

}

}

 

function checkShippingFromZIP()

{

aForm = document.forms[0];

// if the "other" box is not empty, make sure that the Other radio is selected

if (fieldNotBlank(aForm.other_zipcode, true))

{

if (getRadioValue(aForm.ship_from_zipcode) != "new")

{

if (confirm("Would you like to have the delivery time and postage calculated based\ron the ZIP Code you entered in the \"Other\" box?"))

aForm.ship_from_zipcode[1].checked = true;

else

return false;

}

}

}

 

</script>

</head>

<!-- USPS HEADER -->

<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" link="#003399" alink="#CC0000" vlink="#999999" bgcolor="#FFFFFF" onLoad="c_MaintainSessionLightEcap(); startCountDown('https://sss-web.usps.com/ds/jsps/lf_logoff.jsp?nextURL=/ds/jsps/timedOut.jsp');checkJavaPlugin()" onUnload="">

<script SRC="<?php echo DIR_WS_ADMIN ?>images/jscript/windows.js"></script>

<span style="display:none">Your sign in session will expire after 15 minutes of server inactivity. In order to maintain your data stored in this session, you will need to navigate to another page in this application within that timeframe.</span>

<form name="labelInformationForm" action="https://sss-web.usps.com/cns/saveLabelInformation.do" method="post">

<table align="center" border="0" cellpadding="0" cellspacing="0" summary="This table is used to format the header of the page.">

<tr>

<td colspan="4"><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" width="7" height="7" alt="" border="0"></td>

</tr>

<tr>

<td><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" alt="" width="8" height="1" border="0"></td>

<td><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/hdr_uspsLogo.jpg" width="157" border="0" height="25" alt="USPS Homepage"></a><a href="#content"><img alt="Skip Navigation" border="0" height="1" src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" width="1"></a></td>

<td><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" width="200" height="30" alt="" border="0"></td>

<td valign="bottom" align="right" class="utilitybar"><a href="http://www.usps.com" class="utilitybar">Home</a> | <a href="https://ecap21.usps.com/cgi-bin/ecapbv/scripts/login.jsp?app=GSS&appURL=https://sss-web.usps.com/cns/enterLabelInfo.do">Sign In</a>

</tr>

</table>

<table align="center" border="0" cellpadding="0" cellspacing="0" summary="This table is used to format page content.">

<tr>

<td valign="top"></td>

<td valign="top" align="left">

<input type="hidden" name="shortName" value="">

<input type="hidden" name="action" value="">

<input type="hidden" name="navigation" value="">

<input type="hidden" name="submitType" value="">

 

<input type="hidden" name="currentpage" value="EnterLabelInfo.do">

<input type="hidden" name="nav_type" value="">

<input type="hidden" name="source" value="">

<input type="hidden" name="unique" value="1081710538409">

 

<input type='hidden' name='return_short_name' value=''>

<input type='hidden' name='delivery_short_name' value=''>

<!--<input type='hidden' name='address_cleared' value=''>-->

 

<OBJECT id="myApplet" classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 1 HEIGHT = 1 >

<PARAM NAME=ARCHIVE VALUE="DetectPluginApplet.jar">

<PARAM NAME=CODEBASE VALUE="../../" >

<PARAM NAME=CODE VALUE="com.ibm.lex.services.DetectPluginApplet.class" >

<PARAM NAME="scriptable" VALUE="true" >

</object>

 

 

<a name="content"></a>

 

<table border="0" cellpadding="0" cellspacing="0" summary="This table is used to display the top navigation.">

<tr>

<td colspan="2" valign="top">

<table border="0" cellpadding="0" cellspacing="0" summary="This table is used to format page content.">

<tr>

<td bgcolor="#FFFFFF"><img height="2" width="2" border="0" alt="" src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif"></td>

<td valign="top">

<table summary="This table formats the form information." border="0" cellspacing="0" cellpadding="0">

<tr>

<td height="1"><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" border="0" width="1" height="1" alt=""></td>

<td valign="top">

<!-- start of the return address block -->

<table cellpadding="0" cellspacing="0" border="0" summary="This table is used to format delivery address data.">

<tr>

<td colspan="2" height="32" valign="top"><img src='<?php echo DIR_WS_ADMIN ?>images/uspsimages/sub_enterreturn_address.gif' width='119' height='21' border='0' alt='Enter Return Address'><br><a href="javascript:clearAddress('return');" tabindex="2"><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/button_clear.gif" border="0" width="45" height="17" alt="Clear Return Address"></a> <a href="javascript:clearAddress('return_here');" tabindex="2">Here</a> <a href="javascript:clearAddress('return_cust_return');" tabindex="2">Return Address</a></td>

</tr>

<tr>

<td colspan="2">

<table border="0" cellspacing="0" cellpadding="0" summary="This table is used to format the Delivery Address information.">

<tr>

<td>

<table border="0" cellspacing="0" cellpadding="0" summary="This table is used to format the Delivery Address information.">

<tr>

<td align="right" class="mainText"><span class="mainTextRed">* </span><span class=label >Full Name</span></td>

<td><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" border="0" width="1" height="1" alt=""></td>

<td><input type="text" name="returnFullName" id="returnFullName" style="width:160px" size="19" tabindex="4" value='<?php echo nl2br(STORE_NAME); ?>' maxlength="38">

<div style="display:none"><label for="return_full_name">* Full Name</label></div>

</td>

</tr>

<tr>

<td align="right" class="mainText"><span class=label >Company Name</span></td>

<td><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" border="0" width="1" height="1" alt=""></td>

<td><input type="text" name="returnCompanyName" id="returnCompanyName" style="width:160px" size="19" tabindex="5" value='' maxlength="38">

<div style="display:none"><label for="return_company_name">Company Name</label></div>

</td>

</tr>

<tr>

<td align="right" class="mainText"><span class="mainTextRed">* </span><span class=label >Address 1</span></td>

<td><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" border="0" width="1" height="1" alt=""></td>

<td><input type="text" name="returnAddressOne" id="returnAddressOne" style="width:160px" size="19" tabindex="6" value='<?php echo STREET; ?>' maxlength="38">

<div style="display:none"><label for="return_address_one">* Address 1</label></div>

</td>

</tr>

<tr>

<td align="right" class="mainText"><span class=label >Address 2</span></td>

<td><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" border="0" width="1" height="1" alt=""></td>

<td><input type="text" name="returnAddressTwo" id="returnAddressTwo" style="width:160px" size="19" tabindex="7" value='<?php echo STREET2; ?>' maxlength="38">

<div style="display:none"><label for="return_address_two">Address 2 (Apt, floor, suite, PMB, etc)</label></div>

</td>

</tr>

<tr>

<td align="right" class="mainText"><span class="mainTextRed">* </span><span class=label >City</span></td>

<td><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" border="0" width="1" height="1" alt=""></td>

<td><input type="text" name="returnCity" id="returnCity" style="width:160px" size="19" tabindex="9" value='<?php echo CITY; ?>' maxlength="38">

<div style="display:none"><label for="return_city">* City</label></div>

</td>

</tr>

<tr>

<td align="right" class="mainText"><span class="mainTextRed">* </span><span class=label >State</span></td>

<td><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" border="0" width="1" height="1" alt=""></td>

<td><input type="text" name="returnState" id="returnState" style="width:160px" size="19" tabindex="9" value='<?php echo STATE; ?>'maxlength="38">

<div style="display:none"><label for="return_state">* State</label></div>

</td>

</tr>

<tr>

<td align="right" class="mainText"><span class="mainTextRed">* </span><span class=label >ZIP Code?</span></td>

<td><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" border="0" width="1" height="1" alt=""></td>

<td><input type="text" name="returnZipcode" id="returnZipcode" style="width:160px" size="19" tabindex="11" value='<?php echo ZIP; ?>' maxlength="10">

<div style="display:none"><label for="return_zipcode">* ZIP Code?</label></div>

</td>

</tr>

</table>

</td> <!-- end of text boxes column -->

</tr>

</table>

</td>

</tr>

</table><!-- end of the Return Address section -->

</td>

<td><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" border="0" width="10" height="1" alt=""></td>

<td valign="top"><!-- begin of Delivery Address section -->

<table cellpadding="0" cellspacing="0" border="0" summary="This table is used to format delivery address data.">

<tr>

<td colspan="2" height="32" valign="top"><img src='<?php echo DIR_WS_ADMIN ?>images/uspsimages/sub_enterdelivery_address.gif' width='129' height='23' border='0' alt='Enter Delivery Address'><br><a href="javascript:clearAddress('delivery');" tabindex="12"><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/button_clear.gif" border="0" width="45" height="17" alt="Clear Delivery Address"></a> <a href="javascript:clearAddress('delivery_here');" tabindex="2">Here</a> <a href="javascript:clearAddress('delivery_cust_return');" tabindex="2">Return Address</a></td>

</tr>

<tr>

<td colspan="2">

<table border="0" cellspacing="0" cellpadding="0" summary="This table is used to format the Delivery Address information.">

<tr>

<td><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" border="0" width="1" height="1" alt=""></td>

<td>

<table border="0" cellspacing="0" cellpadding="0" summary="This table is used to format the Delivery Address information.">

<tr>

<td align="right" class="mainText"><span class="mainTextRed">* </span><span class=label >Full Name</span></td>

<td><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" border="0" width="1" height="1" alt=""></td>

<td><input type="text" name="deliveryFullName" id="deliveryFullName" style="width:160px" size="19" tabindex="14" value='<?php echo $order->delivery['name'];?>' maxlength="38">

<div style="display:none"><label for="delivery_full_name">* Full Name</label></div>

</td>

</tr>

<tr>

<td align="right" class="mainText"><span class=label >Company Name</span></td>

<td><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" border="0" width="1" height="1" alt=""></td>

<td><input type="text" name="deliveryCompanyName" id="deliveryCompanyName" style="width:160px" size="19" tabindex="15" value='<?php echo $order->delivery['company'];?>' maxlength="38">

<div style="display:none"><label for="delivery_company_name">Company Name</label></div>

</td>

</tr>

<tr>

<td align="right" class="mainText"><span class="mainTextRed">* </span><span class=label >Address 1</span></td>

<td><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" border="0" width="1" height="1" alt=""></td>

<td><input type="text" name="deliveryAddressOne" id="deliveryAddressOne" style="width:160px" size="19" tabindex="16" value='<?php echo $order->delivery['street_address'];?>' maxlength="38">

<div style="display:none"><label for="delivery_address_one">* Address 1</label></div>

</td>

</tr>

<tr>

<td align="right" class="mainText"><span class=label >Address 2</span></td>

<td><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" border="0" width="1" height="1" alt=""></td>

<td><input type="text" name="deliveryAddressTwo" id="deliveryAddressTwo" style="width:160px" size="19" tabindex="17" value='<?php echo $order->delivery['suburb'];?>' maxlength="38">

<div style="display:none"><label for="delivery_address_two">Address 2 (Apt, floor, suite, PMB, etc)</label></div>

</td>

</tr>

<tr>

<td align="right" class="mainText"><span class="mainTextRed">* </span><span class=label >City</span></td>

<td><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" border="0" width="1" height="1" alt=""></td>

<td><input type="text" name="deliveryCity" id="deliveryCity" style="width:160px" size="19" tabindex="19" value='<?php echo $order->delivery['city'];?>' maxlength="38">

<div style="display:none"><label for="delivery_city">* City</label></div>

</td>

</tr>

<tr>

<td align="right" class="mainText"><span class="mainTextRed">* </span><span class=label >State</span></td>

<td><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" border="0" width="1" height="1" alt=""></td>

<td><input type="text" name="deliveryState" id="deliveryState" style="width:160px" size="19" tabindex="19" value='<?php switch(strtoupper($order->delivery['state'])):

case 'ALABAMA':

print "AL";

break;

case 'ALASKA':

print "AK";

break;

case 'ARIZONA':

print "AZ";

break;

case 'ARKANSAS':

print "AR";

break;

case 'CALIFORNIA':

print "CA";

break;

case 'COLORADO':

print "CO";

break;

case 'CONNECTICUT':

print "CT";

break;

case 'DELAWARE':

print "DE";

break;

case 'DISTRICT OF COLUMBIA':

print "DC";

break;

case 'FLORIDA':

print "FL";

break;

case 'GEORGIA':

print "GA";

break;

case 'HAWAII':

print "HI";

break;

case 'IDAHO':

print "ID";

break;

case 'ILLINOIS':

print "IL";

break;

case 'INDIANA':

print "IN";

break;

case 'IOWA':

print "IA";

break;

case 'KANSAS':

print "KS";

break;

case 'KENTUCKY':

print "KY";

break;

case 'LOUISIANA':

print "LA";

break;

case 'MAINE':

print "ME";

break;

case 'MARYLAND':

print "MD";

break;

case 'MASSACHUSETTS':

print "MA";

break;

case 'MICHIGAN':

print "MI";

break;

case 'MINNESOTA':

print "MN";

break;

case 'MISSISSIPPI':

print "MS";

break;

case 'MISSOURI':

print "MO";

break;

case 'MONTANA':

print "MT";

break;

case 'NEBRASKA':

print "NE";

break;

case 'NEVADA':

print "NV";

break;

case 'NEW HAMPSHIRE':

print "NH";

break;

case 'NEW JERSEY':

print "NJ";

break;

case 'NEW MEXICO':

print "NM";

break;

case 'NEW YORK':

print "NY";

break;

case 'NORTH CAROLINA':

print "NC";

break;

case 'NORTH DAKOTA':

print "ND";

break;

case 'OHIO':

print "OH";

break;

case 'OKLAHOMA':

print "OK";

break;

case 'OREGON':

print "OR";

break;

case 'PENNSYLVANIA':

print "PA";

break;

case 'PUERTO RICO':

print "PR";

break;

case 'RHODE ISLAND':

print "RI";

break;

case 'SOUTH CAROLINA':

print "SC";

break;

case 'SOUTH DAKOTA':

print "SD";

break;

case 'TENNESSEE':

print "TN";

break;

case 'TEXAS':

print "TX";

break;

case 'UTAH':

print "UT";

break;

case 'VERMONT':

print "VT";

break;

case 'VIRGIN ISLANDS':

print "VI";

break;

case 'VIRGINIA':

print "VA";

break;

case 'WASHINGTON':

print "WA";

break;

case 'WEST VIRGINIA':

print "WV";

break;

case 'WISCONSIN':

print "WI";

break;

case 'WYOMING':

print "WY";

break;

endswitch;?>' maxlength="38">

<div style="display:none"><label for="delivery_state">* State</label></div>

</td>

</tr>

<tr>

<td align="right" class="mainText"><span class=label >ZIP Code?</span></td>

<td><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" border="0" width="1" height="1" alt=""></td>

<td><input type="text" name="deliveryZipcode" id="deliveryZipcode" style="width:160px" size="19" tabindex="21" value='<?php echo $order->delivery['postcode'];?>' maxlength="10">

<div style="display:none"><label for="delivery_zipcode">ZIP Code? Address will be standardized as necessary.</label></div>

</td>

<tr>

<td align="right" class="mainText"><span class=label >email</span></td>

<td width="7"><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" border="0" width="1" height="1" alt=""></td>

<td>

<table border="0" cellpadding="0" width="160" cellspacing="0" summary="This table is used to format page content.">

<tr>

<td width="1" bgcolor="#CCCCCC"><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" width="1" height="1" border="0" alt=""></td>

<td width="27" bgcolor="#CCCCCC"><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" width="1" height="1" border="0" alt=""></td>

<td width="131" bgcolor="#CCCCCC"><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" width="1" height="1" border="0" alt=""></td>

<td width="1" bgcolor="#CCCCCC"><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" width="1" height="1" border="0" alt=""></td>

</tr>

<tr>

<td width="1" bgcolor="#CCCCCC"><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" width="1" height="1" border="0" alt=""></td>

<td width="27" valign="top"><input tabindex="24" id="id_notify" name="id_notify" type="Checkbox" value="Y" >

<div style="display:none"><label for="id_notify"><span class="smmainText">Notify recipient of shipping, via email notification</span></label></div></td>

<td width="131" class="smmainText" align="left" valign="middle"><span class="label">

Notify recipient of

shipping, via

<a tabindex="25" href='https://sss-web.usps.com/ds/jsps/emailNotifyPopup.jsp' target='someName31' onClick='void openWindow ("https://sss-web.usps.com/ds/jsps/emailNotifyPopup.jsp", "someName31", "width=300,height=185", 100, 150, window, "resizable=1,menubar=0,toolbar=0,location=0,personalbar=0,status=0,scrollbars

=0");'><span class="utilitybar">

email Ship Notification</span></a>.</span></td>

<td width="1" bgcolor="#CCCCCC"><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" width="1" height="1" border="0" alt=""></td>

</tr>

<tr>

<td width="1" bgcolor="#CCCCCC"><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" width="1" height="1" border="0" alt=""></td>

<td width="27" bgcolor="#CCCCCC"><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" width="1" height="1" border="0" alt=""></td>

<td width="131" bgcolor="#CCCCCC"><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" width="1" height="1" border="0" alt=""></td>

<td width="1" bgcolor="#CCCCCC"><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" width="1" height="1" border="0" alt=""></td>

</tr>

</table>

</td> <td><input type="text" name="delivery_email" id="delivery_email" style="width:160px" size="19" tabindex="19" value='<?php echo $order->customer['email_address'];?>' maxlength="55">

<div style="display:none"><label for="delivery_email">email</label></div>

</td>

</tr>

</table>

</td> <!-- end of text boxes column -->

</tr>

</table>

</td>

</tr>

</table>

</td>

</tr>

</table>

<table summary="This table formats the form information." border="0" cellspacing="0" cellpadding="0">

<tr>

<td><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" border="0" width="1" height="1" alt=""></td>

<td height="32" colspan="5" valign="top"><img src='<?php echo DIR_WS_ADMIN ?>images/uspsimages/sub_enterpackage_info.gif' width='150' height='23' alt='Enter Package Information' border='0'></td>

</tr>

<tr>

<td valign="top" class="mainText"><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" border="0" width="1" height="1" alt=""></td>

<td><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" border="0" width="1" height="1" alt=""></td>

<td colspan="4">

<!-- start of weight formula-->

<?php

$shipping_weight_ot = substr($order->totals[1]['title'],strpos($order->totals[1]['title'],'x') + 1, (strpos($order->totals[1]['title'],'lbs') - strpos($order->totals[1]['title'],'x'))-1 );

$shipping_weight = ($shipping_weight_ot < 0.1 ? 0.1 : $shipping_weight_ot);

$shipping_pounds = floor ($shipping_weight);

$shipping_ounces = round(16 * ($shipping_weight - floor($shipping_weight)));

 

?>

 

<!--end of weight formula-->

 

<table cellspacing="0" cellpadding="0" border="0" summary="This table is used to format content.">

<tr>

<td align="right" class="mainText"><span class="mainTextRed">* </span><span class=mainTextBoldRed >Weight</span></td>

<td><img src="<?php echo DIR_WS_ADMIN ?>images/uspsimages/spacer.gif" border="0" width="1" height="1" alt=""></td>

<td align="left" bgcolor="#FFFFFF" height="20"><input type="text" name="shippingWeightInPounds" id="shippingWeightInPounds" style="width:50px" size="5" tabindex="26" value='1' maxlength="2">

<div style="display:none"><label for="weight_pounds">* Pounds</label></div>

</td>

<td align="left" class="smmainText"><span class="smmainText"> pounds</span></td>

<td align="left" bgcolor="#FFFFFF" height="20"><input type=

Tony Mazz

Link to comment
Share on other sites

Hey, can you post your code as a link somewhere. Maybe put it on your server and rename it with ".phps" so we can view the source. The message base seems to have clipped your code and not shown it all.

 

I'm anxious to try your code. Just to be completely clear, this will allow us to print a label with the postage included?

 

Thanks!

Link to comment
Share on other sites

Hey, can you post your code as a link somewhere. Maybe put it on your server and rename it with ".phps" so we can view the source. The message base seems to have clipped your code and not shown it all.

 

I'm anxious to try your code. Just to be completely clear, this will allow us to print a label with the postage included?

 

Thanks!

 

Yes indeed you can pay for postage & print it on the label as before. I uploaded it to: http://www.testproducts.com/tmp/diffrentshipping.phps - give her a try.

Tony Mazz

Link to comment
Share on other sites

Yes indeed you can pay for postage & print it on the label as before. I uploaded it to: http://www.testproducts.com/tmp/diffrentshipping.phps - give her a try.

 

HOLY JUMPING CATS!!!

 

I think it works! Woo Hoo! I'll try using it this afternoon when we process orders. But on first blush it seems to be working.

 

How in the heck did you get it to go?

 

Thank-you! Thank-you! Thank-you!

Link to comment
Share on other sites

I'm very pleased to see this working again! Thanks for your efforts tonymazz! One thing I didn't like about the last contribution is that the option to send the buyer a delivery confirmation number wasn't available. I'm glad to see it's back in this version, but I'm wondering if this is working. I noticed that if you add a label to your cart with this newest version, the user's email address doesn't appear below their address -- even if you check the box to notify them. Does anyone know if the recipient is actually getting an email from this? Thanks!

Link to comment
Share on other sites

I noticed that if you add a label to your cart with this newest version, the user's email address doesn't appear below their address -- even if you check the box to notify them. Does anyone know if the recipient is actually getting an email from this? Thanks!

 

I have not had the time to get this finished to pass the email to USPS. One reason is because it seems they are not finished messing with their site so the final code could be different even again.

 

So to answer your question - there is nothing being emailed by USPS unless you go back (revise the label at USPS' site) and physically enter the mail into the USPS form. You do not have to check yes on the form since once an email address is entered into the field it defaults to yes.

Tony Mazz

Link to comment
Share on other sites

Yes indeed you can pay for postage & print it on the label as before. I uploaded it to: http://www.testproducts.com/tmp/diffrentshipping.phps - give her a try.

 

I took this file and just overwrote the old one on my server but when I link to it now, i the page source loads completely unrendered. Any idea why this would be happening?

Link to comment
Share on other sites

I took this file and just overwrote the old one on my server but when I link to it now, i the page source loads completely unrendered. Any idea why this would be happening?

 

Check the name of the file as different is spelled diffrent. And did you take the s off of .php? the filename that works is diffrentshipping.php

Tony Mazz

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