Webotool Posted July 5, 2017 Share Posted July 5, 2017 Hello, I try to display with the call of the display() method in the getContent() method a .tpl file but the configuration page of the module remains white ... The .tpl file is located in mymodcomments / views / templates / hook / getContent.tpl Here is the code class MyModComments extends Module { public function __construct() { $this->name = 'mymodcomments'; $this->tab = 'front_office_features'; $this->version = '0.1'; $this->displayName = 'Module of product comments'; $this->description = 'With this module, customers will be able to grade and comments products.'; parent::__construct(); $this->bootstrap = true; } public function processConfiguration() { if (Tools::isSubmit('mymod_pc_form')) { $enable_grades = Tools::getValue('enable_grades'); $enable_comments = Tools::getValue('enable_comments'); Configuration::updateValue('MYMOD_GRADES', $enable_grades); Configuration::updateValue('MYMOD_COMMENTS', $enable_comments); } } public function getContent() { return $this->display(__FILE__, 'getContent.tpl'); } } Thanks for your help Link to comment Share on other sites More sharing options...
razaro Posted July 5, 2017 Share Posted July 5, 2017 Hi Welcome to the forum. That reminds me of code from Fabien Serny's book, but that is for 1.6 version. And 1.7 do bring some changes. Do check developer documentation http://developers.prestashop.com/ http://developers.prestashop.com/module/80-Updating/index.html http://developers.prestashop.com/module/40-Widgets/widget.html?highlight=widget But also for 1.7 do check PrestaShop native modules that starts with ps_ https://github.com/PrestaShop?utf8=%E2%9C%93&q=ps_&type=&language= Link to comment Share on other sites More sharing options...
Webotool Posted July 6, 2017 Author Share Posted July 6, 2017 Hi Yes I did buy his book last year In the doc and the ps_ modules they use Helper classes. Thanks Link to comment Share on other sites More sharing options...
Webotool Posted July 7, 2017 Author Share Posted July 7, 2017 The problem is solved by itself ... Link to comment Share on other sites More sharing options...
razaro Posted July 7, 2017 Share Posted July 7, 2017 Could you explain a bit, nothing is solved by itself Did you change any code, cleared cache ? Link to comment Share on other sites More sharing options...
Webotool Posted July 7, 2017 Author Share Posted July 7, 2017 Probably the cache, this morning after starting the computer the module was working. I did not touch the code. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now