osCmax v2.5 User Manual
Page 1 of 2 12 LastLast
Results 1 to 10 of 12

bug - USPS & admin/edit_orders.php

This is a discussion on bug - USPS & admin/edit_orders.php within the USPS forums, part of the Shipping Modules category; running 2.0.25 enabled usps shipping module and on the front end is working properly. When I went to edit an ...

      
  1. #1
    osCMax Testing Team wkdwich's Avatar
    Join Date
    Jul 2007
    Posts
    307
    Rep Power
    11


    Default bug - USPS & admin/edit_orders.php

    running 2.0.25

    enabled usps shipping module and on the front end is working properly.

    When I went to edit an order today, I got a blank page. I enabled error logging

    Code:
      // Include currencies class
      require(DIR_WS_CLASSES . 'currencies.php');
      $currencies = new currencies();
    
    error_reporting(E_ALL);
    ini_set('error_log', DIR_WS_INCLUDES . mystuff_errors.log');
    This returned me with:
    Code:
    Notice: Undefined property: GlobalTest in /home/mystuff/public_html/catalog/includes/modules/shipping/usps.php on line 31
    
    Notice: Use of undefined constant MODULE_SHIPPING_USPS_INSURE - assumed 'MODULE_SHIPPING_USPS_INSURE' in /home/mystuff/public_html/catalog/includes/modules/shipping/usps.php on line 113
    
    Fatal error: Call to undefined function: tep_round_up() in /home/mystuff/public_html/catalog/includes/modules/shipping/usps.php on line 162
    I verified the bug in my dev cart. That cart USPS was not installed, edit orders comes up properly. I installed & enabled USPS and edit orders gave me a blank page. I then disabled but did not uninstall USPS and edit orders comes up properly.

    How do I repair this?
    Debbie D
    NY & VA

  2. #2
    osCMax Development Team
    ridexbuilder's Avatar
    Join Date
    Jul 2008
    Location
    Haggisland
    Posts
    3,014
    Rep Power
    36


    Talking Re: bug - USPS & admin/edit_orders.php

    This looks like the likely culprit:
    PHP Code:
          /* 
        THE FOLLOWING FUNCTION CAUSES A 500 ERROR WHEN USING PAYPAL EXPRESS 
        function round_up($valueIn, $places=0) { 
            if ($places < 0) { $places = 0; } 
            $mult = pow(10, $places); 
            return (ceil($valueIn * $mult) / $mult); 
            } 
        */ 
    Hosting plans with installation, configuration, contributions, support and maintenance.

  3. #3
    osCMax Testing Team wkdwich's Avatar
    Join Date
    Jul 2007
    Posts
    307
    Rep Power
    11


    Default Re: bug - USPS & admin/edit_orders.php

    EJ, I'm not using paypal express.. just the regular paypal IPN module
    Debbie D
    NY & VA

  4. #4
    osCMax Development Team
    ridexbuilder's Avatar
    Join Date
    Jul 2008
    Location
    Haggisland
    Posts
    3,014
    Rep Power
    36


    Post Re: bug - USPS & admin/edit_orders.php

    Didn't say you were.
    Try removing the /* and */
    Hosting plans with installation, configuration, contributions, support and maintenance.

  5. #5
    osCMax Testing Team wkdwich's Avatar
    Join Date
    Jul 2007
    Posts
    307
    Rep Power
    11


    Default Re: bug - USPS & admin/edit_orders.php

    That did not work:
    Code:
    Notice: Undefined property: GlobalTest in /home/wkdwich/public_html/shoppe/includes/modules/shipping/usps.php on line 31
    
    Notice: Use of undefined constant MODULE_SHIPPING_USPS_INSURE - assumed 'MODULE_SHIPPING_USPS_INSURE' in /home/wkdwich/public_html/shoppe/includes/modules/shipping/usps.php on line 113
    
    Fatal error: Call to undefined function: tep_round_up() in /home/wkdwich/public_html/shoppe/includes/modules/shipping/usps.php on line 162
    Debbie D
    NY & VA

  6. #6
    osCMax Developer

    michael_s's Avatar
    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    19,907
    Rep Power
    568


    Default Re: bug - USPS & admin/edit_orders.php

    these are just notices and can be ignored:

    Notice: Undefined property: GlobalTest in /home/wkdwich/public_html/shoppe/includes/modules/shipping/usps.php on line 31

    Notice: Use of undefined constant MODULE_SHIPPING_USPS_INSURE - assumed 'MODULE_SHIPPING_USPS_INSURE' in /home/wkdwich/public_html/shoppe/includes/modules/shipping/usps.php on line 113
    You should turn off notices in osCmax, application top.php to stop them from displaying. In v2.0.25 notices are Off by default, so make sure you don't turn them back on.

    This one means you are missing a function somewhere:
    Code:
    Fatal error: Call to undefined function: tep_round_up() in /home/wkdwich/public_html/shoppe/includes/modules/shipping/usps.php on line 162
    The function tep_round_up is found in /includes/functions/general.php. You should be able to resolve this issue by copying that function to the /admin/includes/functions/general.php.

    This is the function you need to add:

    PHP 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 <= 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 && $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($number0$num_right_dec $precision) + $addable;
        } else {
            
    $number_out $number;
        }
        return 
    $number_out;
      } 
    Let me know if that resolves it for you.
    Michael Sasek
    osCMax Developer


    osCmax Installation Service
    - Have our professionals install osCmax on your server - same day service!
    osCmax 2.5 User Manual - the must have beginners guide to osCmax v2.5

    Stay Up To Date with everything osCMax:
    Free osCmax Newsletters - Security notices, New Releases, osCMax News
    osCmax on Twitter - Up to the minute info as it happens. Know it first.

    osCmax Documentation

  7. #7
    osCMax Testing Team wkdwich's Avatar
    Join Date
    Jul 2007
    Posts
    307
    Rep Power
    11


    Default Re: bug - USPS & admin/edit_orders.php

    That did the trick Michael.. thanks edit orders now works dandy.. but grrrrrrr. now my usps module is totally broke.. does the bleeding ever stop???
    Debbie D
    NY & VA

  8. #8
    osCMax Testing Team wkdwich's Avatar
    Join Date
    Jul 2007
    Posts
    307
    Rep Power
    11


    Default Re: bug - USPS & admin/edit_orders.php

    Michael,
    much back and forth, testing even calling USPS, removed the module 100% - deleted it from the server.. reinstalled, tested with no setting changes except the USPS user & password info.. it worked, one by one I set the options, each time testing.. when I can down to
    Display Transit Time (default is CHECKED)
    and unCHECKED it, thats when the communication stopped between the cart and USPS servers. I tested this on the dev cart and the same thing happened.

    I doubt severly the adding of the rounding call to the admin/includes/functions/general.php had any bearing but just for good measure I removed it and tried again and it had no effect.. should I revise the bug report, with adding the rounding call or will you do that? And this other issue, make a new bug report??
    Debbie D
    NY & VA

  9. #9
    osCMax Developer

    michael_s's Avatar
    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    19,907
    Rep Power
    568


    Default Re: bug - USPS & admin/edit_orders.php

    If you can reproduce the second problem then submit two separate bug reports as they are two separate issues with the usps module.

    Also, you may want to check for updates to the usps module and read any/all documentation with the usps module (at addons.oscommerce.com) as the options may have specific configurations/edits that are required in the module code.
    Michael Sasek
    osCMax Developer


    osCmax Installation Service
    - Have our professionals install osCmax on your server - same day service!
    osCmax 2.5 User Manual - the must have beginners guide to osCmax v2.5

    Stay Up To Date with everything osCMax:
    Free osCmax Newsletters - Security notices, New Releases, osCMax News
    osCmax on Twitter - Up to the minute info as it happens. Know it first.

    osCmax Documentation

  10. #10
    osCMax Testing Team wkdwich's Avatar
    Join Date
    Jul 2007
    Posts
    307
    Rep Power
    11


    Default Re: bug - USPS & admin/edit_orders.php

    ok I will check the docs on the module and submit the 2nd bug. I did verify it in my dev cart
    Debbie D
    NY & VA

Page 1 of 2 12 LastLast

Similar Threads

  1. Update order status using edit_orders.php makes the order disappear
    By sakwoya in forum osCmax v2 Installation issues
    Replies: 7
    Last Post: 02-22-2009, 08:00 AM
  2. USPS Backup Module (When USPS Goes Down...)
    By michael_s in forum New osCommerce Contributions
    Replies: 0
    Last Post: 02-02-2009, 07:13 PM
  3. USPS Backup Module (When USPS Goes Down...)
    By michael_s in forum New osCommerce Contributions
    Replies: 0
    Last Post: 12-10-2008, 02:11 AM
  4. New changes to USPS API?
    By bkpie in forum osCMax v2 Features Discussion
    Replies: 0
    Last Post: 05-10-2008, 07:55 AM
  5. USPS Methods
    By michael_s in forum New osCommerce Contributions
    Replies: 0
    Last Post: 01-01-2008, 05:11 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •