Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

USPS Labels not working


aldaffodil

Recommended Posts

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

 

yes, that's all properly setup. The button in my admin links to diffrentshipping.php, that's what my file is named as, I took off the s.

Link to comment
Share on other sites

  • Replies 273
  • Created
  • Last Reply

Top Posters In This Topic

Scratch that! I got it working! It was just a error with how I copied the page code in dreamweaver. I wasn't getting raw text from the code.

 

This is fantastic! I like the simplified interface.

 

Thanks for this!!

Link to comment
Share on other sites

Brief sanity check, isn't it differentshipping.php rather than diffrentshipping.php?

 

A previous version of the contribution had the mispelling, I've since updated it and have everything spelled right and working :D

Link to comment
Share on other sites

Does anyone else have the weight transferring over in this new version? I could not get it to work (It is hard coded for 1 lb 0 oz) so I dug back through somewhere else and made these changes, and now my weight transfers over:

 

Find

	$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 );

 

Replace with (grabs the weights for each product and adds them up)

$rs2 = mysql_query("SELECT p.products_id, p.products_weight, op.products_id, op.products_quantity FROM " . TABLE_PRODUCTS . " p, " . TABLE_ORDERS_PRODUCTS .  " op WHERE op.orders_id = '" . (int)$oID . "' AND p.products_id = op.products_id ") or die(mysql_error());
while($row2 = mysql_fetch_array($rs2))
{
$shipping_weight_ot = $shipping_weight_ot + ($row2['products_quantity'] * $row2['products_weight']);
}

 

Find

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

 

Replace with (inserts the pounds in the pounds box)

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

 

Find

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

 

Replace with (inserts the ounces in the ounces box)

<td align="left" bgcolor="#FFFFFF" height="20"><input type="text" name="shippingWeightInOunces" id="shippingWeightInOunces" style="width:50px" size="5" tabindex="27" value='<?php echo $shipping_ounces; ?>' maxlength="2">

 

You should now have your total weight showing up so the postage can be calculated.

 

Now if we can get the e-mail to work, and the thing to log into my account automagically, it will be perfect! (w00t)

 

Hope this helps some others.

 

John

Link to comment
Share on other sites

Does anyone else have the weight transferring over in this new version? I could not get it to work (It is hard coded for 1 lb 0 oz) so I dug back through somewhere else and made these changes, and now my weight transfers over:

 

Find

	$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 );

 

Replace with (grabs the weights for each product and adds them up)

$rs2 = mysql_query("SELECT p.products_id, p.products_weight, op.products_id, op.products_quantity FROM " . TABLE_PRODUCTS . " p, " . TABLE_ORDERS_PRODUCTS .  " op WHERE op.orders_id = '" . (int)$oID . "' AND p.products_id = op.products_id ") or die(mysql_error());
while($row2 = mysql_fetch_array($rs2))
{
$shipping_weight_ot = $shipping_weight_ot + ($row2['products_quantity'] * $row2['products_weight']);
}

 

Find

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

 

Replace with (inserts the pounds in the pounds box)

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

 

Find

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

 

Replace with (inserts the ounces in the ounces box)

<td align="left" bgcolor="#FFFFFF" height="20"><input type="text" name="shippingWeightInOunces" id="shippingWeightInOunces" style="width:50px" size="5" tabindex="27" value='<?php echo $shipping_ounces; ?>' maxlength="2">

 

You should now have your total weight showing up so the postage can be calculated.

 

Now if we can get the e-mail to work, and the thing to log into my account automagically, it will be perfect! (w00t)

 

Hope this helps some others.

 

John

 

 

This Has Helped But It Only Adds The Exact Weight And No Tare Weight. Any Ideas On This?

Link to comment
Share on other sites

This Has Helped But It Only Adds The Exact Weight And No Tare Weight. Any Ideas On This?

 

Yes, you are correct about that! I didn't think about that since I typically don't include tare weights. The original query looked at the shipping entry in the orders_total table, and stripped the weight out of the text for that. This method did include the tare weight but has two problems I am aware of:

 

1. If you have the sort order for your totals (sub-total, tax, shipping, etc.) changed around it looks at the wrong entry and won't give you a value.

 

2. If you do not have weights displayed it won't give you a value.

 

There must be a way to pull the tare weight out for the package too. I'll take a look and see if I can find it to add in to the query (unless someone already knows, please jump in here). May not be for a few days though, I am finishing up my store and getting ready to go live next week, so I am overwhelmed :wacko: (and sleepy -_- )!

 

John

Link to comment
Share on other sites

A previous version of the contribution had the mispelling, I've since updated it and have everything spelled right and working :D

 

 

I've become really tired of Click-N-Ship erroring out on me so I'm getting the PitneyBowes Shipstream system. I suspect even with needing to copy and paste (it parses the whole name/address at once) I think I'll be way ahead of the game. I also like the idea of using the little label printer for my shipping labels.

 

Will have to see if I can tap into an API and send osCommerce info directly into Shipstream...

Link to comment
Share on other sites

Some people were wanting the customers email to be passed to USPS so they could be sent a notification.

 

I think I have found a fix. I can get the customers email to be passed to USPS but I cannot get the checkbox passed to USPS (this shouldn't be a problem as somebody said earlier that if there is an email address it will send a notification either way).

 

Go to edit you diffrentshipping.php

 

Find any instance of

delivery_email

and change it to

deliveryEmail

 

Another fix that I like (others may not becuase they want to see the screen to confirm everything went through) is having it automatically select the ship to country. I ship to the USA for 99.999% of my orders so I thought it was time consuming to have to get the ship to country error every time. So if everything is sent correctly, clicking on the continue buttion on diffrentshipping.php takes me directly to the "choose service option" where i select how I want it to be shipped.

 

to do this go to edit your diffrentshipping.php

 

do a search for

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

 

directly under that paste

<input type='hidden' name='deliveryCountry' value='1'>

 

This will make the default country the United States. I dont recommend this for people that ship to many different countries, but for those who do only the USA this may save a bit of time.

 

Also please test this before relying on it 100%

Link to comment
Share on other sites

Wow nice contribution, its going to save me lots of time! One question, right now it its set up to open the differentshipping.php page, to be able to print a shipping label you have to be logged in. To make it a little smooterh is it possible to change the link to open 2 pages at the same time. The top page is the login page and the bottom page is the page with the shipping info. This way I could login, close the window and continue with the shipping. Thank you for taking the time to write this one!

 

Elizabeth

Link to comment
Share on other sites

I have the Label Shipping (print shipping and pay for label) working but I cant get the Label customer to work. I keep getting this error. any ideas or can someone post a working file?

 

Error 404: Servlet Not Found: com.usps.shipping.domestic.servlets.ShipmentPrepServlet

 

Thanks

Elizabeth

Link to comment
Share on other sites

I have the Label Shipping (print shipping and pay for label) working but I cant get the Label customer to work. I keep getting this error. any ideas or can someone post a working file?

 

Error 404: Servlet Not Found: com.usps.shipping.domestic.servlets.ShipmentPrepServlet

 

Thanks

Elizabeth

 

Hi Elizabeth,

 

If you browse back through this forum, you will see that there has been quite a challange getting this contribution to work with the USPS API interface. I think most of the concentration on fixing it has gone into the differntshipping.php label, since you would normally want that address to print out for a label that is going on the package to be shipped. The differentshipping label prints out the SHIPPING address, while the customer label prints out the BILLING address. I actually removed the customer label button from my orders screen so that I don't have to worry about accidentally printing the wrong shipping address.

 

To your other question/suggestion, that sounds like a good work around. It would be nice to have the label automatically log in for us, but no one has been able (or had time :blush: ) to get around to seeing if that is feasible.

 

If you really need the customer label, I think it should be an easy fix. It is just a matter of taking the differentshipping.php script and substituting the billing address for the shipping address in the queries. I will see if I can get some time later in the week to see if I can get a working version for you.

 

Be sure to look back the past few posts to integrate the various fixes for weights and customer emails.

 

John

Link to comment
Share on other sites

Why would I still be getting this

 

ERROR : Program has detected an unknown error and has returned you to the landing page.

Error Tracking Number : 1131407336332

 

When going to pay for the label? Seems like a problem on their end since I can print an "unpaid for" label without problem

 

Also is there a way to default the "shipping to" country to the US? I mean it is the UNITED STATES postal service and I dont trust them to ship anywhere else since I have been burned MANY times by them.

 

poop, I dunno. I get that above error sometimes, sometimes not. I was able just now but I know I wont be able to in a minute.

 

I had the original contrib for usps shipping labels for a year or 2 and never could get my employees to use it cause it sucked so bad, this looked promising for a few minutes..

 

USPS blows.

Link to comment
Share on other sites

Why would I still be getting this

 

ERROR : Program has detected an unknown error and has returned you to the landing page.

Error Tracking Number : 1131407336332

 

When going to pay for the label? Seems like a problem on their end since I can print an "unpaid for" label without problem

 

Also is there a way to default the "shipping to" country to the US? I mean it is the UNITED STATES postal service and I dont trust them to ship anywhere else since I have been burned MANY times by them.

 

poop, I dunno. I get that above error sometimes, sometimes not. I was able just now but I know I wont be able to in a minute.

 

I had the original contrib for usps shipping labels for a year or 2 and never could get my employees to use it cause it sucked so bad, this looked promising for a few minutes..

 

USPS blows.

 

 

It's working again, you should read through the last couple of pages, people have posted fixes for everything you're having trouble with.

Link to comment
Share on other sites

Also is there a way to default the "shipping to" country to the US? I mean it is the UNITED STATES postal service and I dont trust them to ship anywhere else since I have been burned MANY times by them.

 

 

A few posts up you will find this...

 

Another fix that I like (others may not becuase they want to see the screen to confirm everything went through) is having it automatically select the ship to country. I ship to the USA for 99.999% of my orders so I thought it was time consuming to have to get the ship to country error every time. So if everything is sent correctly, clicking on the continue buttion on diffrentshipping.php takes me directly to the "choose service option" where i select how I want it to be shipped.

 

to do this go to edit your diffrentshipping.php

 

do a search for

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

 

directly under that paste

<input type='hidden' name='deliveryCountry' value='1'>

 

This will make the default country the United States. I dont recommend this for people that ship to many different countries, but for those who do only the USA this may save a bit of time.

 

Also please test this before relying on it 100%

 

That automatically sends to USPS the default country is USA. You can do a view source on their shipping site to see the country codes for each country and just replace the "1" with whatever number your country code is.

 

Hope that helps

Link to comment
Share on other sites

Wow nice contribution, its going to save me lots of time! One question, right now it its set up to open the differentshipping.php page, to be able to print a shipping label you have to be logged in. To make it a little smooterh is it possible to change the link to open 2 pages at the same time. The top page is the login page and the bottom page is the page with the shipping info. This way I could login, close the window and continue with the shipping. Thank you for taking the time to write this one!

 

Elizabeth

 

What I do that seems to work for me is click "shipping" once and click on the login link at the top right of the page. Log in with your user and password. close it. click "shipping" once more and you should be good to go. The time out is like 10-15 minutes, so if you do all your labels at the same time you should be good.

Link to comment
Share on other sites

  • 3 weeks later...

OK everyone,

 

I just installed this contribution and am getting the following error when I get to the Click and Ship screen and click on 'continue':

 

Error 404: Servlet Not Found: com.usps.shipping.domestic.servlets.ShipmentPrepServlet

 

Any information?

Jim

Link to comment
Share on other sites

John

Have you or anyone else able to figure out how to get one link to open into 2 windows. I have two places in my admin that I could really use this function. Thanks for the help and this contribution.

 

Elizabeth

 

I don't know if I follow what you are trying to do. Do you want to instances of the shipping label to open with one button click? Where do you need this to happen (which page)? Not sure if I know how to accomplish it, but maybe with a little more info, we can get started down the right path.

 

John

Link to comment
Share on other sites

OK everyone,

 

I just installed this contribution and am getting the following error when I get to the Click and Ship screen and click on 'continue':

 

Error 404: Servlet Not Found: com.usps.shipping.domestic.servlets.ShipmentPrepServlet

 

Any information?

Jim

 

I have also found that even though I changed the filenames.php file to reflect the new filename (diffrentshipping.php), it still appears to be calling the original file (differentshipping.php)... or atleast that is the filename displayed on the navigation bar...

 

Any help would be appreciated as I would like to get the contrib up and running ASAP!

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