Welcome, Guest. Please login or register.
Login with username, password and session length


Need help or want to talk to other developers? Join the VirtueMart Chat! Read more...

  Advanced search

247038 Posts in 67506 Topics- by 258314 Members - Latest Member: aniketana
Pages: [1] 2 3 ... 31   Go Down
Print
Author Topic: Official USPS Shipping Module Thread  (Read 201753 times)
koltz
Sr. Member
****
Posts: 301


« on: August 27, 2006, 14:21:00 PM »

    Ok folks, here it is, I believe everything in this module should be working 100% now.  It is very difficult to test every country around the world, but the errors that have been found have been fixed.  This will be considered the 2.0 release.

    Here is what to expect:

  • Domestic and International Shipping Work
  • Over 70 Pounds a message will appear stating that this method cannot be used and to select another
  • Easy backend configuration
  • No known problems with the module

Here is what you need to know:

  • Know the shipping methods, most people (if any) should be able to use Media Mail, Library Mail, or Bound Printed Matter, don't use them!Use just standard methods like Express Mail, Priority Mail, First Class Mail, and Parcel Post, these are safest.
  • You are required to be running the USPS Live Server, it won't work otherwise.
  • New registered users will not need to enter a password in the password field, if you have one, great, I believe you don't need it.
  • Replace ALL files and follow the instructions even with VM's 1.10 module, this might mean you have to reenter your info
  • Since V1.06, you don't need to modify your english.php file.
  • Also, Since V1.06, just replace the usps.php file and modify your USPS settings as the order of shipping options has changed.
[/list]

I will be ignoring the other thread and it should be locked.  Please post here if you are having a problem with the module, NOT IF YOU DO NOT SEE IT DISPLAYED WHEN CHECKING OUT, you have something configured incorrectly inside of VM.  Most problems now will only entail the "white screen of death" meaning your template that you are accustomed to, won't display when bringing up the USPS shipping method.  If you are having a problem, please post here with SPECIFIC information on the problem, ie:

  • What problem are you having.
  • What is the total weight of the items in the cart.
  • What is the address you are shipping too (city, state, country, zip, etc.).
  • Any other pertinent information that might be relevant to troubleshooting.

Latest File will always be posted in the first message in this thread.  I would expect that Soeren will include the latest version with the next version released.

Thanks,

Corey

UPDATE: V3.0 with International fixes now posted.  Instructions included in the zip file.

* VM-USPS-6-20-07.zip (9.28 KB - downloaded 2020 times.)
« Last Edit: June 26, 2007, 19:39:00 PM by koltz » Logged
infuze
Newbie
*
Posts: 14


« Reply #1 on: August 30, 2006, 16:08:23 PM »

I downloaded the zip file and followed the installation instructions, but in testing, I get the following error every time I reach the shipping methods page of the checkout:

Error: <span class="message">USPS was not able to process the Shipping Rate Request.</span><br/>Error Code: -2147218046<br/>Error Description: Invalid Country Name<br/>

(It then displays the shipping options from the standard shipping module--which it shouldn't do, because that module is unpublished).

I know this was a problem in the previous version, but I assumed it was fixed in the update.  I even tried downloading the patch again and trying the whole installation process a second time.  No luck. 

I tried different several weights and two different US addresses (one in NE & one in TX), but the result is always the same error message.

I managed to get domestic shipping working with a v1 hack (found here: http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=20093.0), but the hack broke the international shipping.  And I do need to have international shipping available.

Thanks in advance for any assistance.
Logged
koltz
Sr. Member
****
Posts: 301


« Reply #2 on: August 30, 2006, 20:36:37 PM »

Error: <span class="message">USPS was not able to process the Shipping Rate Request.</span><br/>Error Code: -2147218046<br/>Error Description: Invalid Country Name<br/>
Honestly the reason the other one works is because it isn't looking for you to be in the United States, at the bottom of the thread, as I said, I needed to add the line back for verification.  What this sounds like is that Joomla or VM backend for your country isn't setup properly.  This module pulls the from address from there, so I don't think you have everything setup yet as it should.

Corey
Logged
infuze
Newbie
*
Posts: 14


« Reply #3 on: August 31, 2006, 11:56:00 AM »

Got it...

For some reason, virtuemart.cfg.php was defaulting to not allowing selection of State/Province .

(line 93 was set to: define('CAN_SELECT_STATES', '');
when it should have been set to: define('CAN_SELECT_STATES', '1'); 

Because the server was not detecting a state, it was throwing an error. 

Once I fixed this problem in the config, and added the state to the test ship-to address, everything worked great.

Thanks for the assistance, koltz.
« Last Edit: September 13, 2006, 16:38:30 PM by infuze » Logged
koltz
Sr. Member
****
Posts: 301


« Reply #4 on: August 31, 2006, 13:07:38 PM »

No problem, hopefully others will read this also as I know I have seen others posting about it also, so maybe this will help them also.

Corey
Logged
boogiebobsrecords
Newbie
*
Posts: 11


« Reply #5 on: September 12, 2006, 16:22:01 PM »

issues with some state/Province/Region not functioning:

Western Australia does not show shipping choices, "Please select a shipping Method" and the rest of the module is blank.

How many other international countries have this issue ?

Change made by customer to Hidden Valley, Western Australia entered as city and Australian Capital (first choice from drop down menu) selected and it works this why.

What is wrong with Western Australia ?

How many others are ?

Please advise,
Boogiebobs Records
Logged
koltz
Sr. Member
****
Posts: 301


« Reply #6 on: September 12, 2006, 16:28:40 PM »

Is it a new province or something that has recently changed?  This sounds like VM more than the USPS module since it sounds like it isn't being pulled from VM.  To test, you could try the UPS module and see if it does the same.

As for why, when you are creating something like this by volunteers, there are bound to be problems.  As for problems with International Shipping and this module (based on weight and shipping options available), I would say there probably are some.  Why, because I volunteered my time to fix the module so it was usable by myself and others and I don't have time to read every little instance and change in the USPS International shipping book.

Corey
Logged
boogiebobsrecords
Newbie
*
Posts: 11


« Reply #7 on: September 12, 2006, 16:46:30 PM »

no it is not new. It's just not functioning.

I was not meaning to sound upset, I just wanted to know why it was a problem.

I called USPS API tech support and they said it was something in the xml code in the cart.

Problem is that once a customer enters in something like this and the cart does not recognize it then the customer can not check out and this is an issue.

If this is just one instance, I was wondering how many other there were.

Are you saying I have to manually test each one to see if they work ?
I guess my feeling is that they should work if they are installed in the cart and is something a user should not have to worry about.

I apologize if I sounded rude, but I was just trying to find a solution or get some answers...
Logged
boogiebobsrecords
Newbie
*
Posts: 11


« Reply #8 on: September 12, 2006, 16:49:05 PM »

I can take several hours and disable all of them in my cart, but would doing this somehow cause insufficient information to be passed along to linkpoint for payment processing ?

thx,
BB
Logged
koltz
Sr. Member
****
Posts: 301


« Reply #9 on: September 12, 2006, 16:56:18 PM »

But nothing with the USPS module puts in that information.  As you mentioned if they entered adding the item to the city (?) and selecting something else worked for him, the item that gets selected is entered into VM, not this USPS module.  It pulls it from VM.  It also pulls the zip code and all other pertinent information that makes this module work. The XML code is created by the USPS module, but it still needs to pull the information that USPS requires to respond correctly.

As for just working, Soeren is one man with some help.  I am sure he has help and most of this information is available, but like anybody, you have so much time.  Now he is releasing his product as open source allowing people to use his code to make it better and help with bugs.  That is what open source is about.  A commercial product you should expect to be 100% working, but again, that isn't always going to happen.  But, when you do find a bug, it should be taken care of accordingly.  It is very hard to test every country, with every state/province, for every shipping source available, and without doing it fulltime, there would need to be a way to pay for expenses.  That is why most good shopping carts are expensive.

My suggestion is if you know this is a bug and your customer is willing to help, look in the country/province area, add this problem area accordingly and test it out until it works properly.  Submit the change to Soeren.  Or submit this in the bug tracker which Soeren looks at.

Corey
Logged
weatherangel
Newbie
*
Posts: 36


Just another geek doing the greater good...


WWW
« Reply #10 on: September 21, 2006, 11:57:35 AM »

For those people needing to test for the first time, I'm going to ask that Koltz add this to the script so it can be automated in, but basically, call these two functions and you should get good test results back from the USPS servers.  A test mode should be added in at some point to allow for this to be done in an automated fashion, but I don't have time at the moment.

In short, add this code to the bottom of your USPS script, before the closing of the class:

Code:
// The following test cases can be found on the USPS website here:
// http://www.usps.com/webtools/htm/Rates-Calculatorsv1-0.htm

function testAPI1($usps_username,$usps_password ='')
{
ob_start();
<RateV2Request USERID="$usps_username">
     <Package ID="0">
          <Service>PRIORITY</Service>
          <ZipOrigination>10022</ZipOrigination>
          <ZipDestination>20008</ZipDestination>
          <Pounds>10</Pounds>
          <Ounces>5</Ounces>
          <Container>Flat Rate Box</Container>
          <Size>REGULAR</Size>
     </Package>
</RateV2Request>
$test1 = ob_get_contents();
ob_end_clean();
return $test1;
}
function testAPI2($usps_username,$usps_password ='')
{
ob_start();
<RateV2Request USERID="$usps_username">
<Package ID="0">
          <Service>All</Service>
          <ZipOrigination>10022</ZipOrigination>
          <ZipDestination>20008</ZipDestination>
          <Pounds>10</Pounds>
          <Ounces>5</Ounces>
          <Size>LARGE</Size>
          <Machinable>TRUE</Machinable>
     </Package>
</RateV2Request>
ob_end_clean();
$test2 = ob_get_contents()
return $test2;
}

I have an old version of the USPS module, so my line numbers are not going to match the latest code set, however around line 158 you should find:
Code:
if( ($dest_country = "USA" || $dest_country = "US") && in_array($dest_state,$states) )
{
/******START OF DOMESTIC RATE******/
//the xml that will be posted to usps
$xmlPost = 'API=RateV2&XML=<RateV2Request USERID="'.$usps_username.'" PASSWORD="'.$usps_password.'">';
$xmlPost .= '<Package ID="'.$usps_packageid.'">';
$xmlPost .= "<Service>".$shpService."</Service>";
$xmlPost .= "<ZipOrigination>".$source_zip."</ZipOrigination>";
$xmlPost .= "<ZipDestination>".$dest_zip."</ZipDestination>";
$xmlPost .= "<Pounds>".$shipping_pounds."</Pounds>";
$xmlPost .= "<Ounces>".$shipping_ounces."</Ounces>";
$xmlPost .= "<Size>".$usps_packagesize."</Size>";
$xmlPost .= "<Machinable>".$usps_machinable."</Machinable>";
$xmlPost .= "</Package></RateV2Request>";

Just below the above section, add the lines to call your XML Tests.  Until an actual front end is put to this, you will need to uncomment the tests one at a time.

Code:
// Here would be a great place to check to see if we're in test mode, and to use the two
// hardcoded XML tests if necessary.

// if ($test_mode) {
    $xmlPost = $this->testAPI1($usps_username,$usps_password);
//}
//
// if ($test_mode_2) {
//    $xmlPost = $this->testAPI2($usps_username,$usps_password);
//}


I hope this helps the newbies!

Ilene
Logged
FidelGonzales
Sr. Member
****
Posts: 472


WWW
« Reply #11 on: September 21, 2006, 13:47:03 PM »

I just upgraded to the latest 1.0.7 version of Virtuemart. Is this the same module integrated into the latest version? Either way, it is not displaying upon checkout. Any clues as to the problem? Thank you.
Logged

VIRTUEMART EXPERT - John Messingham - http://www.JMDS.eu
WEB | PHOTO | WRITE | MARKETING | DESIGN - http://www.DIRTFORGE.com
410media.com
Newbie
*
Posts: 3


« Reply #12 on: September 24, 2006, 23:47:12 PM »

OK, so I have the module installed and it works great.  I would like to set up the shop so that I can sell both physical items that require a shipping cost and downloads that do not. 

I thought if I set the weight of the downloads to zero that would do the trick, but it doesn't.  If I put in just a download item in my cart, I get the screen to pick a shipping method with no options and can't move forward.  Physical items work perfectly.

Please help me if you can.

Thanks-

Dave
Logged
koltz
Sr. Member
****
Posts: 301


« Reply #13 on: September 25, 2006, 04:43:41 AM »

Weatherangel, thanks for the post, will look over the code and see if I can get it integrated into the module. Got your PM, just been real busy.

Fidel, the problem ISN'T with the module, backend configuration problem.  Sorry, I closed the other thread because of posts like this, which this thread isn't for.  If it isn't displaying at all, check to make sure everything is setup properly.

410media, have no clue, the problem isn't with the module again as it is doing exactly what it is supposed to do.  I believe it can be done, but I don't have downloadable content and think this is configured externally in the backend.  I would post this question seperately in it's own thread or search, as I am sure others have had this problem.

Corey
Logged
sadesigns
Newbie
*
Posts: 10


« Reply #14 on: September 26, 2006, 00:08:19 AM »

I need to get USPS working desperately and I tried the usps module in this thread but I get an error after checkout. I registered for Webtools and changed it to live server but this is the error I get..


Code:
Error: <span class="message">USPS was not able to process the Shipping Rate Request.</span><br/>Error Code: -2147219080<br/>Error Description: Missing value for Country.<br/>

if anyone can help Id really appreciate it!
Logged
Pages: [1] 2 3 ... 31   Go Up
Print
Jump to: