Jump to content

blackopstoys

Members
  • Content count

    16
  • Joined

  • Last visited

Posts posted by blackopstoys


  1. Hi, Sorry for brief above post. I Googled my error message and ended up here on this thread. So to further clarify in the hopes of getting help here are my specifics:

    • I installed this using the instructions in July 2013 on a new copy of OSC 2.3.3
    • I went over the instructions again today to verify I didn't do anything wrong

    My specific error message is:

     

    [Mon Nov 11 11:50:22 2013] [warn] [client 71.59.138.80] mod_fcgid: stderr: PHP Fatal error: Cannot redeclare usu5_base_filename() (previously declared in /var/www/vhosts/blackopstoys.com/httpdocs/catalog/includes/application_top.php:53) in /var/www/vhosts/blackopstoys.com/httpdocs/catalog/includes/application_top.php on line 73, referer: http://www.blackopstoys.com/catalog/index.php

     

    I am also able to generate an error message on the Advance Search results page:

     

    [Mon Nov 11 11:50:50 2013] [warn] [client 71.59.138.80] mod_fcgid: stderr: PHP Fatal error: Cannot redeclare usu5_base_filename() (previously declared in /var/www/vhosts/blackopstoys.com/httpdocs/catalog/includes/application_top.php:53) in /var/www/vhosts/blackopstoys.com/httpdocs/catalog/includes/application_top.php on line 73, referer: http://www.blackopstoys.com/catalog/advanced_search_result.php?keywords=batman&search=

     

    As you suggested to someone else, that they had the usu5_base_filename() function installed twice, I did a search and here is what came up:

     

    C:\Users\Hey\Documents\Webpages\www\catalog\includes\application_top.php (2 hits)

    Line 51: function usu5_base_filename() {

    Line 75: $PHP_SELF = usu5_base_filename();

     

    When I look at my appliction_top.php page, here is the section of code corresponding:

     

    /**
     * ULTIMATE Seo Urls 5 PRO by FWR Media
     * function to return the base filename
     */
     function usu5_base_filename() {
       // Probably won't get past SCRIPT_NAME unless this is reporting cgi location
       $base = new ArrayIterator( array( 'SCRIPT_NAME', 'PHP_SELF', 'REQUEST_URI', 'ORIG_PATH_INFO', 'HTTP_X_ORIGINAL_URL', 'HTTP_X_REWRITE_URL' ) );
       while ( $base->valid() ) {
      if ( array_key_exists(  $base->current(), $_SERVER ) && !empty(  $_SERVER[$base->current()] ) ) {
        if ( false !== strpos( $_SERVER[$base->current()], '.php' ) ) {
    	  preg_match( '@[a-z0-9_]+\.php@i', $_SERVER[$base->current()], $matches );
    	  if ( is_array( $matches ) && ( array_key_exists( 0, $matches ) )
    							    && ( substr( $matches[0], -4, 4 ) == '.php' )
    							    && ( is_readable( $matches[0] ) ) ) {
    	    return $matches[0];
    	  }
        }
      }
      $base->next();
       }
       // Some odd server set ups return / for SCRIPT_NAME and PHP_SELF when accessed as mysite.com (no index.php) where they usually return /index.php
       if ( ( $_SERVER['SCRIPT_NAME'] == '/' ) || ( $_SERVER['PHP_SELF'] == '/' ) ) {
      return 'index.php';
       }
       // Return the standard RC3 code
       return ( ( ( strlen( ini_get( 'cgi.fix_pathinfo' ) ) > 0) && ( (bool)ini_get( 'cgi.fix_pathinfo' ) == false ) ) || !isset( $_SERVER['SCRIPT_NAME'] ) ) ? basename( $_SERVER['PHP_SELF'] ) : basename( $_SERVER['SCRIPT_NAME'] );
     } // End function
    // set php_self in the local scope
     $PHP_SELF = usu5_base_filename();
    

     

    The lines of code directly correspond.

     

    Finally, as I previously mentioned, I commented out line 75:

    $PHP_SELF = usu5_base_filename();

     

    And I got the white screen of death.

     

    Can you please let me know what is going on and how to fix it?

     

    Thanks.


  2. To get rid of this error you just need to install it properly as per the instructions.

     

    The error means that you have somehow added the usu5_base_filename() function twice.

     

    Hi, I've found this post and done a search in files for any reference to the usu5_base_filename() function to find out where else I've added it and here is what my search came up with:

     

    C:\Users\Hey\Documents\Webpages\www\catalog\includes\application_top.php (2 hits)

    Line 51: function usu5_base_filename() {

    Line 75: $PHP_SELF = usu5_base_filename();

     

    I tried commenting out Line 75 and got the white screen.

     

    So if I don't have it twice and I followed the directions for install and I'm still getting the errors on my error logs, what now? Thanks.


  3. I installed the usps.php file posted by @@a.forever however, when I try to edit the module once I install it in my admin, I get the modules/shipping.php page, but the table with the USPS module extends out and I see the arrow to the edit fields on the right side of the web page, but no editing fields.

     

    It's like the entire editing portion of the module is completely gone.

     

    I'm running 2.3.3 and I think it is because of this, but I don't know what to do about it.

     

    Help?


  4. Does anyone have just the lines of code and the list of the API names to change? A listing of what we need to find in the code and change? I'm using the USPS Rate V4, Intl Rate V2 on an OSC 2.3.3 cart. I have not seen any posts that relate to exactly what to change on this file.

     

    It used to be just a simple "change Standard to Priority" et al, but this doesn't seem to be happening this time.

     

    We've not been able to take orders for 36 hours and if I can't get this working, then I'll just have them switch over to flat rate.


  5. So as I mentioned on another thread (I think it's more appropriate here). I changed the 'First-Class Mail International Parcel**' to 'First-Class Package International Service**' and that is working fine.

     

    However, on domestic shipping options, I use Priority, Parcel (now Standard) and First-Class. They display as choices properly on the checkout_shipping.php page and when the customer selects the next option to go to payment, all is still well until...

     

    They get to the checkout_confirmation.php...

     

    On this page, the shipping name and price has changed to "First-Class Mail Parcel' and the price drops to the first class mail price.

     

    The odd thing is, I cannot even find a "first-class mail parcel" reference anywhere in the usps.php page or the language files, or in order total pages, shipping pages, etc.

     

    Where is this coming from? Any ideas? And is anyone else having a similar problem?


  6. Wow! Thank you so much. It was that one line of code that I must have missed years ago. You are brilliant.

     

    @@blackopstoys Look in your admin/modules.php. Does it have the code between the USPS comments shown here:

     

     case 'save':
     reset($HTTP_POST_VARS['configuration']);
     while (list($key, $value) = each($HTTP_POST_VARS['configuration'])) {
    // USPS START
    if( is_array( $value ) ) $value = implode( ', ', $value);
    // USPS END
    	 tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $value . "' where configuration_key = '" . $key . "'");
     }
     tep_redirect(tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $HTTP_GET_VARS['module']));
     break;
    

     

    If not, add that line of code and save your values in the module setup again.

     

    Regards

    Jim


  7. Hi,

     

    I think the main thing to mention is that you have to match what the USPS is returning to you exactly. RM (which I would assume is a registered trademark) actually looks like it is changing to TM (trademark) with the international first class. If you account for the Registered Trademark within your code with a string replace, then you'll need to look at changing that Trademark, too, or adding to it.

     

    I hope this helps.

     

    Hi!

    With the changes, I am still not getting rates...

    In usps.php I had 'First-Class MailRM International Parcel**\' not 'First-Class Mail International Parcel**'

    So should it be changed to 'First-Class PackageRM International Service**\' ?

    Also do I need to edit anything in the admin?

    Thanks!

    -A


  8. Yes, I experience this all the time. I've found that I have to go directly into my database (using MyPHPAdmin or some other program available through my hosting company) and the back up my database.

     

    Then I access the configuration table and make direct editing changes to the USPS domestic and international shipping options.

     

    If I use the admin panel of the web site, and select modules and shipping and then update my changes all I see is "array" for domestic and international options. It also changes my handling charge to an array and one other option I can't recall.

     

    I hope this helps you. Sadly, I've never found a complete version of the USPS module that fixes this "array" problem, so every year then the USPS changes their API names, I change them directly in the database and then directly in the usps.php.

     

     

    My USPS shipping module for calculated shipping is suddenly completely unusable. I simply went into the module in the Admin Panel to deselect Parcel Post for now, and the entire module now had no shipping options selected and every fill box simply says "array" rather than the information I entered for box dimensions, etc. I corrected it all, saved it, and again, so selections and the word "array" is filling some of the free-fill boxes for dimensions.

     

    Anyone else experiencing this or do I have a problem separate from the USPS pending changes?


  9. @Maxtors

     

    This worked mostly for me. My international shipping still won't calculate at all, but at least I have domestic back again.

     

    I'll check back tomorrow.

     

    Thanks,

    Black Ops Toys

     

    Here is My quick fix for USPS domestic rates and international issues i tested both and both are now working

     

     

    Find

    $this->intl_types = array('GLOBAL EXPRESS' => 'Global Express Guaranteed',
    							'GLOBAL EXPRESS NON-DOC RECT' => 'Global Express Guaranteed Non-Document Rectangular',
    							'GLOBAL EXPRESS NON-DOC NON-RECT' => 'Global Express Guaranteed Non-Document Non-Rectangular',
    							'EXPRESS MAIL INT' => 'Express Mail International',
    							'EXPRESS MAIL INT FLAT RATE ENV' => 'Express Mail International Flat-Rate Envelope',
    							'PRIORITY MAIL INT' => 'Priority Mail International',
    							'PRIORITY MAIL INT FLAT RATE ENV' => 'Priority Mail International Flat-Rate Envelope',
    							'PRIORITY MAIL INT FLAT RATE BOX' => 'Priority Mail International ' . $this->PriorityFlatRateBoxType,
    							'FIRST-CLASS MAIL INT' => 'First Class Mail International package** ' . $this->FirstClassIntType);
    
    

     

     

    Find

    $size = sizeof($uspsQuote);
             for ($i=0; $i<$size; $i++) {
               list($type, $cost) = each($uspsQuote[$i]);
    $type = str_replace('&lt;sup&gt;&amp;reg;&lt;/sup&gt;', '', $type);
    $type = str_replace('&lt;sup&gt;&amp;trade;&lt;/sup&gt;', '', $type);
    $type = str_replace('**', '', $type);

     

    Find

    $service = ereg('<SvcDescription>(.*)</SvcDescription>', $services[$i], $regs);
    	  $service = $regs[1];
    
                             $service = str_replace('&lt;sup&gt;&amp;reg;&lt;/sup&gt;', '', $service); 
                 $service = str_replace('&lt;sup&gt;&amp;trade;&lt;/sup&gt;', '', $service); 
    
    
                 $postage = ereg('<Postage>(.*)</Postage>', $services[$i], $regs);


  10. @ezoscommerce

     

    I had the admin code already installed from a while ago. I backed up everything, added the contribution, and the International shipping didn't work. I had no selections in the admin module and instead my customers were allowed all choices.

     

    I went directly to database to try and fix, but didn't work.

     

    I've tried to roll back, but that also doesn't work because my database has been changed. Now all I get after saving changes on the USPS module in the admin area on both Domestic and International is "array" and now I cannot take any orders.

     

    Any help appreciated and clearly needed on this!

×