Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Heads Up: July 28, 2013 USPS Name Change for Express Mail


krdito

Recommended Posts

*** WARNING *** This WILL be cross posted for clarification across ALL USPS shipping module threads.

 

There are, for all intent and purpose, TWO different modules, 2 very different modules. One of those modules has morphed itself 3 times in the ADD-ON section of osCommerce.com/info/xxxx

 

When posting to any USPS module thread PLEASE state which osC vX.X.X as well as which USPS module you are using. If you are unsure what version of the USPS module you are currently using, PLEASE paste the first few lines of /catalog/includes/modules/shipping/usps.php file here so maybe we can help you make the determination.

 

Here is my take on the module morphing:

http://addons.oscommerce.com/info/8327

USPS Rate V4 Intl Rate V2 - v.1.0

at some point was set to NOT allow uploads to the module, essentially closing it to further updates.

this morphed into:

http://addons.oscommerce.com/info/8403

USPS Rates ServerV4 (for osc2.2)

which also at some point was set to NOT allow uploads to the module, essentially closing it to further updates.

this then morphed into:

http://addons.oscommerce.com/info/8702

USPS Methods Rates V4 Intl Rates V2 - 01-27-13 Update

this one is being currently maintained, within thread http://www.oscommerce.com/forums/topic/383307-usps-rate-v4-intl-rate-v2-official-support-thread albeit with some errors still in regards to First Class rates and handling fees. See post #748 above for that: http://www.oscommerce.com/forums/topic/383307-usps-rate-v4-intl-rate-v2-official-support-thread/page__st__740#entry1678247

 

The second module is:

http://addons.oscommerce.com/info/487

USPS Methods

This one is being maintained within the ADD-ON section and within thread

http://www.oscommerce.com/forums/topic/146950-contribution-usps-methods/ HOWEVER there are MANY MANY updates there.. 5.2.x 6.x and now 5.3

 

There is at least one further active USPS module thread:

http://www.oscommerce.com/forums/topic/393466-heads-up-july-28-2013-usps-name-change-for-express-mail/

Heads Up: July 28, 2013 USPS Name Change for Express Mail

which is mostly referring to the USPS Methods module #487 with some cross posting going on there as well.

 

So there you have it.. please lets try and post to the proper thread and let everyone know what you are using so we can best help you!

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

Link to comment
Share on other sites

Evan, I replied to this post within the proper thread, if you would please look there.. thanks!

 

http://www.oscommerce.com/forums/topic/146950-contribution-usps-methods/#entry1678317

 

 

Just uploaded 5.3.0:

- fixed handling rates not being added

- fixed processing time not being added to estimates

- added field to specify delivery times in lieu of estimate provided by USPS

 

http://addons.oscommerce.com/info/487

 

Let me know if there are any issues. Also feel free to contribute / watch on github:

https://github.com/Evan-R/USPS-osCommerce

 

Cheers,

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

Link to comment
Share on other sites

Even... dang it.. that won't fix USPS Rate V4, Intl Rate V2, but it might just fix my clients osC v2.5.. but before I get there.. looking at the file differences.. I see you made use of "print_r" - I assume to see the TURE output.. I was just told about that but didn't know where or how.. so I assume you uncomment those lines and directly call the usps.php module file??

 

Looking thru your version indeed it looks like you plopped in the handling charges in all the appropriate places..

 

 

BUT it also appears the files does NOT have the ending ?> Can you verify that?

 

zend recommends not adding the ending ?> tag for php files, that's why it was removed ;)

Link to comment
Share on other sites

@Aedealnnovations

 

Is there any chance that you can add a download of USPS Methods 5.3.0 as a zip file instead of a tar.gz? My (Windows) system does not appear to be able to unzip the tar file and I'd prefer to not add additional utilities.

 

Your indulgence would be appreciated.

 

Thanks,

GEORGE

Link to comment
Share on other sites

@Aedealnnovations

 

Is there any chance that you can add a download of USPS Methods 5.3.0 as a zip file instead of a tar.gz? My (Windows) system does not appear to be able to unzip the tar file and I'd prefer to not add additional utilities.

 

Your indulgence would be appreciated.

 

Thanks,

GEORGE

 

You can download the files in .zip format on github:

https://github.com/Evan-R/USPS-osCommerce/releases

Link to comment
Share on other sites

 

 

zend recommends not adding the ending ?> tag for php files, that's why it was removed ;)

 

well..... I'm no php genius but that just sounds like a bad recommendation/practice to me..

 

call me old school.. interesting read.. but I am still gonna use it :-)

http://blog.rogeriopvl.com/archives/php-files-closing-the-php-tag-or-not/

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

Link to comment
Share on other sites

 

 

Thanks, Evan

GEORGE

In case you run into that again, download WinRAR. It's unencumbered shareware and all you have to put up with on a permanent basis is a tiny small popup that asks you to purchase the license. Click close and you still have full functionality. It handles every compressed file known to man, including CD/DVD image files. I've used it for over 15 yrs.
Link to comment
Share on other sites

In case you run into that again, download WinRAR. It's unencumbered shareware and all you have to put up with on a permanent basis is a tiny small popup that asks you to purchase the license. Click close and you still have full functionality. It handles every compressed file known to man, including CD/DVD image files. I've used it for over 15 yrs.

Thanks, Tom - I'll give it a try.

GEORGE

Link to comment
Share on other sites

I have read through all of the posts and I have complete uninstalled the USPS module (USPS Methods 6.1.c), checked my DB to ensure all USPS entries were gone, and then completely reinstalled.

 

Good News: My domestic shipping options are working beautifully.... thank you everyone for updates. I can now support domestic customers.

Bad News: I still can not get international shipping to work.

 

I have run the USPS_methods_utility.php to ensure the shipping options within my DB match that which is being returned by USPS. Perhaps I am missing a post somewhere that further explains the resolution for the failure of international options. The error I see continues to be: "An error occurred with the USPS shipping calculations. If you would like to use USPS as your shipping method, please contact the store owner."

 

If anyone can point me to additional troubleshooting options that have worked for others, I would be extremely grateful!

 

Thanks,

Dave

Anthony David

AllThingsTrendy.com

Link to comment
Share on other sites

I got the USPS module working, but now when I go to order editor I get this error

 

"$ShipmentRateDetail$ShipmentRateDetail Fatal error: Call to undefined function tep_round_up() in /my catalog/includes/modules/shipping/usps.php on line 357"

What do I need to do to fix?

Here is line 357

$shipping_ounces = tep_round_up((16 * ($shipping_weight - floor($shipping_weight))), 2);

 

I posted this in the USPS Methods contribution thread, but no response. Thought I would try here.

Link to comment
Share on other sites

That function should be in catalog/includes/functions/general/. If it's not, here's the code:

 

// Round up function for non whole numbers by GREG DEETH
// The value for the precision variable determines how many digits after the decimal and rounds the last digit up to the next value
// Precision = 0 -> xx.xxxx = x+
// Precision = 1 -> xx.xxxx = xx.+
// Precision = 2 -> xx.xxxx = xx.x+
function tep_round_up($number, $precision) {
$number_whole = '';
$num_left_dec = 0;
$num_right_dec = 0;
$num_digits = strlen($number);
$number_out = '';
$i = 0;
while ($i + 1 <= strlen($number))
{
$current_digit = substr($number, $i, ($i + 1) - $num_digits);
if ($current_digit == '.') {
$i = $num_digits + 1;
$num_left_dec = strlen($number_whole);
$num_right_dec = ($num_left_dec + 1) - $num_digits;
} else {
$number_whole = $number_whole . $current_digit;
$i = $i + 1;
}
}
if ($num_digits > 3 && $precision < ($num_digits - $num_left_dec - 1) && $precision >= 0) {
$i = $precision;
$addable = 1;
while ($i > 0) {
$addable = $addable * .1;
$i = $i - 1;
}
$number_out = substr($number, 0, $num_right_dec + $precision) + $addable;
} else {
$number_out = $number;
}
return $number_out;
}

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

That function should be in catalog/includes/functions/general/. If it's not, here's the code:

 

// Round up function for non whole numbers by GREG DEETH
// The value for the precision variable determines how many digits after the decimal and rounds the last digit up to the next value
// Precision = 0 -> xx.xxxx = x+
// Precision = 1 -> xx.xxxx = xx.+
// Precision = 2 -> xx.xxxx = xx.x+
function tep_round_up($number, $precision) {
$number_whole = '';
$num_left_dec = 0;
$num_right_dec = 0;
$num_digits = strlen($number);
$number_out = '';
$i = 0;
while ($i + 1 <= strlen($number))
{
$current_digit = substr($number, $i, ($i + 1) - $num_digits);
if ($current_digit == '.') {
$i = $num_digits + 1;
$num_left_dec = strlen($number_whole);
$num_right_dec = ($num_left_dec + 1) - $num_digits;
} else {
$number_whole = $number_whole . $current_digit;
$i = $i + 1;
}
}
if ($num_digits > 3 && $precision < ($num_digits - $num_left_dec - 1) && $precision >= 0) {
$i = $precision;
$addable = 1;
while ($i > 0) {
$addable = $addable * .1;
$i = $i - 1;
}
$number_out = substr($number, 0, $num_right_dec + $precision) + $addable;
} else {
$number_out = $number;
}
return $number_out;
}

 

Regards

Jim

That piece of code is in the place you said it should be, but I am still getting the error and cannot use order editor. I don't know if the usps fix messed up order editor, but it was working before. Any other suggestions?

Jim

Link to comment
Share on other sites

Are you trying to use this on the Admin side? If so, that code needs to be in admin/includes/functions/general.php.

 

Regards

Jim

 

Edit: Yes, this was a reply to @@Forestshopkeeper

Edited by kymation

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Are you trying to use this on the Admin side? If so, that code needs to be in admin/includes/functions/general.php.

 

Regards

Jim

 

Edit: Yes, this was a reply to @@Forestshopkeeper

I put the same code in the admin side general.php and order editor works again, but now I am getting a new error on the website side

 

Fatal error: Cannot redeclare tep_set_banner_status() (previously declared in /hsphere/local/home/shoppein/shoppeintheforest.com/includes/functions/general.php:713) in /hsphere/local/home/shoppein/shoppeintheforest.com/includes/functions/banner.php on line 23

 

It appears this function shows up twice, once in general.php and again in banner.php. If I remove from general.php, I get a new error for specials.php. If I remove that code from general.php, I got a new error that mentioned subcategories. How do I get my web site back?

Link to comment
Share on other sites

This sounds like you have used an Admin side file on the catalog side, or possibly the reverse. The Admin version of the included files is different from the catalog version. I suggest that you compare your files to the stock osCommerce files.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Are you trying to use this on the Admin side? If so, that code needs to be in admin/includes/functions/general.php.

 

Regards

Jim

 

Edit: Yes, this was a reply to @@Forestshopkeeper

 

Everything seems to be working except I have this line at the top of the checkout shipping page

 

$ShipmentRateDetail$ShipmentRateDetail

 

I don't know where this is coming from.

This is the first line of the page source data

 

$ShipmentRateDetail$ShipmentRateDetail<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

but I don't know where that comes from. Page source says checkout_shipping.php

Link to comment
Share on other sites

Everything seems to be working except I have this line at the top of the checkout shipping page

 

$ShipmentRateDetail$ShipmentRateDetail

 

I don't know where this is coming from.

This is the first line of the page source data

 

$ShipmentRateDetail$ShipmentRateDetail<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

but I don't know where that comes from. Page source says checkout_shipping.php

I have both the admin side and the cart side working now except for the "$ShipmentRateDetail$ShipmentRateDetail" line shows up on everthing dealing with shipping. I don't know where it comes from. Looks like an echo, but I don't know where. Can you help? I don't think I reversed anything, just added the round_up code to the admin side general.php. Things are coming back, but I don't know how to get rid of that line.

Jim

Link to comment
Share on other sites

That looks like some PHP code that's outside of the PHP tags. Search your files for $ShipmentRateDetail that's out of place, such as before the <?php or after the ?>.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

That looks like some PHP code that's outside of the PHP tags. Search your files for $ShipmentRateDetail that's out of place, such as before the <?php or after the ?>.

 

Regards

Jim

I looked at all the files I have been in before this started and searched for the offending string. I am not finding. I ran the entire website through GREP and did not find that particular phrase. Is it something coming back from USPS in relation to the new USPS.php module?

That looks like some PHP code that's outside of the PHP tags. Search your files for $ShipmentRateDetail that's out of place, such as before the . Regards Jim
Link to comment
Share on other sites

It has to be in there somewhere. Check all of the files, not just the ones you remember changing.

 

Regards

Jim

I ran the entire website through greb and it did not find that string. I believe it to be coming back from the post office. I just uninstalled USPS and then reloaded the July fix and then reinstalled and I still get the same on any page shipping related.

Jim

Link to comment
Share on other sites

The form of that string looks like a PHP variable. The location indicates it's in one of the include files, probably in a module.

 

USPS returns an XML string, and nothing in that string looks like what you are seeing. Are you certain you have covered all of the files on your site? I'm running out of ideas here.

 

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