Jump to content
fulluvscents

USPS Rate V4, Intl Rate V2 (official support thread)

Recommended Posts

Go into the module setup in your Admin and set Email UPS errors to Yes. Run a test order and look at the email it sends. If that doesn't tell you what's wrong, post that email here and I'll take a look at it.

 

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

When I went back to admin>modules>shipping and clicked on edit, all the weights went away and changed to Shipping methods (Dom & Int) = Array, Extra services (both Dom & Int) = array.

 

Ran a test order and get the same message as above.  I think I'm missing adding a code somewhere, It has been so long since needing to install as if new add on that I'm missing some thing other then just coping the new usps over.  I will dig some more.

Share this post


Link to post
Share on other sites

It sounds like you missed the edit to your admin/modules.php. If so, fix that and then uninstall and reinstall the module to reset the weights.

 

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

You are the man.  That was next on my hit list.  Working like a charm.  Thank you

Share this post


Link to post
Share on other sites

I understand that USPS is renaming  First-Class Mail Parcel to First-Class Package Service this month.  Is an update for this module planned for that?  Glad to help test if I can.

 

Thank you


Joseph McMurry
Web Developer
PHP/MySQL

http://www.mcmwebsite.com
 

Share this post


Link to post
Share on other sites

running this on bootstrap and every time I save the module all the weights disappear and it just says "array"...

I copied the debug email and it says this:

 

Request:
API=RateV4&XML=<RateV4Request USERID="*MY USERID*"><Revision>2</Revision></RateV4Request>

Response:
<?xml version="1.0" encoding="UTF-8"?>
<Error><Number>-2147221202</Number><Source>Common:XmlParse</Source><Description>The element 'RateV4Request' has incomplete content. List of possible elements expected: 'RateClientType, Package'.</Description><HelpFile/><HelpContext/></Error>

 

I edited the files correctly.

I keep getting the Shipping is currently not available for the selected shipping address. Please select or create a new shipping address to use with your purchase.

Edited by broadstreetbully

Share this post


Link to post
Share on other sites

That usually means that you didn't edit the admin/modules.php correctly. Check that again. if you edited that file after you installed the module, uninstall and reinstall the module to clear the incorrect stored values.

 

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

the post above won't let me edit it so I figured out the problem by checking my other site that uses the same shipping addon...

the install directions say:

// USPS START
//        $contents[] = array('text' => '<br>' . $keys);
        $contents[] = array('text' => '<br />' . preg_replace(array('/RM/', '/TM/', '/International/', '/Envelope/'), array('®', '™', 'Intl', 'Env'), $keys));
// USPS END

but the <br> in the first line doesn't have the "/" (it should be <br />)...

I went through hell and even got a new user ID and it was the one little "/" causing all the problems.

 

so if anyone has everything set & edited correctly but keep getting the "array" showing in place of the weights that should be there make sure you check this one piece of code.

Share this post


Link to post
Share on other sites

By "the first line" you mean the one that is commented out? The line that does absolutely nothing?

 

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

@@kymation

 

Hi Jim,

 

This is perhaps slightly off topic, but you're the go-to guy for USPS, so, I'm hoping you'll throw me a bone.

 

I only allow First-Class International Package, Priority Mail International, and Priority Mail Express International.  FC is uninsured, so I'd like to default to Priority mail.  But since FC isn't viable for orders over $400.00, Priority Mail isn't always the second choice in the list...so I can't use the admin sort order to put USPS at the top and then use $cheapest[1] in place of $cheapest[$i] to select the second option.

 

Is there a way to define this in checkout_shipping somewhere? Or perhaps alter the output of the includes/modules/shipping/usps.php, so that it isn't ordered by ascending price?

Share this post


Link to post
Share on other sites

The sorting is done in the usps.php module, and it sorts the array by price. You want to then change that array if Priority Mail is not the first. This is ... not easy. Let me think about it.

 

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

Might be a good time for me to mention exactly what I'm doing.  I'm trying to set two different default shipping quotes depending on a zone check.

 

UPS Ground as the default domestic quote selection, and Priority Mail International for International.

 

I have a check for continental 48 in checkout_shipping, and it's also defined in classes/shipping.php.

 

To handle domestic, I set my UPS module's sort order to the top of the list.  Then I used an if/else to set $cheapest[$i] to $cheapest[0] in the shipping class file IF the zone check returns true for the 48 states.  

 

Else, for international, it reverts back to $cheapest[$i]...which still sorts based on the cheapest quote ...invariably First Class International Package.

 

If I can find a way to put Priority at the top of the list, I can reverse things and use $cheapest[0] to handle international, and then use my switch to trigger the "default shipping method" addon for domestic, in which I can define UPS.  That should default to ground.

 

It's just trying to figure out how to snag 'the middle quote' that has me vexed.

Share this post


Link to post
Share on other sites

Might be a good time for me to mention exactly what I'm doing.  I'm trying to set two different default shipping quotes depending on a zone check.

 

UPS Ground as the default domestic quote selection, and Priority Mail International for International.

 

I have a check for continental 48 in checkout_shipping, and it's also defined in classes/shipping.php.

 

To handle domestic, I set my UPS module's sort order to the top of the list.  Then I used an if/else to set $cheapest[$i] to $cheapest[0] in the shipping class file IF the zone check returns true for the 48 states.  

 

Else, for international, it reverts back to $cheapest[$i]...which still sorts based on the cheapest quote ...invariably First Class International Package.

 

If I can find a way to put Priority at the top of the list, I can reverse things and use $cheapest[0] to handle international, and then use my switch to trigger the "default shipping method" addon for domestic, in which I can define UPS.  That should default to ground.

 

It's just trying to figure out how to snag 'the middle quote' that has me vexed.

 

I'm assuming that First-Class International Package, Priority Mail International, and Priority Mail Express International are the only three service methods available. If so, then your personal fix to the usps.php code should be something like:

 

FIND:

        array_multisort($sort_cost, (MODULE_SHIPPING_USPS_RATE_SORTER == 'Ascending' ? SORT_ASC : SORT_DESC), $sort_id, SORT_ASC, $methods);

REPLACE WITH:

        array_multisort($sort_id, (MODULE_SHIPPING_USPS_RATE_SORTER == 'Descending' ? SORT_ASC : SORT_DESC), $sort_id, SORT_ASC, $methods);

That should put Priority Mail International on top, Priority Mail Express International in the middle, and First-Class Package International Service at the bottom. Does this trick work for you?

Share this post


Link to post
Share on other sites

Thanks @a.forever.  However, that would put Express Int'l on top in my case.  Still, it would achieve my primary goal, which is to avoid the uninsured option being default...perhaps that would be enough.

 

I have another question about how USPS (and other modules) handle address format alterations, but I think I need to put that in a different thread entirely. 

Share this post


Link to post
Share on other sites

Thanks @a.forever.  However, that would put Express Int'l on top in my case.  Still, it would achieve my primary goal, which is to avoid the uninsured option being default...perhaps that would be enough.

 

I have another question about how USPS (and other modules) handle address format alterations, but I think I need to put that in a different thread entirely. 

 

It shouldn't put Express on top. Are you sure $sort_id is first in the array_multisort() and not $sort_cost?

 

And I don't think this particular module even cares about address. It just pulls postal code and weights.

Share this post


Link to post
Share on other sites

@@kymation  Hi Jim, 

 

It has been a little while.  I'm setting up my new site with osc234 & BS 3.3.7.  I have USPS running, Went to check out per item shipping and recieved an error.  Went to Admin Side / Modules/shipping and to install.  Clicked on install and recived:

Warning: include(/home/ladybugxxxx/xxxxx/xxxxx/includes/languages/english/modules/shipping/usps2.php): failed to open stream: No such file or directory in /home/ladybugxxxx/xxxxx/xxxxx/adminlb/modules.php on line 141

Warning: include(): Failed opening '/home/ladybugxxxx/xxxxx/xxxx/includes/languages/english/modules/shipping/usps2.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/ladybugxxxx/xxxxx/xxxxx/adminlb/modules.php on line 141

 

Any ideas?

Share this post


Link to post
Share on other sites

Did you make a copy of this module named usps2.php? If you did, you need to copy the language file as well. Check that you have changed all of the constants as well  to avoid conflicts.

 

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

@@kymation

 

Thanks - not using usps2,  Not sure how it got in the folder, but deleted it.  All is well.  Thank you. :thumbsup:

Share this post


Link to post
Share on other sites

It shouldn't put Express on top. Are you sure $sort_id is first in the array_multisort() and not $sort_cost?

 

And I don't think this particular module even cares about address. It just pulls postal code and weights.

 

Apologies.  I caught the ascending -> descending change, but I missed the $sort_id change.  

 

However, I posted this inappropriately anyway; I should have started a new thread.   The V4 intl rate V2 module failed to apply insurance on my international shipping, (as seen here) so I have the 'original' USPS module in place (Methods V7.3.1), and it doesn't have that line of code in it.  I know that module has lots of problems, but it works for the 3 methods I offer, and the insurance works.  I'd resigned to the fact that I was stuck with it until Jim's 'Codes' module is in release.

 

My thoughts in posting here were that there might have been a way to order it in checkout_shipping.  I know wouldn't be the 'right' fix, but it would make for a temporary workaround. 

 

I'll reinstall V4 intl rate V2 and see if I still have issues with insurance.

 

Thanks for putting up with my nonsense.

Edited by Supertex

Share this post


Link to post
Share on other sites

I'm hoping someone can help me out.  I have a store setup, and it sells books and CDs.  The books weigh 0.59 lbs and the CDs weigh 0.14 lbs. I have the fare weight set to 0.5 lbs, and I have chosen the 1st-Class Lg. Env. and 1st-Class Parcel options chosen for my shipping methods.  I want to set it that 1.75 lbs is the limit for 1st-Class Lg. Env. and 15.5 lbs is the limit for 1st-Class Parcel.  This would mean that I could ship 8 CDs or 2 books in the large envelope, or 107 CDs or 25 books in the parcel.  The problem is that if I add more than 2 CDs or just 1 book to the cart, all shipping options disappear.  I have the weights of the items set correctly, and it seems like no matter what I set the maximum weight limits in the shipping module, these limits remain.

Share this post


Link to post
Share on other sites

Check that you have the base tare weight set to 0.5 and the percentage tare weight set to 0.

 

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

Jim,

 

These are my values:

 

Under Config>Shipping/Packaging

Max Package Weight = 15.5

Tare Weight = .5

Large Package % Increase = 0

 

Under Catalog>Categories/Products

Book Weight = .59

CD Weight = .14

 

Under Modules>Shipping>USPS

1st-Class Lg. Env. Min = 0, Max = 1.75

1st-Class Parcel Min = 0, Max = 15.5

 

Is there a setting that I am missing somewhere?

Share this post


Link to post
Share on other sites

All First Class shipments have a maximum of 13 ounces (0.8125 pounds). The USPS will not return quotes for higher weights. You need to add a different shipping method, such as Priority, for higher weights.

 

Regrds

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

The USPS has lots of arcane rules for the various classes, and way too many classes. I'm not sure it's possible to know all of them.

 

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

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

×