Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

USPS Labels not working


aldaffodil

Recommended Posts

  • Replies 273
  • Created
  • Last Reply

Top Posters In This Topic

Whatever upgrade USPS did yesterday killed this contribution.

 

I am in the middle of fixing it. So far I have this change & it has began to work properly with a few exceptions.

 

Change action to this:

 

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

 

I think there a few other changes that have to be made, but this is the main one so far.

Tony Mazz

Link to comment
Share on other sites

I am in the middle of fixing it. So far I have this change & it has began to work properly with a few exceptions.

 

Change action to this:

 

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

 

I think there a few other changes that have to be made, but this is the main one so far.

 

I've been working on the same thing, but I'm starting out with the new page and pulling in the information from the database. Previous updates have left things out. With any luck, I will also have international stuff working in a day or two.

 

--Glen

Link to comment
Share on other sites

Here's the most recent file I have been working on so far. The following changes were made so far:

 

1. Changed URL's to match Postal Service Changes that were just made.

2. Added reference number as the Order Number

3. Changed "Shipped from Zip Code" to set as default.

4. Cleaned up some un-needed code

5. added COMPANY in define

 

don't forget to change the variables (lines 34 thru 40)

 

It can be downloaded from here (after downloading change the name from .phps2 to .php)

http://www.testproducts.com/tmp/differentshipping.phps2

 

I noticed that the refernce number does not seem to show up any where that I can tell?? Using this mod will get you to a message that says"We are unable to find any available service options for this label, please review your label and try again."

 

If you scroll down & hit CONTINUE it will take you to the "SERVICE OPTION" page. I tried to work around this, but have to quit for now. If anyone else would like to pick it up from here, please do go for it. Hope this helps, Tony...

Tony Mazz

Link to comment
Share on other sites

If you scroll down & hit CONTINUE it will take you to the "SERVICE OPTION" page. I tried to work around this, but have to quit for now. If anyone else would like to pick it up from here, please do go for it. Hope this helps, Tony...

 

Tony, thanks for the timely update. If you can get the Service Option to work it would be much appreciated !

 

Ron

Link to comment
Share on other sites

I noticed that the refernce number does not seem to show up any where that I can tell?? Using this mod will get you to a message that says"We are unable to find any available service options for this label, please review your label and try again."

 

If you scroll down & hit CONTINUE it will take you to the "SERVICE OPTION" page. I tried to work around this, but have to quit for now. If anyone else would like to pick it up from here, please do go for it. Hope this helps, Tony...

 

Tony,

USPS now generates a package ID as a hidden input field when the form is generated that gets submitted along with the return and delivery addresses. I haven't figured out how to generate one that the Click-n-Ship server likes yet. If you leave it blank, you get an error. If you put a constant in there, it will just overwrite the first label in your cart.

 

--Glen

Link to comment
Share on other sites

Tony,

USPS now generates a package ID as a hidden input field when the form is generated that gets submitted along with the return and delivery addresses. I haven't figured out how to generate one that the Click-n-Ship server likes yet. If you leave it blank, you get an error. If you put a constant in there, it will just overwrite the first label in your cart.

 

--Glen

 

So, are we good to go tonight?

Link to comment
Share on other sites

So, are we good to go tonight?

 

You can try Tony's updated version. I'm working on something similar that will take care of these issues, as well as make my life easier shipping packages worldwide. I haven't posted anything yet.

 

--Glen

Edited by SteveDallas
Link to comment
Share on other sites

Tony and Steve,

 

Thanks so much, you are just great. I just tested the new file and cannot find anything wrong. The labels are accepted by the USPS web site. No problems at my end.

 

Thanks again

Wolfgang

Link to comment
Share on other sites

One added note, the postal service has it's own way.

 

Any abbreviated terms in the address like Cv Ct or Ln will not be accepted. Even when I typed Court or Lane it would not work.

 

I than simply deleted them and the label went through. The postal service put their own term in like CT without the dot.

 

This might save some frustations.

 

Wolfgang

Link to comment
Share on other sites

Hey all! I see we are still having upgrade problems. :)

 

For some reason, I am getting a 404 error. I have downloaded tonymazz's latest update, but get a "Error 404: Invalid path was requested" whenever I hit CONTINUE from the differentshipping.php.

 

It's sending me to https://sss-web.usps.com/cns/saveLabelInfor...liveryCountry=1

 

Did I miss something?

Link to comment
Share on other sites

Hey all! I see we are still having upgrade problems. :)

 

For some reason, I am getting a 404 error. I have downloaded tonymazz's latest update, but get a "Error 404: Invalid path was requested" whenever I hit CONTINUE from the differentshipping.php.

 

It's sending me to https://sss-web.usps.com/cns/saveLabelInfor...liveryCountry=1

 

Did I miss something?

 

Are you certain you are using the new file? Did you rename it & replace the original. It sounds like you are still using the old file. Try it again to be certaim. The location of the most recent file is here: http://www.testproducts.com/tmp/differentshipping.phps2

 

Have a good one all! :thumbsup:

Tony Mazz

Link to comment
Share on other sites

Could you please explain more about how and where to "change the variables (lines 34 thru 40)"? I've been looking at it and I don't quite understand where I'm supposed to change what to what.

 

Kind Regards,

Craig

Link to comment
Share on other sites

Could you please explain more about how and where to "change the variables (lines 34 thru 40)"? I've been looking at it and I don't quite understand where I'm supposed to change what to what.

 

Kind Regards,

Craig

 

See the example below and substitute your "return address" info that you would like in your label.

 

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

//CONFIGURATION AREA

DEFINE('COMPANY', 'ABC COMPANY'); //Your Company name

define('STREET', '1234 Anywhere Blvd'); //Your Street Address

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

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

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

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

define('ZIP', '12345-6789'); //Your Zip Code

//END CONFIGURATION

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

 

That should do it for you...

Tony Mazz

Link to comment
Share on other sites

See the example below and substitute your "return address" info that you would like in your label.

 

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

//CONFIGURATION AREA

DEFINE('COMPANY', 'ABC COMPANY'); //Your Company name

define('STREET', '1234 Anywhere Blvd'); //Your Street Address

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

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

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

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

define('ZIP', '12345-6789'); //Your Zip Code

//END CONFIGURATION

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

 

That should do it for you...

 

 

Thank you so very much! Is there also somewhere I need to put in my USPS login information?

Link to comment
Share on other sites

Thank you so very much! Is there also somewhere I need to put in my USPS login information?

 

This contribution doesn't deal with your USPS account information. The first time you use it each day, you will have to log in. Your session at USPS is automatically terminated after 15 minutes of inactivity, but you can keep sending labels until your cart is full or USPS logs you out.

 

--Glen

Link to comment
Share on other sites

Are you certain you are using the new file? Did you rename it & replace the original. It sounds like you are still using the old file. Try it again to be certaim. The location of the most recent file is here: http://www.testproducts.com/tmp/differentshipping.phps2

 

Have a good one all! :thumbsup:

Welllll I guess not! Sorry for the confusion. Its working!

 

I have noticed the "email" feature doesn't work though. Does it truncate the end of the address? For example, the email address is [email protected]......

 

It truncates it to [email protected]

 

And it doesn't do this until the end of the process. I am not sure if this is why its not dispatching an email for shipping confirmation or if there is some other glitch in their system.

 

Any ideas?

 

Thanks

Link to comment
Share on other sites

I'm getting an error now (again)

 

We?re sorry! We were unable to process your request. Please correct the error(s) indicated below:

We are unable to find any available service options for this label, please review your label and try again.

 

On the page with the error, if I scroll down and click Continue it works...

 

Any ideas?

Link to comment
Share on other sites

In the new file, should this item:

ZIP Codeâ„¢& n b s p;

be:

ZIP Code& # 1 5 3;

Spaced on purpose to show the code.

 

I'm getting an error now (again)

We?re sorry! We were unable to process your request. Please correct the error(s) indicated below:

We are unable to find any available service options for this label, please review your label and try again.

On the page with the error, if I scroll down and click Continue it works...

Any ideas?

No ideas yet, but at least it's workable.

Link to comment
Share on other sites

Here's the most recent file I have been working on so far. The following changes were made so far:

 

1. Changed URL's to match Postal Service Changes that were just made.

2. Added reference number as the Order Number

3. Changed "Shipped from Zip Code" to set as default.

4. Cleaned up some un-needed code

5. added COMPANY in define

 

don't forget to change the variables (lines 34 thru 40)

 

It can be downloaded from here (after downloading change the name from .phps2 to .php)

http://www.testproducts.com/tmp/differentshipping.phps2

 

I noticed that the refernce number does not seem to show up any where that I can tell?? Using this mod will get you to a message that says"We are unable to find any available service options for this label, please review your label and try again."

 

If you scroll down & hit CONTINUE it will take you to the "SERVICE OPTION" page. I tried to work around this, but have to quit for now. If anyone else would like to pick it up from here, please do go for it. Hope this helps, Tony...

 

 

We appear to have a modifed version of this includind the program name.

 

I fixed the URL but can someone tell me where I should look to fix

 

. Changed "Shipped from Zip Code" to set as default.

 

?

 

thanks

Kym

Link to comment
Share on other sites

We appear to have a modifed version of this includind the program name.

 

I fixed the URL but can someone tell me where I should look to fix

 

. Changed "Shipped from Zip Code" to set as default.

 

?

 

thanks

Kym

I made that fix last week so I cannot remember 100%. Try changing the lower case c in Zipcode to an uppercase C like ZipCode. I believe that was the change that fixed that.

Tony Mazz

Link to comment
Share on other sites

One thing I would suggest to you is the weight code that I added to mine. It's a little simpler by doing the sum in the sql.

 

Also, in the last line, I changed round(16 * ... to ceil(16 * ...

With the round function, 4.4 ounces will show 4 ounces, but the ceil function will show 5.

 

	$weight_query = tep_db_query("select sum(op.products_quantity * p.products_weight) as weight from " . TABLE_PRODUCTS . " p, " . TABLE_ORDERS_PRODUCTS . " op where op.products_id = p.products_id AND op.orders_id = '" . (int)$oID . "'");
$total_weight = tep_db_fetch_array($weight_query);
$shipping_weight_ot = $total_weight['weight'] + SHIPPING_BOX_WEIGHT;
$shipping_weight = ($shipping_weight_ot < 0.1 ? 0.1 : $shipping_weight_ot);
$shipping_pounds = floor ($shipping_weight);
$shipping_ounces = ceil(16 * ($shipping_weight - floor($shipping_weight)));

 

I'm still trying to figure out why it "can't find services" until the second submit.

Link to comment
Share on other sites

Hi,

 

First thanks to everyone who puts endless hours into this.

 

I have added this, but I was having problems with the weight fields.

 

You need to change

<?=$shipping_pounds?>

to:

<?php echo $shipping_pounds; ?>

 

and

 

<?=$shipping_ounces?>

to:

<?php echo $shipping_ounces; ?>

 

 

Also, I am wondering if there is a way I can add the Address settings to Admin > Configuration > Shipping/Packaging? It already has the zipcode in there and I could add the other lines - I just need to know how to add the right code the file. That way it could be changed through the admin panel instead of having to edit the file.

 

Any help would be great.

 

Thanks,

Philip

Edited by dwdonline
Link to comment
Share on other sites

Hi,

 

I figured out how to make the changes so I can now set the address under Admin > Configuration > Shipping/Packaging.

 

I have uploaded a new version that includes that and the fixes to the weight fields.

 

If you want to have that just replace the catalog/admin/differentshipping.php with the new one and run this mysql:

 

INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('', 'Ship From Name', 'SHIPPING_FROM_NAME', 'NONE', 'Enter the persons name you want on shipping labels etc.', 7, 10, NULL, '2006-07-06 09:08:10', NULL, NULL),
('', 'Ship From Company', 'SHIPPING_FROM_COMPANY', 'NONE', 'Enter the name of the Company you want on shipping labels etc.', 7, 11, NULL, '2006-07-06 09:08:10', NULL, NULL),
('', 'Ship From Street', 'SHIPPING_FROM_STREET', 'NONE', 'Enter the street address you want on shipping labels etc.', 7, 12, NULL, '2006-07-06 09:08:10', NULL, NULL),
('', 'Ship From Street 2', 'SHIPPING_FROM_STREET2', 'NONE', 'Enter the 2nd line of the street address you want on shipping labels etc.', 7, 13, NULL, '2006-07-06 09:08:10', NULL, NULL),
('', 'Ship From City', 'SHIPPING_FROM_CITY', 'NONE', 'Enter the city you want on shipping labels etc.', 7, 14, NULL, '2006-07-06 09:08:10', NULL, NULL),
('', 'Ship From State', 'SHIPPING_FROM_STATE', 'NONE', 'Enter the state you want on shipping labels etc.', 7, 15, NULL, '2006-07-06 09:08:10', NULL, NULL),
('', 'Ship From Zip', 'SHIPPING_FROM_ZIP', 'NONE', 'Enter the two letter of state you want on shipping labels etc.', 7, 16, NULL, '2006-07-06 09:08:10', NULL, NULL);

 

Philip

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.
Note: Your post will require moderator approval before it will be visible.

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