wkdwich Posted August 14, 2013 Share Posted August 14, 2013 *** 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! Quote Debbie DFranklin County, VA "Moonshine Capitol of the World"osCmax Mobile Template oscmaxtemplates.com Link to comment Share on other sites More sharing options...
wkdwich Posted August 14, 2013 Share Posted August 14, 2013 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, Quote Debbie DFranklin County, VA "Moonshine Capitol of the World"osCmax Mobile Template oscmaxtemplates.com Link to comment Share on other sites More sharing options...
AedeaInnovations Posted August 14, 2013 Share Posted August 14, 2013 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 ;) Quote Link to comment Share on other sites More sharing options...
GPMaina Posted August 14, 2013 Share Posted August 14, 2013 @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 Quote Link to comment Share on other sites More sharing options...
AedeaInnovations Posted August 14, 2013 Share Posted August 14, 2013 @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 Quote Link to comment Share on other sites More sharing options...
wkdwich Posted August 14, 2013 Share Posted August 14, 2013 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/ Quote Debbie DFranklin County, VA "Moonshine Capitol of the World"osCmax Mobile Template oscmaxtemplates.com Link to comment Share on other sites More sharing options...
AedeaInnovations Posted August 14, 2013 Share Posted August 14, 2013 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/ Feel free to add it if you like. Quote Link to comment Share on other sites More sharing options...
GPMaina Posted August 16, 2013 Share Posted August 16, 2013 You can download the files in .zip format on github: https://github.com/Evan-R/USPS-osCommerce/releases Thanks, Evan GEORGE Quote Link to comment Share on other sites More sharing options...
TomB01 Posted August 16, 2013 Share Posted August 16, 2013 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. Quote Link to comment Share on other sites More sharing options...
GPMaina Posted August 16, 2013 Share Posted August 16, 2013 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 Quote Link to comment Share on other sites More sharing options...
AllThingsTrendy Posted August 18, 2013 Share Posted August 18, 2013 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 Quote Anthony David AllThingsTrendy.com Link to comment Share on other sites More sharing options...
Forestshopkeeper Posted August 19, 2013 Share Posted August 19, 2013 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. Quote Link to comment Share on other sites More sharing options...
♥kymation Posted August 19, 2013 Share Posted August 19, 2013 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 Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
Forestshopkeeper Posted August 20, 2013 Share Posted August 20, 2013 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 Quote Link to comment Share on other sites More sharing options...
Forestshopkeeper Posted August 20, 2013 Share Posted August 20, 2013 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 I am assuming Kymation was talking to forestshopkeeper. Quote Link to comment Share on other sites More sharing options...
♥kymation Posted August 20, 2013 Share Posted August 20, 2013 (edited) 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 August 20, 2013 by kymation Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
Forestshopkeeper Posted August 20, 2013 Share Posted August 20, 2013 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? Quote Link to comment Share on other sites More sharing options...
♥kymation Posted August 20, 2013 Share Posted August 20, 2013 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 Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
Forestshopkeeper Posted August 20, 2013 Share Posted August 20, 2013 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 Quote Link to comment Share on other sites More sharing options...
Forestshopkeeper Posted August 20, 2013 Share Posted August 20, 2013 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 Quote Link to comment Share on other sites More sharing options...
♥kymation Posted August 20, 2013 Share Posted August 20, 2013 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 Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
Forestshopkeeper Posted August 20, 2013 Share Posted August 20, 2013 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 Quote Link to comment Share on other sites More sharing options...
♥kymation Posted August 20, 2013 Share Posted August 20, 2013 It has to be in there somewhere. Check all of the files, not just the ones you remember changing. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
Forestshopkeeper Posted August 20, 2013 Share Posted August 20, 2013 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 Quote Link to comment Share on other sites More sharing options...
♥kymation Posted August 20, 2013 Share Posted August 20, 2013 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 Quote See my profile for a list of my addons and ways to get support. 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.