Forums / All Other Contributions/Addons / Shipping Estimator Sidebox PHP Fatal error: Cannot redeclare class order on 1.5.1

Shipping Estimator Sidebox PHP Fatal error: Cannot redeclare class order on 1.5.1

Views: 1,510

Results 1 to 3 of 3
9 Apr 2014, 9:42 AM
#1
explorer1979 avatar

explorer1979

Inactive

Join Date:
Jan 2007
Posts:
377
Plugin Contributions:
0

Shipping Estimator Sidebox PHP Fatal error: Cannot redeclare class order on 1.5.1

HI,

I am using ZC 1.5.1 with Super Order 4.0.7, Edit Order 4.1.4

With Modeule Shipping Estimator Sidebox 2.1

On my record, only above module will changed the /includes/classes/order.php

PHP Fatal error: Cannot redeclare class order in /home/mysite/public_html/shop/includes/classes/order.php on line 1062

I am open the above /includes/classes/order.php to see on line 1062 what is it, it is just a end }, nothing anymore ..

So Shipping Estimator Sidebox 2.1 version what is wrong on it?

Actually, it work on http://www.mysite.com/shop/index.php?main_page=shopping_cart

I see the sidebox there, but I am see above error log at /shop/log

So I am post there, how to fix this?

Thank you.

10 Apr 2014, 2:07 AM
#2
explorer1979 avatar

explorer1979

Inactive

Join Date:
Jan 2007
Posts:
377
Plugin Contributions:
0

Re: Shipping Estimator Sidebox PHP Fatal error: Cannot redeclare class order on 1.5.1

Hi All,

OR how to write some PHP coding that can help me to check which class is load to make above error?
Or some coding that can list all the class name using?

I have Google this the above error know it is since the class load twice or something like that.

Thank you.

10 Apr 2014, 7:29 AM
#3
explorer1979 avatar

explorer1979

Inactive

Join Date:
Jan 2007
Posts:
377
Plugin Contributions:
0

Re: Shipping Estimator Sidebox PHP Fatal error: Cannot redeclare class order on 1.5.1

Hi All,

I fix this today.

Zen Cart have a OverRide System.

This Module will place one of new file to /includes/modules/sideboxes/shipping_estimator.php
where the original Zen Cart 1.5.1 have a same named files under
/includes/modules/shipping_estimator.php

So you must change this file
/includes/modules/shipping_estimator.php

On Line 84
From
require(DIR_WS_CLASSES . 'order.php');
Change To
require_once(DIR_WS_CLASSES . 'order.php');

On Line 132
From
require(DIR_WS_CLASSES . 'shipping.php');
Change To
require_once(DIR_WS_CLASSES . 'shipping.php');

This will fix the above PHP Fatal error: Cannot redeclare class

Additional inform there
http://www.zen-cart.com/showthread.php?158070-PHP-Fatal-error-Cannot-redeclare-class-order