Genie Posted July 17, 2014 Share Posted July 17, 2014 I am creating my custom module for prestashop 1.6. Now i am stuck at this pont. http://doc.prestasho...he front-office here i got that i have to create ModuleFrontController but no clear description how to crete it and what to write in that class Link to comment Share on other sites More sharing options...
vekia Posted July 17, 2014 Share Posted July 17, 2014 create file named "display.php" in (full path) /modules/YOUR_MODULE/controllers/front/display.php with contents: replace "mymodule" in class name with name of your module <?php class mymoduledisplayModuleFrontController extends ModuleFrontController { public function initContent() { parent::initContent(); $this->setTemplate('display.tpl'); } } 1 Link to comment Share on other sites More sharing options...
Genie Posted July 17, 2014 Author Share Posted July 17, 2014 Hello Vekia Thanks for your reply. When i am writing the above code th mymodules display.php page it is showing Fatal error: Class 'ModuleFrontController' not found in C:\xampp\htdocs\pestashop_test\modules\mymodule\display.php on line 4 That's why i wanted to know where to write ModuleFrontController and what to write in it. Thanks Jenie Link to comment Share on other sites More sharing options...
vekia Posted July 17, 2014 Share Posted July 17, 2014 hello you created file in wrong directory review my post, where i wrote correct path to file and remove TOTALLY file you created, it's wrong way of create front controller in modules Link to comment Share on other sites More sharing options...
Genie Posted July 18, 2014 Author Share Posted July 18, 2014 Hello Vekia I need your help. Will you please give a simple mymodule zip so that i can simply understand the folder and coding structure. Thanks Genie Link to comment Share on other sites More sharing options...
mohamed.belhassen Posted November 30, 2014 Share Posted November 30, 2014 Hi Genie/ALL, I face the same problem as yours, Did you find a solution for your problem? I followed all steps mentioned in this official documentation: http://doc.prestashop.com/display/PS16/Displaying+content+on+the+front-office all things work well up to reaching the section "Embedding a template in the theme". In fact, I get a fatal error and my apache error log mention the following error: "[sat Nov 29 23:03:40.405937 2014] [:error] [pid 25895] [client 41.230.241.227:32878] PHP Fatal error: Class 'documentsenderdisplayModuleFrontController' not found in /var/www/clients/client1/web1/web/prestashop/classes/controller/Controller.php on line 135" Note that myModule is called documentsender I created the mentioned folder structure under modules folder. MyModule is called "documentsender" see the joinded file to see all the content of my module folder Please assist me to bypass this fatal error. Cordially, Mohamed Belhassen documentsender.tar.gz Link to comment Share on other sites More sharing options...
mohamed.belhassen Posted November 30, 2014 Share Posted November 30, 2014 Hi Genie/ALL, I face the same problem as yours, Did you find a solution for your problem? I followed all steps mentioned in this official documentation: http://doc.prestashop.com/display/PS16/Displaying+content+on+the+front-office all things work well up to reaching the section "Embedding a template in the theme". In fact, I get a fatal error and my apache error log mention the following error: "[sat Nov 29 23:03:40.405937 2014] [:error] [pid 25895] [client 41.230.241.227:32878] PHP Fatal error: Class 'documentsenderdisplayModuleFrontController' not found in /var/www/clients/client1/web1/web/prestashop/classes/controller/Controller.php on line 135" Note that myModule is called documentsender I created the mentioned folder structure under modules folder. MyModule is called "documentsender" see the joinded file to see all the content of my module folder Please assist me to bypass this fatal error. Cordially, Mohamed Belhassen Hi All, I found the solution. In fact the official documentation is a little bit unclear about the location of the TPL file. In the first sight, I thought that the TPL should be in the same folder as the PHP file: i.e. MyModule/controllers/front but after googling, I found a post that mention that the TPL have to be placed in the following folder: MyModule/views/templates/front Cordially, Mohamed Belhassen 1 Link to comment Share on other sites More sharing options...
vekia Posted November 30, 2014 Share Posted November 30, 2014 everything is described here:http://doc.prestashop.com/display/PS16/Creating+a+first+module enjoy the docs! :-) 2 Link to comment Share on other sites More sharing options...
Recommended Posts