Levius Posted December 10, 2013 Share Posted December 10, 2013 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 More sharing options...
vekia Posted December 10, 2013 Share Posted December 10, 2013 It isn't necessary to load override with require_once just call in your module Search class somewhere without require_once override file. Link to comment Share on other sites More sharing options...
Levius Posted December 11, 2013 Author Share Posted December 11, 2013 Hi, thanks for the reply. This may sound ridiculous but how can I do that? I am quite new in prestashop. Link to comment Share on other sites More sharing options...
vekia Posted December 11, 2013 Share Posted December 11, 2013 just remove require_once(dirname(__FILE__).'/../../override/classes/Search.php'); and instead SearchCore use just new Search(); Link to comment Share on other sites More sharing options...
Levius Posted December 16, 2013 Author Share Posted December 16, 2013 Wow! Thanks! That did the trick! Thanks again.. Link to comment Share on other sites More sharing options...
vekia Posted December 16, 2013 Share Posted December 16, 2013 You're welcome i marked whole topic as [solved] with regards, Milos Link to comment Share on other sites More sharing options...
Recommended Posts