Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Fatal error: Cannot redeclare class masterproduct


Sabinoo

Recommended Posts

Hello

 

Can you help me solve a problem, please ?

 

I have this error message on my OsC test shop :

 

Fatal error: Cannot redeclare class masterproduct in (test URL)/catalog/includes/classes/masters_and_slaves.php on line 3

 

This is a virgin installation with only Ultrapics and Master Products added to this, without a template.

 

And yet, the masterproduct class is declared only once ! I don't understand, would you have an idea ?

 

More details : masterproduct est déclaré this way in masters_and_slaves.php :

class masterProduct {

var $product_id, $slaves;

I made a text string search in the totality of the files of my OsC test shop, searching the "masterproduct" term, and the results are clear, class masterProduct { only appears one time, no more.

 

Maybe the file masters_and_slaves.php is called twice... but that, I don't know how to check it :huh:

 

Thank you very much if you can give me a hand, or make a miracle suggestion :)

 

Sabinoo

Link to comment
Share on other sites

OK, I received help from another source, and it seems the problem is solved. Here's how it was done, in case it can help someone else later on :

 

Remove or comment out the line 3 of /includes/boxes/suggested_accessories.php :

require(DIR_WS_CLASSES . "masters_and_slaves.php");

 

Side question : would you know what is the function of the file suggested_accesories.php ? I'd like to test and see if the modified file won't cause a bug elsewhere, but I can't find where/when that file is used...

Link to comment
Share on other sites

You could also change all your requires to require_once. That would make sure that it is available without duplicating if it was already available, e.g.

require_once(DIR_WS_CLASSES . "masters_and_slaves.php");

It has been a while since I looked at this contribution, but from the location, I would expect /includes/boxes/suggested_accessories.php to be an infobox that appears in the left (/includes/column_left.php) or right column (/includes/column_right.php). I would think that you would need the require on pages where the infobox appears but there is no other use of Master Products.

Always back up before making changes.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...