Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

USPS Priority Mail Only


lastdual

Recommended Posts

Hi,

 

I noticed another thread for shipping ups ground only. I would like to set up my usps module to only do Priority Mail. Anyone know what modifications I would need to make in order to do this? Thanks

Edited by lastdual
Link to comment
Share on other sites

Alternately, if there was simply a way I could disable First Class Mail, that would be good enough.

 

My product is light enough to meet FC standards, but the dimensions of the the actual product are too large for it. I can't seem to find a way to set the actual dimensions of the product, so right now USPS offers First Class even though I can't ship that way...

Link to comment
Share on other sites

To make USPS only use priority, open /includes/modules/shipping/usps.php and find this code:

 

   $this->types = array('Express' => 'Express Mail',
                          'First Class' => 'First-Class Mail',
                          'Priority' => 'Priority Mail',
                          'Parcel' => 'Parcel Post');

 

comment out this line (hey, you never know when you might need it back!), and change to:

 

/* original code
  $this->types = array('Express' => 'Express Mail',
                          'First Class' => 'First-Class Mail',
                          'Priority' => 'Priority Mail',
                          'Parcel' => 'Parcel Post');
*/ end original code

//new code Priority Mail only
 $this->types = array('Priority' => 'Priority Mail');
//end new code

 

If you are shipping internationally, you'll need to change the $this->intl_types array also.

Link to comment
Share on other sites

To make USPS only use priority, open /includes/modules/shipping/usps.php and find this code:

 

 ? $this->types = array('Express' => 'Express Mail',
? ? ? ? ? ? ? ? ? ? ? ? ? 'First Class' => 'First-Class Mail',
? ? ? ? ? ? ? ? ? ? ? ? ? 'Priority' => 'Priority Mail',
? ? ? ? ? ? ? ? ? ? ? ? ? 'Parcel' => 'Parcel Post');

 

comment out this line (hey, you never know when you might need it back!), and change to:

 

/* original code
? $this->types = array('Express' => 'Express Mail',
? ? ? ? ? ? ? ? ? ? ? ? ? 'First Class' => 'First-Class Mail',
? ? ? ? ? ? ? ? ? ? ? ? ? 'Priority' => 'Priority Mail',
? ? ? ? ? ? ? ? ? ? ? ? ? 'Parcel' => 'Parcel Post');
*/ end original code

//new code Priority Mail only
?$this->types = array('Priority' => 'Priority Mail');
//end new code

 

If you are shipping internationally, you'll need to change the $this->intl_types array also.

 

 

Hello greykher.

I need similar help with usps international shipping (I only want Economy Parcel

 

Post, Global Priority Mail and Global Express Mail). How would I edit that array?

 

And do I actually type "/* original code....*/end original code"? Sorry, newbie here.

Link to comment
Share on other sites

Without seeing the code you're using, I can't really say what's wrong, but the code should be similar to the domestic USPS code change I posted above, with the original code commented out, and a copy of the original array, with only the options you want:

 

/* original code
     $this->intl_types = array('GXG Document' => 'Global Express Guaranteed Document Service',
                               'GXG Non-Document' => 'Global Express Guaranteed Non-Document Service',
                               'Express' => 'Global Express Mail (EMS)',
                               'Priority Lg' => 'Global Priority Mail - Flat-rate Envelope (large)',
                               'Priority Sm' => 'Global Priority Mail - Flat-rate Envelope (small)',
                               'Priority Var' => 'Global Priority Mail - Variable Weight Envelope (single)',
                               'Airmail Letter' => 'Airmail Letter Post',
                               'Airmail Parcel' => 'Airmail Parcel Post',
                               'Surface Letter' => 'Economy (Surface) Letter Post',
                               'Surface Post' => 'Economy (Surface) Parcel Post');
*/
//new code
     $this->intl_types = array('Express' => 'Global Express Mail (EMS)',
                               'Priority Lg' => 'Global Priority Mail - Flat-rate Envelope (large)',
                               'Priority Sm' => 'Global Priority Mail - Flat-rate Envelope (small)',
                               'Priority Var' => 'Global Priority Mail - Variable Weight Envelope (single)',
                               'Surface Post' => 'Economy (Surface) Parcel Post');
// end new code

 

I didn't know which Priority option you wanted to keep, but instead of trying to comment out an option inside the array (which, as you discovered, you cannot do), simply delete them from the new code. If you need to add one back in, copy it in from the original, and make sure a comma seperates the entries in the array.

Link to comment
Share on other sites

Here's my code:

 

/* original code

$this->intl_types = array('GXG Document' => 'Global Express Guaranteed Document Service',

'GXG Non-Document' => 'Global Express Guaranteed Non-Document Service',

'Express' => 'Global Express Mail (EMS)',

'Priority Lg' => 'Global Priority Mail - Flat-rate Envelope (Large)',

'Priority Sm' => 'Global Priority Mail - Flat-rate Envelope (Small)',

'Priority Var' => 'Global Priority Mail - Variable Weight Envelope (Single)',

'Airmail Letter' => 'Airmail Letter-Post',

'Airmail Parcel' => 'Airmail Parcel Post',

'Surface Letter' => 'Economy (Surface) Letter-Post',

'Surface Post' => 'Economy (Surface) Parcel Post');

*/ end original code

 

//new code

$this->intl_types = array('Express' => 'Global Express Mail EMS)',

'Airmail Parcel' => 'Airmail Parcel Post',

'Surface Post' => 'Economy (Surface) Parcel Post');

// end new code

 

But I get this message:

Parse error: parse error, unexpected T_STRING in .../catalog/includes/modules/shipping/usps.php on line 61

Link to comment
Share on other sites

**correction** - In the line

//new code

$this->intl_types = array('Express' => 'Global Express Mail EMS)',

the opening parenthesis "(" for EMS is part of my code. Must've made a mistake when posting. The previous problem is still exists though.

Link to comment
Share on other sites

//new code   

        $this->intl_types = array('Express' => 'Global Express Mail EMS)',                             

                                                        'Airmail Parcel' => 'Airmail Parcel Post',                                               

                                                        'Surface Post' => 'Economy (Surface) Parcel Post');

// end new code

 

But I get this message:

Parse error: parse error, unexpected T_STRING in .../catalog/includes/modules/shipping/usps.php on line 61

It looks like extra parens at the end of your 'global express' and "economy' lines may be stopping this from running properly. I'm no code expert, so feel free to get a second opinion. :D

-Lisa

lrobbin

Lisa M. Robbin

the giving candle

Link to comment
Share on other sites

Okay I fixed the parse error.

It seems it was the */ end original code comment that caused it.

So by simply omitting end original code the page was able to load.

However, all of the international options still appear at checkout. :'(

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...