lastdual Posted April 8, 2005 Share Posted April 8, 2005 (edited) 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 April 8, 2005 by lastdual Quote Link to comment Share on other sites More sharing options...
lastdual Posted April 8, 2005 Author Share Posted April 8, 2005 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... Quote Link to comment Share on other sites More sharing options...
greykher Posted April 12, 2005 Share Posted April 12, 2005 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. Quote Link to comment Share on other sites More sharing options...
Don7Qf Posted April 12, 2005 Share Posted April 12, 2005 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. <{POST_SNAPBACK}> 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. Quote Link to comment Share on other sites More sharing options...
greykher Posted April 12, 2005 Share Posted April 12, 2005 Ok, the /* and */ pair are just php comment designation for a block of code, so php won't process the code between them. For a single line comment, you start the comment with // and the comment ends when the line ends. Quote Link to comment Share on other sites More sharing options...
Don7Qf Posted April 12, 2005 Share Posted April 12, 2005 Before I read this thread I first tried to comment out the international options I didn't want, but they still appeared. Now after this step the whole array is gone. What am I doing wrong? Quote Link to comment Share on other sites More sharing options...
greykher Posted April 13, 2005 Share Posted April 13, 2005 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. Quote Link to comment Share on other sites More sharing options...
Don7Qf Posted April 13, 2005 Share Posted April 13, 2005 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 Quote Link to comment Share on other sites More sharing options...
Don7Qf Posted April 13, 2005 Share Posted April 13, 2005 **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. Quote Link to comment Share on other sites More sharing options...
lrobbin Posted April 13, 2005 Share Posted April 13, 2005 //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 <{POST_SNAPBACK}> 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 Quote lrobbin Lisa M. Robbin the giving candle Link to comment Share on other sites More sharing options...
Don7Qf Posted April 13, 2005 Share Posted April 13, 2005 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. :'( Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.