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
    9,681
    Plugin Contributions
    123

    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.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  3. #3
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    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!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    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
    9,681
    Plugin Contributions
    123

    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.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  5. #5
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    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!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    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
    9,681
    Plugin Contributions
    123

    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?
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  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. v151 Shipping Estimator Sidebox PHP Fatal error: Cannot redeclare class order on 1.5.1
    By explorer1979 in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 10 Apr 2014, 08:29 AM
  2. PHP Fatal error: Cannot redeclare class upload
    By cshart in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 7 Dec 2011, 06:33 AM
  3. Replies: 17
    Last Post: 31 Mar 2010, 09:47 AM
  4. Fatal error: Cannot redeclare class order
    By Oseymour in forum General Questions
    Replies: 7
    Last Post: 30 Jun 2009, 03:37 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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR