Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.

Cannot redeclare class

Locked

Started by deus on 2 Feb 2007, 1:41 AM · Views: 4,558

Results 1 to 11 of 11
This thread is locked. New replies are disabled.
2 Feb 2007, 1:41 AM
#1
deus avatar

deus

New Zenner

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

Post #1 by deus

any ideas why this is happening?

Fatal error: Cannot redeclare class authorizenet in /home/periodho/public_html/includes/modules/payment/authorizenet.php on line 15

This is line 15: class authorizenet extends base {

Due to this i can't access any payment modules.

Cheers

2 Feb 2007, 1:43 AM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #2 by ajeh

See if you left a copy of that payment module in your directory:
/includes/modules/payment

Those are autoloading directories ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

2 Feb 2007, 2:35 AM
#3
deus avatar

deus

New Zenner

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

Post #3 by deus

Hey Ajeh,

I have a copy in:

/includes/modules/payment

and

/includes/languages/english/modules/payment.

kinda lost now..:lamo:

2 Feb 2007, 2:41 AM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #4 by ajeh

Let me explain it a different way ...

Usually when you see a duplicate class that means it is being called twice ...

On the Modules for Payment, Shipping and Order Totals ... often times the cause is having a backup file or an attempted cloned file etc. in the directory ...

As it is a self installing directory ... even if I loaded a copy of authorizenet.php renamed to fred.php it would trip the error due to the code inside ...

If you look at your site via FTP ... peek in the:
/includes/modules/payment

Do you see extra copies of payment modules or one's you may be experimenting with?

If so, remove them ...

If still unsure ... go to Tools ... Developer's Tool Kit ...

In the bottom input box enter:
class authorizenet

Select Catalog/Admin from the dropdown and click Search ...

In the directory:
/includes/modules/payment

Only 1 file should be listed that has this code ...

If you have more than one then that is the problem ...

Note: do not mixup class authorizenet with class authorizenet_aim as those are separate modules ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

2 Feb 2007, 2:54 AM
#5
deus avatar

deus

New Zenner

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

Post #5 by deus

i had placed a module in there yesterday "iPayment" which gave me an error (same kind) so i deleted it.

Now i get this error with both authorize.net and authorize_aim.net

Following was the result of the search in Dev's tk

/home/periodho/public_html/includes/languages/english/modules/payment/authorizenet.php

Line #14 : class authorizenet extends base {

/home/periodho/public_html/includes/languages/english/modules/payment/authorizenet_aim.php

Line #15 : class authorizenet_aim extends base {

/home/periodho/public_html/includes/modules/payment/authorizenet.php

Line #14 : class authorizenet extends base {

**/home/periodho/public_html/includes/modules/payment/authorizenet_aim.php
**

Line #15 : class authorizenet_aim extends base {

appreciate your help here Ajeh

what method is used to install modules, just place them into folders via ftp?

2 Feb 2007, 3:47 AM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #6 by ajeh

You have overwritten the language files with copies of the code ... :eek:

Reload the clean files for:
/includes/languages/english/payment/authorizenet.php
/includes/languages/english/payment/authorizenet_aim.php

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

2 Feb 2007, 4:31 AM
#7
deus avatar

deus

New Zenner

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

Post #7 by deus

no idea how i did it but thanks Ajeh!

so i'm guessing my initial problem with the iPayment module i tried to install needed to be different in modules/payment to the one in english/modules/payment?

cheers

2 Feb 2007, 4:51 AM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #8 by ajeh

Possibly ... one directory holds the code and the other the language file ...

Mixing them up causes all kinds of havoc ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

2 Feb 2007, 4:53 AM
#9
deus avatar

deus

New Zenner

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

Post #9 by deus

As i've discovered!

I've downloaded the payment module however without that second file i guess it's not going to work at all, seems i'll have to use OSC after all this...crap

2 Feb 2007, 4:55 AM
#10
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #10 by ajeh

When adding Payment modules ...

1 They need to be written for Zen Cart and for the version of Zen Cart that you are using ...

2 You need to load the files in the right directories

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

2 Feb 2007, 5:31 AM
#11
deus avatar

deus

New Zenner

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

Post #11 by deus

unfortunately the module has only been written for OSC. i've put it up here to see if anyone has ever created or edited it though no luck yet.

i've only ever found 1 post about eMatters and it all went over my head.

Thanks for your help though, very much appreciated!