Community Add-Ons
usps shipping labels
for osCommerce Online Merchant v2.2
This contributions ties osCommerece to USPS website. So you don't have to type in every order. There are two improvements that need to be made one the weight issue if any one knows where that is stored let me know so i can update that. Two the shipping state USPS web site takes it abbreviated where is osCommerece gives us the full name any ideas on how to make a work around would be great.
It appears as though some changes on the side of USPS have made this module not work, but I found an easy fix.
On usps_ship.php change this hidden field (around line 645):
<input type="hidden" name="labelId" value="">
To this:
<input type="hidden" name="labelId" value="<?php echo $packageID; ?>">
This seemed to get me back up and running.
I updated the package with that one very small change. If you have this installed, it's much easier to just make the one small change manually using the directions above-- you don't have to reinstall, I just made the one minor change mentioned. But this is the complete package with this bug fix implemented in it, so going forward, this is probably the package to use until someone updates it.
Ashley
11/14/06 - v2.0.3 (both mods thanks to SteveDallas)
usps_ship.php - line 23 Replaced package ID equation to make packages show up in order at USPS
usps_ship.php - lines 49 -52 Replaced to retreive actual values since "it breaks on amounts of $1000 and over, if you use commas as the thousands separator"
Complete package, but only usps_ship.php has changed
Corrected where it would send Zip Code, Postal code, State, and Provice for all shipping addresses. Usps used to allow this, but recently changed their site and it now causes errors if Zip Code and Postal Code are both sent.
Complete package, but only usps_ship.php has changed
fixed two places where <? should have been <?php
usps_ship.php
added feature that was added in version 1.9d "adding a default case to the state abbreviator switch"
Previous version assumed the same shipping country for billing country, now uses appropriate country
I took the latest USPS page and completely re-wrote this based on the previous versions.
Works with international shipments
Configure settings in the admin control panel.
Set whether to ship to the customers billing or shipping address.
Set a shipping cutoff time so that any labels done after that time are submitted with tomorrows ship date.
Set a "Ship from zip" so that you can drop off the packages at a different post office.
Set a weight override to disable weight calculations and make every package the same weight.
Create return pre-paid address labels by putting the store address in the delivery fields and the customers address in the return fields and sets the date for 3 days later.
Only send a package value for packages over a configuration value so that insurance is defaulted for those packages.
When using the "sign in" link in the top right, it sends you back to the custom form after sign in.
Adds a USPS shipping button to orders.php in the order info box only when USPS is their shipping method.
This is the same as the one as I uploaded before the "fix" messes with the mysql. If you want to use the sql and be able to edit your ship from info from the admin - you need to use this one and not the "fix".
This is the complete package.
Changed a few lines in the Configuration area of different_shipping.php to reflect variable names used later in the code. Please read the README file.
This is a update of USPS ShippingLabel v1.9d. I added the "differentshipping.php latest fix" from roedel below.
I also fixed the weight fields and moved the configuration from the file to the configuration section, and updated the readme file.
exchange this file in the latest version 1.9d.
It fixed the page not found error in my case.
Dont forget to enter your address details to the file. Check the support forum http://forums.oscommerce.com/index.php?showtopic=168620&st=160 for latest issues and updates.
Re-packed; added 3 lines in different_shipping.php, adding a default case to the state abbreviator switch. The switch takes the State name from the delivery address information from an order and abbreviates the state to its two letter code. However, this switch returned nothing when given a state abbreviation. For example, if the state was "Oregon", the switch changed it to 'OR', but if the state was "OR", it returned nothing and the info had to be entered manually. This slight modification compensates for customer habits.
Re-packed; deleted wrong version of 'differentshipping.php' from previous package and relocated correct version of 'differentshipping.php' to the proper place in file structure.
Modified 'differentshipping.php'; Corrected issue with weight calculation, minor cosmetic change.
All credit goes to the below authors
A little mistake of mine... I packed the wrong file... Now it's working!
Edited by ME 03/16/2006
Sorry! Last pack had the wrong "differentshipping.php" in it.
Enjoy this pack :) with everything as promised working.
(Thanks Sid04 for pointing it out)
Edited by ME 03/15/2006
-Deleted the "Customer Shipping" because it was just about useless & it was broken & I could not fix it as I am still learning HTML & PHP with no Java experience.
-Applied all fixes that were posted prior to this version
-Cleaned up a LOT of the codding, giving it a better interface
-Changed the files places as many files were no long going to be used and mostly outplaced.
-Cleared up the Readme file to make it ease to undertand
-"Sign In" Button now opens a new window, so you can sign in close the window and keep on wrking on the label.
-Made some of the text more clear.
Please read the README.txt
One stop shop, Everything you see below this file has been implemented + more !
03/15/2006
-Deleted the "Customer Shipping" because it was just about useless & it was broken & I could not fix it as I am still learning HTML & PHP with no Java experience.
-Applied all fixes that were posted prior to this version
-Cleaned up a LOT of the codding, giving it a better interface
-Changed the files places as many files were no long going to be used and mostly outplaced.
-Cleared up the Readme file to make it ease to undertand
-"Sign In" Button now opens a new window, so you can sign in close the window and keep on wrking on the label.
-Made some of the text more clear.
Please read the README.TXT for more info
Weight with tare included:
This code adds the tare weight to the total product weight.
This is my most current version of the diffrentshipping.php file. USA is the default, email address is passed on and email confirmation is checked. Please be sure to BACKUP and be sure to configure (about lines 32 to 39) according to your store. Note: I noticed that after making a label, if I do not click the button at the bottom indicating that I would like to make a new label, and make a new label anyway, it drops the first one in que. So be sure to either hit create new label or checkout before going to the next step. Thread is: http://forums.oscommerce.com/index.php?showtopic=168620
Please read the support fourm
http://forums.oscommerce.com/index.php?showtopic=168620
you will also need to change the filename from "differentshipping.php" to "diffrentshipping.php" (note the e is missing in the new filename - this is on purpose) in shop/admin/includes/filenames.php
Consult the forum above for other problems with this
I found a small error the hard way and have fixed it (I believe). This is my first effort to contribute, so please take this with caution!!
I found that the customer state was used for the label input instead of the delivery state. I have replaced the word customer with delivery on line 630 and it appears to have resolved the issue.
This is the complete and current package (1.7c) containing the README.TXT and all edited files in original directories. Removed from this package are the personal FTP logs and THUMBS.DB files generated by the contributor's client-side software packages during editing.
Edited by Steel Shadow 12/19/04
-Removed extra customer shipping button because this was not needed. Now only one button added, configured for the customers Shipping address.
Edited by Steel Shadow 12/19/04
-Fixed Bug which caused: Parse error: parse error, unexpected T_STRING in
/admin/orders.php on line 328
Okay, I had a little time so I went over everything and this contribution should work perfect for everyone now, and should also install very easily!
Heres what I did.
Edited by Billy Brenner on 06/21/2004.
-Corrected errors on Diffrentshipping.php and Customershipping.php
-Corrected Syntax Errors in Included orders.php file
-Added Notes to the Configuration Areas for Proper Setup on Specialized Addresses.
-Fixed Broken Image Links
-Fixed Broken Javascript Links
-Included two new USPS buttons
-Fixed Weight Calculations
-Corrected Syntax Errors in Instructions
Any questions or comments, please use the support thread.
http://forums.oscommerce.com/index.php?showtopic=57445&st=60&#entry390281
typo in readme file relating to lines to paste in orders.php
This is just a simple button upgrade to this fantastic USPS Shipping Label contrib. I didn't like the iconized text for the label buttons in the admin page. These are just for asthetics. Keep up the great work gentlemen!
Just replace the buttons in the ...
/admin/includes/languages/english/imgages/buttons
..with the one's in this zip Enjoy!
Rich Morgan
Just did a few corrections to the last update. Fixed the broken links to the images and javascript again. Also updated customershippinglabel.php as in the last update, only diffrentshipping.php was updated to the new USPS format.
USPS.com has updated there web site.
Here is the new files to match the update that they have provided.
USPS has add these new great features
Shipping Cart
Address Book
Credit Card Storage
**Shipping History** "yea"
This update has all the corrections provided by
Tom Wojcik www.xpertcomp.com
BILLY BRENNER, www.ecommercedesigns.biz
Delvoped by Chris Morales www.goldencrown.biz
** don't forget usps has some great insentives for us to use there services. They provide free box's and you can get a digtial scale at a discount price $35.00. they aslo provide other great services to help you build your business.
Well, I went though this contribution and with the help of the original author, got everything working right!
Heres what I fixed;
*Fixed Shipping Weight Calculation Problem, now it enters the weight directly into the label interface!
*Fixed the State Name Problem so it enters it correctly!
*Fixed all broken links to USPS.com!
*Edited the file so that it works off of anyones admin directory without editing by using <?php echo DIR_WS_ADMIN ?> before all of the images/infobexs/uspsimages referances!
*Fixed the broken path to all the Javascript Files!
*Added a Configuration Area at the top of each file for easy editing of the two files, no more searching through the code for what to edit!
*Updated the package to work with MS2 orders.php!
*Included a full edited version of orders.php to work with any site based on MS2 2.2!
*Edited the instructions so that no steps are left out. It is a very easy installation, and now its outlined correctly!
Thats about it. It is working perfect now for me, and hopefully will do so for anyone else whio wished to use it!
Billy Brenner
www.ecommercedesigns.biz
I put this code in on the diffrentshipping.php file and the customershipinglabel.php. What it does is display the total weight before the package information on the usps interface. so that who ever is processing the order does not have to go back to oscommerce to see what the weight is.
<?php
for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) {
echo ' <tr>' . "n" .
' ' . $order->totals[$i]['title'] . '</td>' . "n" .
' </tr>' . "n";
}
?>
ok I solved the state problem. I created a switch statement that match’s the name of the state with the abbreviation. It just won’t display in the state field. So if you have any ideas to fix it that would be great.
I still can not find where the total order weight is stored.
This contributions ties osCommerece to USPS website. So you don't have to type in every order. There are two improvements that need to be made one the weight issue if any one knows where that is stored let me know so i can update that. Two the shipping state USPS web site takes it abbreviated where is osCommerece gives us the full name any ideas on how to make a work around would be great.
