Jump to content
Latest News: (loading..)
kymation

[Development] USPS Shipping Module

Recommended Posts

Just a note for people use the older MS2.2 / Rc2a USPS V4 module there are service name changes to Domestic you will need to make changing Standard Post to Retail Ground.  It will be in several places in the code.

 

Uninstall and reinstall to test.   Don't forget to keep your USPS ID to add back when you reinstall.

 

See https://www.usps.com/business/web-tools-apis/2016-jan-webtools-release-notes.rtf

 

Other changes (Flat Rate boxes as a container) do not seem to impact the old module.

 

Switch your current module to $usps_server = 'stg-production.shippingapis.com' to test impact


Kym

Projects Director @ ozEworks.com

Share this post


Link to post
Share on other sites

I only see one spot where it needs to change:

this is what I am using:

/*
USPS Rate V4 Intl Rate V2 - v.1.7
  $Mod: Changed from Parcel Post to Standard Post 20130129 Kymation $
  $Mod: USPS API changes 20130729 Kymation v 1.3 $
 
Copyright (c) 2012 osCbyJetta
Released under the GNU General Public License
*/
 
and on line 269 I see:
         } elseif ($request_type == 'Standard PostRM') {
            $service = 'PARCEL';
thats the only instance.. should there be more??
 
And if I make the change prior to the switch on the 17th will the module still work now?

Debbie D
Franklin County, VA "Moonshine Capitol of the World"
osCmax Mobile Template oscmaxtemplates.com

Share this post


Link to post
Share on other sites

@@FlyingKites @@wkdwich This thread is for discussion of the new USPS Codes module. Please move your discussion of other modules to the appropriate support thread, just to prevent confusion.

 

Thanks

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

@@FlyingKites @@wkdwich This thread is for discussion of the new USPS Codes module. Please move your discussion of other modules to the appropriate support thread, just to prevent confusion.

 

Thanks

Jim

Sorry I will


Kym

Projects Director @ ozEworks.com

Share this post


Link to post
Share on other sites

Hi Jim, 

 

Just curious what is left on your todo list for this module before it becomes a full release?  Insurance provisions working? I'm going to get it up on my dev site again tomorrow and do some testing with it.

Share this post


Link to post
Share on other sites

There are some bugs related to one of the USPS changes. They have been making so many of those that I haven't kept up.

 

Basically, domestic shipping works. Most of the options work, if not all. I have a version with international mostly working, but that is still not finished.

 

Life keeps getting in the way.

 

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

Heya Jim,

Still working on this much at all, or kinda letting it go?

I have kind of a special need that could be solved by having a second USPS module for per-zone application, and rather than trying to rename/duplicate an ancient module...

 

Share this post


Link to post
Share on other sites

It kinda got killed by the USPS. I was depending on the "all" request to get a list of available services. Then the USPS decided to limit 'all' to only the first 20 or so. The module works, but you get a semi-random selection of services to choose from. Probably not worth your time.

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

Hey Jim, 

In chasing my need, I've duplicated the (outdated, I know) USPS module I've been using.  It installs fine, including the defaults for package dimensions, so I've had partial success with it. However, it seems everytime I try to save settings in the admin, I get "Array" in 'package dimensions' and 'handling fees'.  To clone it, I took the working USPS module files and duplicated them and renamed them.  There were only 2 files: usps.php for the modules/shipping, and the same for the languages directory.  Then I found every 'usps' and changed it to 'usps2'...constants, functions, variables, etc., along with filenames.  I've put the old and new in WinMerge and ensured that the only differences are the aforementioned.  Any idea what I might have missed?  I think these are the functions associated with the problem:

 

// Required configuration functions
// USPS Methods.  Added by Greg Deeth

// Alias function for Store configuration values in the Administration Tool
function usps2_cfg_select_multioption($select_array, $key_value, $key = '') {
	for ($i=0; $i<sizeof($select_array); $i++) {
		$name = (($key) ? 'configuration[' . $key . '][]' : 'configuration_value');
		$string .= '<br /><input type="checkbox" name="' . $name . '" value="' . $select_array[$i] . '"';
		$key_values = explode( ", ", $key_value);
		if ( in_array($select_array[$i], $key_values) ) $string .= ' CHECKED';
		$string .= '> ' . $select_array[$i];
	}
	$string .= '<input type="hidden" name="' . $name . '" value="--none--">';
	return $string;
}

// Alias function for Store configuration values in the Administration Tool.
function usps2_cfg_multiinput_list($select_array, $key_value, $key = '') {
	$key_values = explode( ", ", $key_value);

	for ($i=0; $i<sizeof($select_array); $i++) {
		$name = (($key) ? 'configuration[' . $key . '][]' : 'configuration_value');
		$string .= '<br /><input type="text" name="' . $name . '" value="' . $key_values[$i] . '" size="7"> ' . $select_array[$i];
	}
	$string .= '<input type="hidden" name="' . $name . '" value="--none--">';
	return $string;
}

/**
 * displays a json string as a list
 *
 * @param (string) $cfg_value
 */
function usps2_cfg_display_json_as_list( $cfg_value ){
	$array = json_decode($cfg_value, true);

	$string = '<ul>';
	foreach( $array as $li ){
		$string .= '<li><pre>' . $li . '</pre></li>';
	}
	$string .= '</ul>';

	return $string;
}

 

shipping2.jpg

Share this post


Link to post
Share on other sites

You need to make the change to admin/modules.php that is mentioned in the instructions. That change handles the arrays that the module uses to store the settings.

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

Thanks, but I'm happy to answer questions that I know the answer to. And of course I know the answer because I've made the same mistake before.

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

×