USPS changes in 2011

I place code per glukkk instructions. Internation 1st class and priority for fine.

All domestic services work also.



Thanks,

David

I have changed the code as instructed by glukkk above, but this is what I am now getting every time I go to checkout:



Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/myusernamehere/public_html/shippings/usps.php on line 280



What is wrong?



I’ve had two customers asking why there are no shipping methods for their country in the last couple of days, whicih suggests there may be others who just bailed out and went elsewhere.



Help!

OK now I have added Larry’s code from above and it has added back Priority Mail International and Express Mail International.



But I don’t get an option for First Class International.



Also, I have free Media Mail shipping (Continental US) on orders of $20 or more. It used to be that when this was triggered, the cart would automatically select the free shipping and it would be at the top of the list of shipping methods in checkout. However, now it auto-chooses Priority Mail and puts that at the top of the list and Media Mail at the bottom.

I was able to get USPS international shipping options to work by modifying file usps.php to rename some of the USPS service code names to match the CS-Cart

database. The final and proper solution is an upgrade and/or patch from the CS-Cart developers.



Below are 2 tables: the USPS service code names found in the CS-Cart database table [shipping_services], and, in the second table, shipping service code names returned by query to USPS API.



Notice many of the CS-Cart service code names do not properly match the new USPS service code names. Also some shipping service names are missing from CS-Cart. Service code names that don’t match are preceded by an asterisk*



------------------------------------------------------------

CS-Cart international shipping service code names in

database table [shipping_services]

------------------------------------------------------------

*Express Mail International (EMS)

*Express Mail International (EMS) Flat-Rate Envelope

First Class Mail International Flats

First Class Mail International Large Envelope

*First Class Mail International Letters

First Class Mail International Package

First Class Mail International Parcels

*Global Express Guaranteed

Global Express Guaranteed Non-Document Non-Rectangular

Global Express Guaranteed Non-Document Rectangular

Priority Mail International

*Priority Mail International Flat-Rate Box

*Priority Mail International Flat-Rate Envelope



------------------------------------------------------------

International shipping service code names returned by query

to USPS API (the offending HTML encodings and asterisks are

removed from these service code names)

------------------------------------------------------------

Express Mail International

Express Mail International Flat Rate Envelope

Express Mail International Legal Flat Rate Envelope

First-Class Mail International Large Envelope

First-Class Mail International Letter

First-Class Mail International Package

Global Express Guaranteed (GXG)

Global Express Guaranteed Non-Document Non-Rectangular

Global Express Guaranteed Non-Document Rectangular

Priority Mail International

Priority Mail International DVD Flat Rate Box

Priority Mail International Flat Rate Envelope

Priority Mail International Gift Card Flat Rate Envelope

Priority Mail International Large Flat Rate Box

Priority Mail International Large Video Flat Rate Box

Priority Mail International Legal Flat Rate Envelope

Priority Mail International Medium Flat Rate Box

Priority Mail International Padded Flat Rate Envelope

Priority Mail International Small Flat Rate Box

Priority Mail International Small Flat Rate Envelope

Priority Mail International Window Flat Rate Envelope

USPS GXG Envelopes

Pavel’s mod worked for us in v2.0.12



Thanks!

Was using 2.1.2 and had applied changes on this thread and International USPS were working. Now I upgraded to 2.1.3 and I see some of the changes on the usps.php file but not a novice here and now it’s not working. I have a submitted a ticket waiting for answer. If anyone has this issue please advise fix.



Please assist. tks

[QUOTE]Now I upgraded to 2.1.3 and I see some of the changes on the usps.php file but not a novice here and now it’s not working. I have a submitted a ticket waiting for answer. If anyone has this issue please advise fix.[/QUOTE]I just upgraded also. I had to hack the usps.php file again and add Priority Mail Small, Medium, Large boxes to the tables shipping_services and shipping_service_descriptions. I was thinking about adding Regional Boxes, but that would require hacks to the language table and a smarty template (hard coded options). I guess not too many CSC users use USPS. I find using flat rate boxes are so much cheaper than UPS or FedEx. I’ve reduced my shipping bill by thousands every month just by using the Postal Service.

Suggest you submit issues like this to the bugtracker so they become known bugs and get fixed.

[quote name=‘tbirnseth’]Suggest you submit issues like this to the bugtracker so they become known bugs and get fixed.[/QUOTE]I submitted bugs there before and nothing happen. So I’ll post it here so others can fix their code. Here is another one.



As you know, USPS defines “Large” as a box larger than a 12 inch cube. It is part of their dimensional weight measurement. So if you define a Priority Mail shipping method for boxes larger than a 12 inch cube and is non-rectangular, it will fail because the XML containing Girth measurement will contiain your API User ID. The fix in usps.php line 79:



Change

$shipping_settings['usps']['username']

To

$shipping_settings['usps']['priority_girth']

Larry, isn’t the main problem the fact that there is currently not a way to designate which of your products (or how many of) can actually be contained within & shipped in a Small, Medium, or Large Flat Rate Box?



Last thing I would want to do is actually offer the discounted Flat Rate Box rates in realtime to our customers & then not actually be able to utilize them while shipping the packages!



I brought the Flat Rate Box issue up during the 2.1.3 release candidate talks, although there were not many solutions as to how to incorporate this in a practical way, the whole flat rate box issue is a tricky one to incorporate into any online shopping cart system and it is even more complex now with the Regional flat rate offerings as well as different envelopes, etc.



We ship using flat rate boxes on a daily basis, however, the tricky part is only being able to offer the discounts in realtime to the customers, as in knowing which shipments they can actually be utilized on, right?



I would be interested in hearing more of your thoughts! :wink:

Packaging should be related to a product. I.e. dimensions and/or a symbolic package name (list actually) with the number of this product that can be put into one of those packages.



The package names should be a user created list of names with dimensions. The merchant should be able to have this list related to the dimensions and/or number of items per package. Each package should then be able to be associated with one or more shipping methods.

[quote name=‘Struck’]We ship using flat rate boxes on a daily basis, however, the tricky part is only being able to offer the discounts in realtime to the customers, as in knowing which shipments they can actually be utilized on, right?[/QUOTE]I posted this problem years ago on this forum. Nothing happen so I modified to code to use the three flat rate boxes. All my products have the dimensions and weight stored as do my boxes including the flat rate boxes. Using a best fit function, I determine which flat rate box will work, if any, and display the rate to the customer as “Priority Mail”. Now that I’m upgrading CSC to the latest version, I have to mod the code again to make flat rate work. All of this wouldn’t be a problem if shipping wasn’t so expensive. When 50% of the purchase is just for shipping, any savings I can offer the customer helps and it gives me an edge over my competition who uses UPS or USPS regular priority mail.

[QUOTE]All of this wouldn’t be a problem if shipping wasn’t so expensive. When 50% of the purchase is just for shipping, any savings I can offer the customer helps and it gives me an edge over my competition who uses UPS or USPS regular priority mail.[/QUOTE]



I agree with you entirely Larry.

Priority Mail can be in many particular situations an excellent alternative to UPS & Fedex and the USPS is going after the parcel delivery market very aggressively, they have realized they can no longer survive simply delivering letters. They also deliver 6 days per week as a standard vs. 5 days, that in itself is a huge advantage as I see it. And for lightweight international parcel shipments, the benefits USPS offers can really shine. We have been gradually shipping more & more Priority Mail packages to the point where the UPS drivers are taking note, this of course can work out in our favor when it comes time for rate negotiations.

Are these code fixes still good for 2.14? I’m working on a cart that is using real time calcs and although I can get domestic express and first class to work, I can’t get priority and priority mail international to work or for that matter 1st class international.

See: [url]http://forum.cs-cart.com/showthread.php?t=24702[/url]

It looks as if the 2.0.15 version could be dropped into 2.0.14. The diff between 2.0.14 usps.php and 2.0.15 are relatively small and look to be mostly defect corrections for locations and support for specifying the type of first class mail.