Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Problem with USPS shipping module


orbitasdelamor

Recommended Posts

Okay, so I'm kind of new to this.

 

I've edited the usps module so that flat rate envelopes and boxes do not appear under the shipping options. Here is my code:

 

// Domestic types in request do not match MailService elements in response. There are multiple MailServices to 

each type.
// We query these individually. This should make usps_method integration easier
// in the mean time, comment out the unwanted ones
     $this->types = array(	
//            'Express' => 'Express Mail',
    	 'First Class' => 'First Class Mail',
    	 'Priority' => 'Priority Mail',
//     	 'Parcel' => 'Parcel Post',
//     	 'BPM' => 'Bound Printed Matter',
//     	 'Library' => 'Library Mail',
//     	 'Media' => 'Media Mail'
    	 );

     // make queries for these specific package types, as well as none
     $this->containers = array (	'Express'  => array(''),
             'Priority' => array(''));

 

And this is what is showing up at the top of the page:

Array ( [0] => ) Array ( [0] => [1] => )

 

Anyways, does anyone have a solution to this? I have no idea what I did wrong.

Link to comment
Share on other sites

The array code looks fine. I wonder if the connection from your site to usps.com is failing and return a null value. The two array values being printed appear null. Sorry can't debug this one remotely.

 

Tom

Link to comment
Share on other sites

Okay, so I'm kind of new to this.

 

I've edited the usps module so that flat rate envelopes and boxes do not appear under the shipping options.  Here is my code:

 

// Domestic types in request do not match MailService elements in response. There are multiple MailServices to 

each type.
// We query these individually. This should make usps_method integration easier
// in the mean time, comment out the unwanted ones
     $this->types = array(	
//            'Express' => 'Express Mail',
    	 'First Class' => 'First Class Mail',
    	 'Priority' => 'Priority Mail',
//     	 'Parcel' => 'Parcel Post',
//     	 'BPM' => 'Bound Printed Matter',
//     	 'Library' => 'Library Mail',
//     	 'Media' => 'Media Mail'
    	 );

     // make queries for these specific package types, as well as none
     $this->containers = array (	'Express'  => array(''),
             'Priority' => array(''));

 

And this is what is showing up at the top of the page:

Array ( [0] => ) Array ( [0] => [1] => )

 

Anyways, does anyone have a solution to this?  I have no idea what I did wrong.

 

 

Since you commented out the Express Mail, I think you need the following lines

 

// make queries for these specific package types, as well as none
     $this->containers = array (	'Express'  => array('Flat Rate Envelope'),
             'Priority' => array('Flat Rate Box'));

 

to be

 

 // make queries for these specific package types, as well as none
     $this->containers = array (	'Priority' => array('Flat Rate Box');

 

 

Since you commented out Express Mail, you are calling an invalid pointer in the above array. However, this is just a guess, as I offer Express Mail, and am not going to change my code on the server to test it.

 

HTH

GEOTEX from Houston, TX

 

(George)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...