- a USPS module for osCommerce 2.2/2.3
- Til Luchau (http://advanced-trainings.com)
- Anonymous Sponsor #1
- Aedea Innovations Inc.
- Evanay Solutions Ltd.
- always backup files and database before performing installation or upgrade operations
- uninstall current USPS module if installed (and it is a good idea to take note of the pre-existing values)
- copy files over to their corresponding paths
- it may be necessary in
admin/modules.php
to add some code to support arrays, around line 45: look for
if (tep_not_null($action)) {
switch ($action) {
case 'save':
..and change to this:
if (tep_not_null($action)) {
switch ($action) {
case 'save':
$module_name = '';
// detect custom modules..
if( array_key_exists('MODULE_SHIPPING_USPS_STATUS', $HTTP_POST_VARS['configuration']) ){
$module_name = 'usps';
}
then, shortly after, look for
while (list($key, $value) = each($HTTP_POST_VARS['configuration'])) {
tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $value . "' where configuration_key = '" . $key . "'");
}
..and change to this:
while (list($key, $value) = each($HTTP_POST_VARS['configuration'])) {
switch( $module_name ) {
case 'usps':
/*
* TODO: review
* USPS Methods
*/
if( is_array( $value ) ){
$value = implode( ", ", $value);
$value = ereg_replace (", --none--", "", $value);
}
/*
* /end
*/
break;
}
tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $value . "' where configuration_key = '" . $key . "'");
}
- Brad Waite
- Fritz Clapp
- Greg Deeth
- Kevin L Shelton
- Evan Roberts ([email protected])
- John Ny
- code cleanup
- field for (tm) / (r) symbols so that they can easily be updated if USPS decides to change the format again
- refactoring (code is rather scary right now..)