Jump to content

[SOLVED] Calling core classes to modules


Recommended Posts

There is this one error I've been stuck for hours of searching and trying to solve. This is the scenario I am in.

 

First is I created an override for the SearchCore and the SearchController which I placed in the override folder. I then created a module which I needs to access the search core and use one of the method inside, specifically the find() method. In that module I have created an instance of SearchCore. This is the code:

 


require_once(dirname(__FILE__).'/../../override/classes/Search.php'); 

$filterQuery = new SearchCore;


 

I first used the method and it is working just fine. When I added a parameter in the method call, it has given me errors. The errors are Constant [variable] already defined and Cannot re-declare SearchCore. These are the codes I used:

 

Initially (working):

$search = $filterQuery->find($this->context->language->id, " ", $categories, $brands, $p, $n, $orderBy, $orderWay);

 

Modified (not working):

$search = $filterQuery->find($this->context->language->id, $query, $categories, $brands, $p, $n, $orderBy, $orderWay);

 

I anyone can atleast give me a foresight of what the problem is. Thanks in advance.

Link to comment
Share on other sites

×
×
  • Create New...