Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2007
    Posts
    92
    Plugin Contributions
    0

    help question PHP Fatal error: Cannot redeclare class order

    Please can someone help me with this. I've been trying to figure out why I'm getting a blank page when I click on the checkout button for my shop. I've spent days trying to work this out and I've now got the following error to come up in the error logging:

    PHP Fatal error: Cannot redeclare class order in /home/lornah02/public_html/includes/classes/order.php on line 1068

    I've looked at the order.php page and the only thing that is on that line is }

    I've tried removing it incase this was an extra but all I acheive when I do this is the following error:

    PHP Parse error: syntax error, unexpected ';', expecting T_FUNCTION in /home/lornah02/public_html/includes/classes/order.php on line 1068

    I know that it is difficult to offer any suggestions as to where this error is coming from without knowing all the addon's etc that are in my shop but can anyone even point me in the direction of where I should be looking or what could be wrong with the files as I have no idea. On looking at the files they appear to be correctly formatted, but I don't know if its even the orders.php file that has the error or if its somewhere else.

    From everything I've read it sounds like when most people get these errors its to do with the language files but I can't see anything wrong with them.

    Please can someone offer some help on this. I really don't know what to do with it now.

    Any help will be greatly appreciated with this.

    Thanks in advance.

  2. #2
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    4,478
    Plugin Contributions
    121

    Default Re: PHP Fatal Error Msg

    What's happening is that you have two pieces of code doing this operation:

    require(DIR_WS_CLASSES . 'order.php');

    To fix it, change all of these calls to

    require_once(DIR_WS_CLASSES . 'order.php');

    Try just changing these two files:

    includes/modules/checkout_process.php
    includes/modules/shipping_estimator.php

    and see if that fixes it.
    Scott C Wilson, That Software Guy, Plugin Moderator
    Contributions: Quantity Discounts, Better Together, SMS on Sale, Gift Wrap at Checkout, and more.

  3. #3
    Join Date
    Jan 2004
    Posts
    58,243
    Blog Entries
    3
    Plugin Contributions
    106

    Default Re: PHP Fatal Error Msg

    And, if that fixes it, then all you've done is put a bandage on a larger problem, which might be causing other more critical problems to be hidden.
    You really need to find out what's causing the loop that's loading the file repeatedly.
    And, yes, it's likely related to an addon, or a missing/extra file on your server, etc.
    ref: http://www.zen-cart.com/wiki/index.p...Obscure_Issues
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donations always welcome: www.zen-cart.com/donate

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #4
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    4,478
    Plugin Contributions
    121

    Default Re: PHP Fatal Error Msg

    Wouldn't you suspect it's just a mod that has done a require when they should have done a require_once?

    This certainly isn't an issue in a 1.3.8 or 1.3.9 vanilla download.
    Scott C Wilson, That Software Guy, Plugin Moderator
    Contributions: Quantity Discounts, Better Together, SMS on Sale, Gift Wrap at Checkout, and more.

  5. #5
    Join Date
    Jan 2004
    Posts
    58,243
    Blog Entries
    3
    Plugin Contributions
    106

    Default Re: PHP Fatal Error Msg

    It's certainly not something related to original core code.
    But I've seen cases where people have uploaded duplicate files, or renamed original files and kept the .php extension and thus caused the repeat loading of core files, or added addons that duplicated core files or did poor overrides, or where people uploaded module files into language folders thus causing modules to get "loaded" twice without obvious explanation.

    Identifying *all* differences between original core code and what's on the live site will always help to expose what exactly is causing the problem.
    This includes even renamed header_php.php files, really anything.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donations always welcome: www.zen-cart.com/donate

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Aug 2007
    Posts
    92
    Plugin Contributions
    0

    Default Re: PHP Fatal Error Msg

    Thanks for the help on this I'll look into it and see if I can work out the problem. I'll let you know what I find.

  7. #7
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    4,478
    Plugin Contributions
    121

    Default Re: PHP Fatal Error Msg

    sketchgal, per Dr. Byte's suggestion, is it possible that you renamed a file

    so-and-so.php

    to

    backup-so-and-so.php

    or something like that? When renaming php files, it's best to add an extension *after* the .php extension, i.e.

    so-and-so.php.old

    especially in case the file is in a directory which is subject to automatic loading. Is it possible that this, rather than a mod, is what's causing your problem?
    Scott C Wilson, That Software Guy, Plugin Moderator
    Contributions: Quantity Discounts, Better Together, SMS on Sale, Gift Wrap at Checkout, and more.

  8. #8
    Join Date
    Aug 2007
    Posts
    92
    Plugin Contributions
    0

    Default Re: PHP Fatal Error Msg

    Thanks very much for all your help with this, after a few days of working through the site I've found the file that was causing the problems. swguy was correct I'd renamed a file header-BACKUP.php instead of header.php-BACKUP. Thanks for suggesting that could be causing the problem.

 

 

Similar Threads

  1. Fatal error: Cannot redeclare class order, with Google Checkout
    By buildingblocks in forum General Questions
    Replies: 1
    Last Post: 14 Jun 2010, 11:37 PM
  2. Replies: 17
    Last Post: 31 Mar 2010, 09:47 AM
  3. Fatal error: Cannot redeclare class order
    By Oseymour in forum General Questions
    Replies: 7
    Last Post: 30 Jun 2009, 03:37 PM
  4. Fatal error: Cannot redeclare class base:order
    By DogTags in forum Installing on a Linux/Unix Server
    Replies: 10
    Last Post: 13 Jan 2007, 02:58 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
  •