Jump to content
bad_lemming

[Contribution] - USPS Methods

Recommended Posts

I use osCommerce Online Merchant v2.2 RC2a

 

It has been a grueling week or so getting this going, and ultimately, I could not get Methods 6.1 to work. Somehow it loses the "title" value and fails.

 

What I did get to work was Methods 6.4 with the modifications above by badlhby (thank you so much - I never would have figured that out) by putting the function just before it was called in usps.php

 

So usps is working now, but the next minute that could change. Does anyone know the facts as to what usps is doing, or not doing with the responses. Are they "chunked" or not. The first time I saw this chunked term I went WTF is that, and almost blew my chunks. It is quite insane that usps would, just like that, constantly keep changing things and blow up countless shipping modules in the process.

 

Methods modules will get rate quotes from usps based on package size and weight, and it even comes with dimension support, which I have never looked at. I am getting the right responses, and the "title" value makes it all the way to the end. It works, for now.

 

I want to thank everyone for their help and input. Reading your questions and the answers to them is a tremedous way to learn.

 

If anyone wants a copy of the Methods 6.4 usps.php file that worked for me, just ask and I will post it here.

Share this post


Link to post
Share on other sites

All of the responses that I have personally seen have been chunked, and that's quite a few. Other people have reported responses that were not, or error messages caused by the response not being chunked.

 

I have no idea what the USPS is doing, and I have doubts that anybody there does.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Appears this is working now.

 

Only problem I am having is it is in descending order (highest price first and lowest price last) Anyway to adjust that?

 

I am using USPS Methods 6.4

Share this post


Link to post
Share on other sites

Dears,

Now USPS can work, but no weight display 0.00 lbs , only display like the following . would you please help to give suggestion? All setting is okay from admin now.

 

United States Postal Service (1 pkg, 0.00 lbs total)

Share this post


Link to post
Share on other sites

Dears,

Now USPS can work, but no weight display 0.00 lbs , only display like the following . would you please help to give suggestion? All setting is okay from admin now.

 

United States Postal Service (1 pkg, 0.00 lbs total)

 

Did you adjust settings or add another addon after yours was working?

 

No issues on my site at all.

Share this post


Link to post
Share on other sites

I am using USPS Methods Version 5.2.2 and today, 1/26/2014, the quotes are coming back incorrect. If anyone is using a different version that is working with correct quotes, please let me know which is it. I know USPS made some changes that probably affects the API. Here we go again.


Production:
osCommerce V. 2.3.4BS
VPS Box

Share this post


Link to post
Share on other sites

What is incorrect? If it's just the prices, have you checked the new prices against the USPS website? I'm still getting good results from the USPS Methods Rates V4 Intl Rates V2 - 01-27-13 Update module, but I haven't checked all of the prices.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Yes. I check the price quotes against USPS website quotes.

The contribution you mention is different than the one in this thread, however does the contribution you suggest work with OSC 2.2 RC2a, because this is what version my store is.


Production:
osCommerce V. 2.3.4BS
VPS Box

Share this post


Link to post
Share on other sites

I'm currently using that addon on a couple of 2.2RC2a stores, as well as several 2.3.whatever. It seems to work with both. I haven't checked the prices extensively, but i did check a couple and they seemed correct.

 

I take no responsibility for the USPS actually returning the correct rates, or for them even following their own API.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

I have not yet made any changes. I was getting ready to, but I checked the price quotes once more and now they are working correctly. I am still using USPS Methods ver. 5.2.2 with past USPS problem modifications applied. My conclusion is that something on the USPS side was causing the problems because another person with their OSC store was having the exact problems as I yesterday. Well, back to business.


Production:
osCommerce V. 2.3.4BS
VPS Box

Share this post


Link to post
Share on other sites

Noticed that 'Standard Post' domestic shipping option doesn't work for me. I can get others to show up alright though.

 

After noticing this problem I updated to the latest USPS Methods 6.4 from 20 Nov 2013 (USPS Methods 6_4_1_2.zip) to see if that would help. I found that other shipping options were selected and working... but not Standard Post which used to be the only one that I was using prior to updating. Maybe just this one is having issues?

 

Has anyone seen anything similar to this or people resolving this issue?

 

An error occured with the USPS shipping calculations.

If you would like to use USPS as your shipping method, please contact the store owner.

 

Now what? Maybe I have something turned on that would restrict this option from being possible?

 

Thanks

Edited by smerritt

Share this post


Link to post
Share on other sites

Per the USPS update for January 2014, Standard Post can only be used for shipping live animals in zones 1 - 4. Yes, that's really what it says. Use Priority instead.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Broken again from a March 7, 2014 update. 1st Class Package service no longer shows up for domestic shipping options.

Share this post


Link to post
Share on other sites

Appears this is working now.

 

Only problem I am having is it is in descending order (highest price first and lowest price last) Anyway to adjust that?

 

I am using USPS Methods 6.4

 

I noticed that on line 792 in usps.php it says this:

 

arsort($quotesort); // sort methods by cost high to low

 

change to this:

 

 

//arsort($quotesort); // sort methods by cost high to low

asort($quotesort); // sort methods by cost low to high

 

Now it sorts low to high

 

Cheers!

Share this post


Link to post
Share on other sites

We have just released version 7.3.1 which addresses a number of shipping type changes, and also implements more sensible logging of shipping type changes, allowing for a much easier time in updating the module for the next time USPS decides to change their shipping types to break everything..

 

Tested on PHP5.3 (Linux):

- osCommerce 2.2rc1

- osCommerce 2.3.3

- *should work on any 2.2x or 2.3x version of osCommerce, but no guarantees of course*

 

Download 7.3.1 here:

http://addons.oscommerce.com/info/487

 

Full list of releases with notes / changes:

https://github.com/Evan-R/USPS-osCommerce/releases

 

Cheers,

Edited by AedeaInnovations

Share this post


Link to post
Share on other sites

@@AedeaInnovations

 

First off, thank you for your contributions to this.  Only after being involved with an osC store for the last few years do I really understand what's poured into these things by the community.

 

I switched to this module because the insurance works.  I ship a great deal to foreign countries, and USPS is the only reasonably priced AND insured international option. The insurance is a must.

 

 However, on the domestic side, I've been trying to get rid of the '1-Day' etc, displayed after Priority Mail.  I see in the code (I think) where there's a str_replace line that should be cleaning this off, but its not.  Im talking right around line 1250.  But that line seems to pass the cleaned results to $qid instead of $qname.  Mind you, I know just enough to be dangerous, as far as coding goes...but I switched $qid to $qname, and it did actually clean the name, but it lost a method on the customer side, and logged the "unsupported shipping types" to the DB, making the admin side unable to be edited. Then I noticed the module sent emails to me, about unsupported types and your github. I stopped there last night, and decided to look at it again today, after uninstalling and reinstalling  the module via admin. 

 

I think perhaps I should be working elsewhere in the code...perhaps around line 875, just before methods are returned?

 

Or should the code near 1250 be cleaning it, except I'm missing the  htmlspecialchars_decode function?  I don't find that in includes/functions/html_output.php,  or in general.php.

 

This kind of thing is nightmarish for me.  I could really use some guidance.

Share this post


Link to post
Share on other sites

Hrm...a fresh look on the next day means I should have posted last night.  So for anyone else that's looking for this:

 

Adding this below line 692 did exactly what I wanted:

 

$title = str_replace(array('<sup>', '</sup>', '®', '™', '®', '™', ' 1-Day', ' 2-Day', ' 3-Day', ' Military', ' DPO'), '', $title);
 
How does an idiot like myself stumble across solutions?  Makes me think I'm setting myself up for a catastrophe.

Share this post


Link to post
Share on other sites

Is it possible to sort the rates from lowest to highest instead of highest to lowest as they are right now? I'm using USPS with dimensional support v6.5 with osc 2.3.4.

 

Thanks.

Share this post


Link to post
Share on other sites

Never mind, I found the fix:

 

//arsort($quotesort); // sort methods by cost high to low
asort($quotesort); // sort methods by cost low to high

Share this post


Link to post
Share on other sites

Hello,

 

I'm using the latest USPS module v6.5. I have a problem with moving forward through checkout when selecting one of the USPS shipping methods, no problems with any other carriers (FedEx or UPS). The page just refreshes but doesn't go further to select payment. KissER Error Handling & Debugging module shows the following error on the page:


E_STRICT Error Count: 8
Error: Only variables should be assigned by reference
File: includes/classes/xml.php
Line: 70

 

Is anybody else having the same problem? Any idea on how to fix it?

 

Thanks.

Edited by Irin

Share this post


Link to post
Share on other sites

I would prefer to use the latest one, because USPS Methods Rates V4 Intl Rates V2 - Rev. 3.5.2 doesn't support insurance and doesn't show ETA, which are very important for me. I found the USPS with Dimensions Support v6.5 for osCommerce 2.3.4 by wdepot, and it suits all my needs. However, there is a problem with completing checkout that I described in my previous post. The v7.3.1 doesn't seem to work for me, because it messes up my admin interface and doesn't give me an option to edit the shipping module. So far, I haven't found one USPS module that would work 100% for me.

Edited by Irin

Share this post


Link to post
Share on other sites

This is a very good add-on and the only one close to what is needed for USPS.   I would like to revive this thread.   I have this installed on an oscommerce v2.3.4 with Mini Template System, Absolute pricing and some other stuff.    It works well and the boxes are packed correctly but USPS doesn't seem to use the dimensions for the box it is packed in as shown in "Shipping boxes used" with the 'use product dimensions' selected.   I have painstakingly installed and verified that it is installed correctly and it all seems to be working correctly otherwise.   The reason I know its isn't working is because usps keeps offering first class letter and large envelope for items too large for those dimensions.   Anyone else have this problem? 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×