Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Development] USPS Shipping Module


kymation

Recommended Posts

@@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.

Link to comment
Share on other sites

  • 4 months later...

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.

Link to comment
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.

Link to comment
Share on other sites

  • 2 years later...

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...

 

Link to comment
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.

Link to comment
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

Link to comment
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.

Link to comment
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.

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...